obu.c:clz:
  186|  9.67k|static inline int clz(const unsigned int mask) {
  187|  9.67k|    return __builtin_clz(mask);
  188|  9.67k|}
thread_task.c:ctz:
  182|  4.15M|static inline int ctz(const unsigned int mask) {
  183|  4.15M|    return __builtin_ctz(mask);
  184|  4.15M|}
decode.c:ctz:
  182|   265k|static inline int ctz(const unsigned int mask) {
  183|   265k|    return __builtin_ctz(mask);
  184|   265k|}
decode.c:clz:
  186|  33.0M|static inline int clz(const unsigned int mask) {
  187|  33.0M|    return __builtin_clz(mask);
  188|  33.0M|}
getbits.c:clz:
  186|   185k|static inline int clz(const unsigned int mask) {
  187|   185k|    return __builtin_clz(mask);
  188|   185k|}
lf_mask.c:clz:
  186|  6.14M|static inline int clz(const unsigned int mask) {
  187|  6.14M|    return __builtin_clz(mask);
  188|  6.14M|}
warpmv.c:clz:
  186|   381k|static inline int clz(const unsigned int mask) {
  187|   381k|    return __builtin_clz(mask);
  188|   381k|}
warpmv.c:clzll:
  190|   199k|static inline int clzll(const unsigned long long mask) {
  191|   199k|    return __builtin_clzll(mask);
  192|   199k|}
looprestoration_tmpl.c:clz:
  186|  1.16M|static inline int clz(const unsigned int mask) {
  187|  1.16M|    return __builtin_clz(mask);
  188|  1.16M|}
recon_tmpl.c:clz:
  186|  84.5M|static inline int clz(const unsigned int mask) {
  187|  84.5M|    return __builtin_clz(mask);
  188|  84.5M|}
cdef_apply_tmpl.c:ctz:
  182|  4.68M|static inline int ctz(const unsigned int mask) {
  183|  4.68M|    return __builtin_ctz(mask);
  184|  4.68M|}
cdef_apply_tmpl.c:clz:
  186|  1.98M|static inline int clz(const unsigned int mask) {
  187|  1.98M|    return __builtin_clz(mask);
  188|  1.98M|}
ipred_prepare_tmpl.c:clz:
  186|  12.9M|static inline int clz(const unsigned int mask) {
  187|  12.9M|    return __builtin_clz(mask);
  188|  12.9M|}

fg_apply_tmpl.c:PXSTRIDE:
   79|  71.2k|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  71.2k|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 71.2k, False: 4]
  ------------------
   81|  71.2k|    return x >> 1;
   82|  71.2k|}
itx_tmpl.c:PXSTRIDE:
   79|  1.52M|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  1.52M|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 1.52M, False: 18.4E]
  ------------------
   81|  1.52M|    return x >> 1;
   82|  1.52M|}
looprestoration_tmpl.c:PXSTRIDE:
   79|  2.59M|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  2.59M|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 2.60M, False: 18.4E]
  ------------------
   81|  2.60M|    return x >> 1;
   82|  2.59M|}
recon_tmpl.c:PXSTRIDE:
   79|   169M|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|   169M|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 169M, False: 18.4E]
  ------------------
   81|   169M|    return x >> 1;
   82|   169M|}
cdef_apply_tmpl.c:PXSTRIDE:
   79|  41.5M|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  41.5M|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 41.5M, False: 18.4E]
  ------------------
   81|  41.5M|    return x >> 1;
   82|  41.5M|}
ipred_prepare_tmpl.c:PXSTRIDE:
   79|  81.2M|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  81.2M|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 81.2M, False: 18.4E]
  ------------------
   81|  81.2M|    return x >> 1;
   82|  81.2M|}
ipred_prepare_tmpl.c:pixel_set:
   66|  1.34M|static inline void pixel_set(pixel *const dst, const int val, const int num) {
   67|  15.0M|    for (int n = 0; n < num; n++)
  ------------------
  |  Branch (67:21): [True: 13.7M, False: 1.34M]
  ------------------
   68|  13.7M|        dst[n] = val;
   69|  1.34M|}
lf_apply_tmpl.c:PXSTRIDE:
   79|   149M|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|   149M|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 149M, False: 2.96k]
  ------------------
   81|   149M|    return x >> 1;
   82|   149M|}
lr_apply_tmpl.c:PXSTRIDE:
   79|  1.65M|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  1.65M|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 1.65M, False: 18.4E]
  ------------------
   81|  1.65M|    return x >> 1;
   82|  1.65M|}

lib.c:umin:
   47|  15.1k|static inline unsigned umin(const unsigned a, const unsigned b) {
   48|  15.1k|    return a < b ? a : b;
  ------------------
  |  Branch (48:12): [True: 0, False: 15.1k]
  ------------------
   49|  15.1k|}
obu.c:ulog2:
   71|  9.67k|static inline int ulog2(const unsigned v) {
   72|  9.67k|    return 31 ^ clz(v);
   73|  9.67k|}
obu.c:imin:
   39|   834k|static inline int imin(const int a, const int b) {
   40|   834k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 694k, False: 139k]
  ------------------
   41|   834k|}
obu.c:imax:
   35|   727k|static inline int imax(const int a, const int b) {
   36|   727k|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 101k, False: 626k]
  ------------------
   37|   727k|}
obu.c:iclip_u8:
   55|   275k|static inline int iclip_u8(const int v) {
   56|   275k|    return iclip(v, 0, 255);
   57|   275k|}
obu.c:iclip:
   51|   275k|static inline int iclip(const int v, const int min, const int max) {
   52|   275k|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 14.3k, False: 261k]
  |  Branch (52:28): [True: 2.89k, False: 258k]
  ------------------
   53|   275k|}
refmvs.c:imin:
   39|   103M|static inline int imin(const int a, const int b) {
   40|   103M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 40.7M, False: 63.1M]
  ------------------
   41|   103M|}
refmvs.c:apply_sign:
   59|  3.30M|static inline int apply_sign(const int v, const int s) {
   60|  3.30M|    return s < 0 ? -v : v;
  ------------------
  |  Branch (60:12): [True: 1.58M, False: 1.72M]
  ------------------
   61|  3.30M|}
refmvs.c:imax:
   35|  39.4M|static inline int imax(const int a, const int b) {
   36|  39.4M|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 3.83M, False: 35.6M]
  ------------------
   37|  39.4M|}
refmvs.c:apply_sign_bool:
   67|  13.5M|static inline int apply_sign_bool(const int v, const int s) {
   68|  13.5M|    return (v - s) ^ -s;
   69|  13.5M|}
refmvs.c:iclip:
   51|  30.3M|static inline int iclip(const int v, const int min, const int max) {
   52|  30.3M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 333k, False: 30.0M]
  |  Branch (52:28): [True: 399k, False: 29.6M]
  ------------------
   53|  30.3M|}
thread_task.c:umin:
   47|  20.0M|static inline unsigned umin(const unsigned a, const unsigned b) {
   48|  20.0M|    return a < b ? a : b;
  ------------------
  |  Branch (48:12): [True: 242k, False: 19.8M]
  ------------------
   49|  20.0M|}
thread_task.c:imax:
   35|  29.5M|static inline int imax(const int a, const int b) {
   36|  29.5M|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 4.65M, False: 24.9M]
  ------------------
   37|  29.5M|}
thread_task.c:iclip:
   51|  4.85M|static inline int iclip(const int v, const int min, const int max) {
   52|  4.85M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 438, False: 4.85M]
  |  Branch (52:28): [True: 49.3k, False: 4.80M]
  ------------------
   53|  4.85M|}
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|}
fg_apply_tmpl.c:imin:
   39|  27.9k|static inline int imin(const int a, const int b) {
   40|  27.9k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 4.35k, False: 23.5k]
  ------------------
   41|  27.9k|}
cdf.c:imin:
   39|   152k|static inline int imin(const int a, const int b) {
   40|   152k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 38.1k, False: 114k]
  ------------------
   41|   152k|}
decode.c:apply_sign_bool:
   67|  5.47M|static inline int apply_sign_bool(const int v, const int s) {
   68|  5.47M|    return (v - s) ^ -s;
   69|  5.47M|}
decode.c:iclip:
   51|  4.67M|static inline int iclip(const int v, const int min, const int max) {
   52|  4.67M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 243k, False: 4.42M]
  |  Branch (52:28): [True: 339k, False: 4.09M]
  ------------------
   53|  4.67M|}
decode.c:apply_sign:
   59|  2.50M|static inline int apply_sign(const int v, const int s) {
   60|  2.50M|    return s < 0 ? -v : v;
  ------------------
  |  Branch (60:12): [True: 1.22M, False: 1.27M]
  ------------------
   61|  2.50M|}
decode.c:apply_sign64:
   63|  1.80M|static inline int apply_sign64(const int v, const int64_t s) {
   64|  1.80M|    return s < 0 ? -v : v;
  ------------------
  |  Branch (64:12): [True: 295k, False: 1.51M]
  ------------------
   65|  1.80M|}
decode.c:ulog2:
   71|  33.0M|static inline int ulog2(const unsigned v) {
   72|  33.0M|    return 31 ^ clz(v);
   73|  33.0M|}
decode.c:imax:
   35|  43.0M|static inline int imax(const int a, const int b) {
   36|  43.0M|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 16.0M, False: 26.9M]
  ------------------
   37|  43.0M|}
decode.c:imin:
   39|   100M|static inline int imin(const int a, const int b) {
   40|   100M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 47.1M, False: 53.0M]
  ------------------
   41|   100M|}
decode.c:iclip_u8:
   55|  2.72M|static inline int iclip_u8(const int v) {
   56|  2.72M|    return iclip(v, 0, 255);
   57|  2.72M|}
getbits.c:ulog2:
   71|   185k|static inline int ulog2(const unsigned v) {
   72|   185k|    return 31 ^ clz(v);
   73|   185k|}
getbits.c:inv_recenter:
   79|   172k|static inline unsigned inv_recenter(const unsigned r, const unsigned v) {
   80|   172k|    if (v > (r << 1))
  ------------------
  |  Branch (80:9): [True: 4.73k, False: 167k]
  ------------------
   81|  4.73k|        return v;
   82|   167k|    else if ((v & 1) == 0)
  ------------------
  |  Branch (82:14): [True: 125k, False: 42.4k]
  ------------------
   83|   125k|        return (v >> 1) + r;
   84|  42.4k|    else
   85|  42.4k|        return r - ((v + 1) >> 1);
   86|   172k|}
lf_mask.c:imin:
   39|  94.0M|static inline int imin(const int a, const int b) {
   40|  94.0M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 34.7M, False: 59.3M]
  ------------------
   41|  94.0M|}
lf_mask.c:ulog2:
   71|  6.14M|static inline int ulog2(const unsigned v) {
   72|  6.14M|    return 31 ^ clz(v);
   73|  6.14M|}
lf_mask.c:imax:
   35|  2.57M|static inline int imax(const int a, const int b) {
   36|  2.57M|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 2.41M, False: 164k]
  ------------------
   37|  2.57M|}
lf_mask.c:iclip:
   51|  9.55M|static inline int iclip(const int v, const int min, const int max) {
   52|  9.55M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 1.54M, False: 8.00M]
  |  Branch (52:28): [True: 550k, False: 7.45M]
  ------------------
   53|  9.55M|}
msac.c:inv_recenter:
   79|   266k|static inline unsigned inv_recenter(const unsigned r, const unsigned v) {
   80|   266k|    if (v > (r << 1))
  ------------------
  |  Branch (80:9): [True: 89.7k, False: 177k]
  ------------------
   81|  89.7k|        return v;
   82|   177k|    else if ((v & 1) == 0)
  ------------------
  |  Branch (82:14): [True: 90.4k, False: 86.6k]
  ------------------
   83|  90.4k|        return (v >> 1) + r;
   84|  86.6k|    else
   85|  86.6k|        return r - ((v + 1) >> 1);
   86|   266k|}
warpmv.c:apply_sign:
   59|  1.90M|static inline int apply_sign(const int v, const int s) {
   60|  1.90M|    return s < 0 ? -v : v;
  ------------------
  |  Branch (60:12): [True: 603k, False: 1.30M]
  ------------------
   61|  1.90M|}
warpmv.c:ulog2:
   71|   381k|static inline int ulog2(const unsigned v) {
   72|   381k|    return 31 ^ clz(v);
   73|   381k|}
warpmv.c:apply_sign64:
   63|  1.75M|static inline int apply_sign64(const int v, const int64_t s) {
   64|  1.75M|    return s < 0 ? -v : v;
  ------------------
  |  Branch (64:12): [True: 332k, False: 1.41M]
  ------------------
   65|  1.75M|}
warpmv.c:iclip:
   51|  3.02M|static inline int iclip(const int v, const int min, const int max) {
   52|  3.02M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 49.7k, False: 2.97M]
  |  Branch (52:28): [True: 51.4k, False: 2.91M]
  ------------------
   53|  3.02M|}
warpmv.c:u64log2:
   75|   199k|static inline int u64log2(const uint64_t v) {
   76|   199k|    return 63 ^ clzll(v);
   77|   199k|}
itx_tmpl.c:iclip:
   51|  92.3M|static inline int iclip(const int v, const int min, const int max) {
   52|  92.3M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 6.02M, False: 86.3M]
  |  Branch (52:28): [True: 6.60M, False: 79.7M]
  ------------------
   53|  92.3M|}
itx_tmpl.c:imin:
   39|  37.4k|static inline int imin(const int a, const int b) {
   40|  37.4k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 5.13k, False: 32.3k]
  ------------------
   41|  37.4k|}
looprestoration_tmpl.c:iclip:
   51|   102M|static inline int iclip(const int v, const int min, const int max) {
   52|   102M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 141k, False: 102M]
  |  Branch (52:28): [True: 162k, False: 102M]
  ------------------
   53|   102M|}
looprestoration_tmpl.c:imax:
   35|  95.0M|static inline int imax(const int a, const int b) {
   36|  95.0M|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 73.3M, False: 21.7M]
  ------------------
   37|  95.0M|}
looprestoration_tmpl.c:umin:
   47|  94.9M|static inline unsigned umin(const unsigned a, const unsigned b) {
   48|  94.9M|    return a < b ? a : b;
  ------------------
  |  Branch (48:12): [True: 93.5M, False: 1.44M]
  ------------------
   49|  94.9M|}
recon_tmpl.c:ulog2:
   71|  84.6M|static inline int ulog2(const unsigned v) {
   72|  84.6M|    return 31 ^ clz(v);
   73|  84.6M|}
recon_tmpl.c:imin:
   39|   226M|static inline int imin(const int a, const int b) {
   40|   226M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 193M, False: 33.5M]
  ------------------
   41|   226M|}
recon_tmpl.c:imax:
   35|  17.0M|static inline int imax(const int a, const int b) {
   36|  17.0M|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 10.7M, False: 6.23M]
  ------------------
   37|  17.0M|}
recon_tmpl.c:umin:
   47|   399M|static inline unsigned umin(const unsigned a, const unsigned b) {
   48|   399M|    return a < b ? a : b;
  ------------------
  |  Branch (48:12): [True: 255M, False: 144M]
  ------------------
   49|   399M|}
recon_tmpl.c:apply_sign64:
   63|  1.25M|static inline int apply_sign64(const int v, const int64_t s) {
   64|  1.25M|    return s < 0 ? -v : v;
  ------------------
  |  Branch (64:12): [True: 71.4k, False: 1.18M]
  ------------------
   65|  1.25M|}
recon_tmpl.c:iclip:
   51|  1.85M|static inline int iclip(const int v, const int min, const int max) {
   52|  1.85M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 120k, False: 1.73M]
  |  Branch (52:28): [True: 4.39k, False: 1.72M]
  ------------------
   53|  1.85M|}
recon_tmpl.c:apply_sign_bool:
   67|   110M|static inline int apply_sign_bool(const int v, const int s) {
   68|   110M|    return (v - s) ^ -s;
   69|   110M|}
itx_1d.c:iclip:
   51|   192M|static inline int iclip(const int v, const int min, const int max) {
   52|   192M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 3.94M, False: 188M]
  |  Branch (52:28): [True: 3.95M, False: 184M]
  ------------------
   53|   192M|}
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.72M|static inline int imin(const int a, const int b) {
   40|  2.72M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 2.46M, False: 260k]
  ------------------
   41|  2.72M|}
cdef_apply_tmpl.c:ulog2:
   71|  1.98M|static inline int ulog2(const unsigned v) {
   72|  1.98M|    return 31 ^ clz(v);
   73|  1.98M|}
ipred_prepare_tmpl.c:imin:
   39|  41.0M|static inline int imin(const int a, const int b) {
   40|  41.0M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 39.2M, False: 1.77M]
  ------------------
   41|  41.0M|}
lf_apply_tmpl.c:imin:
   39|  23.9M|static inline int imin(const int a, const int b) {
   40|  23.9M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 2.42M, False: 21.5M]
  ------------------
   41|  23.9M|}
lr_apply_tmpl.c:imin:
   39|   379k|static inline int imin(const int a, const int b) {
   40|   379k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 284k, False: 94.2k]
  ------------------
   41|   379k|}

dav1d_cdef_brow_8bpc:
  111|  60.6k|{
  112|  60.6k|    Dav1dFrameContext *const f = (Dav1dFrameContext *)tc->f;
  113|  18.4E|    const int bitdepth_min_8 = BITDEPTH == 8 ? 0 : f->cur.p.bpc - 8;
  ------------------
  |  Branch (113:32): [True: 60.6k, Folded]
  ------------------
  114|  60.6k|    const Dav1dDSPContext *const dsp = f->dsp;
  115|  60.6k|    enum CdefEdgeFlags edges = CDEF_HAVE_BOTTOM | (by_start > 0 ? CDEF_HAVE_TOP : 0);
  ------------------
  |  Branch (115:52): [True: 59.3k, False: 1.23k]
  ------------------
  116|  60.6k|    pixel *ptrs[3] = { p[0], p[1], p[2] };
  117|  60.6k|    const int sbsz = 16;
  118|  60.6k|    const int sb64w = f->sb128w << 1;
  119|  60.6k|    const int damping = f->frame_hdr->cdef.damping + bitdepth_min_8;
  120|  60.6k|    const enum Dav1dPixelLayout layout = f->cur.p.layout;
  121|  60.6k|    const int uv_idx = DAV1D_PIXEL_LAYOUT_I444 - layout;
  122|  60.6k|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
  123|  60.6k|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
  124|  60.6k|    static const uint8_t uv_dirs[2][8] = { { 0, 1, 2, 3, 4, 5, 6, 7 },
  125|  60.6k|                                           { 7, 0, 2, 4, 5, 6, 6, 6 } };
  126|  60.6k|    const uint8_t *uv_dir = uv_dirs[layout == DAV1D_PIXEL_LAYOUT_I422];
  127|  60.6k|    assert(f->lf.cdef_planes);
  ------------------
  |  Branch (127:5): [True: 60.6k, False: 18.4E]
  ------------------
  128|  60.6k|    assert(BACKUP_2X8_Y == 1 && BACKUP_2X8_UV == 2);
  ------------------
  |  Branch (128:5): [True: 0, Folded]
  |  Branch (128:5): [True: 0, Folded]
  ------------------
  129|  60.6k|    const enum Backup2x8Flags frame_backup_flag = f->lf.cdef_planes;
  130|  60.6k|    const int have_tt = f->c->n_tc > 1;
  131|  60.6k|    const int sb128 = f->seq_hdr->sb128;
  132|  60.6k|    const int resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
  133|  60.6k|    const ptrdiff_t y_stride = PXSTRIDE(f->cur.stride[0]);
  ------------------
  |  |   53|  60.6k|#define PXSTRIDE(x) (x)
  ------------------
  134|  60.6k|    const ptrdiff_t uv_stride = PXSTRIDE(f->cur.stride[1]);
  ------------------
  |  |   53|  60.6k|#define PXSTRIDE(x) (x)
  ------------------
  135|       |
  136|   372k|    for (int bit = 0, by = by_start; by < by_end; by += 2, edges |= CDEF_HAVE_TOP) {
  ------------------
  |  Branch (136:38): [True: 311k, False: 61.0k]
  ------------------
  137|   311k|        const int tf = tc->top_pre_cdef_toggle;
  138|   311k|        const int by_idx = (by & 30) >> 1;
  139|   311k|        if (by + 2 >= f->bh) edges &= ~CDEF_HAVE_BOTTOM;
  ------------------
  |  Branch (139:13): [True: 1.14k, False: 310k]
  ------------------
  140|       |
  141|   314k|        if ((!have_tt || sbrow_start || by + 2 < by_end) &&
  ------------------
  |  Branch (141:14): [True: 18.4E, False: 314k]
  |  Branch (141:26): [True: 29.5k, False: 285k]
  |  Branch (141:41): [True: 254k, False: 31.0k]
  ------------------
  142|   283k|            edges & CDEF_HAVE_BOTTOM)
  ------------------
  |  Branch (142:13): [True: 283k, False: 18.4E]
  ------------------
  143|   283k|        {
  144|       |            // backup pre-filter data for next iteration
  145|   283k|            pixel *const cdef_top_bak[3] = {
  146|   283k|                f->lf.cdef_line[!tf][0] + have_tt * sby * 4 * y_stride,
  147|   283k|                f->lf.cdef_line[!tf][1] + have_tt * sby * 8 * uv_stride,
  148|   283k|                f->lf.cdef_line[!tf][2] + have_tt * sby * 8 * uv_stride
  149|   283k|            };
  150|   283k|            backup2lines(cdef_top_bak, ptrs, f->cur.stride, layout, frame_backup_flag);
  151|   283k|        }
  152|       |
  153|   311k|        const pixel *top_base[3], *bot_base[3];
  154|   311k|        pixel *const *const lpf = resize ? f->lf.cdef_lpf_line : f->lf.lr_lpf_line;
  ------------------
  |  Branch (154:35): [True: 73.9k, False: 237k]
  ------------------
  155|   312k|        if (have_tt && sbrow_start && by == by_start) {
  ------------------
  |  Branch (155:13): [True: 312k, False: 18.4E]
  |  Branch (155:24): [True: 29.7k, False: 282k]
  |  Branch (155:39): [True: 29.7k, False: 0]
  ------------------
  156|  29.7k|            const int line = resize ? (sby - 1) * 4 : sby * (4 << sb128) - 4;
  ------------------
  |  Branch (156:30): [True: 5.48k, False: 24.2k]
  ------------------
  157|   118k|            for (int pl = 0; pl < 3; pl++)
  ------------------
  |  Branch (157:30): [True: 89.2k, False: 29.7k]
  ------------------
  158|  89.2k|                top_base[pl] = &lpf[pl][line * (pl ? uv_stride : y_stride)];
  ------------------
  |  Branch (158:49): [True: 59.4k, False: 29.7k]
  ------------------
  159|   281k|        } else {
  160|   281k|            top_base[0] = &f->lf.cdef_line[tf][0][have_tt * sby * 4 * y_stride];
  161|   281k|            top_base[1] = &f->lf.cdef_line[tf][1][have_tt * sby * 8 * uv_stride];
  162|   281k|            top_base[2] = &f->lf.cdef_line[tf][2][have_tt * sby * 8 * uv_stride];
  163|   281k|        }
  164|   312k|        if (have_tt && !sbrow_start && by + 2 >= by_end) {
  ------------------
  |  Branch (164:13): [True: 312k, False: 18.4E]
  |  Branch (164:24): [True: 283k, False: 29.0k]
  |  Branch (164:40): [True: 30.9k, False: 252k]
  ------------------
  165|  30.9k|            const int line = resize ? sby * 4 + 2 : sby * (4 << sb128) + 4 * sb128 + 2;
  ------------------
  |  Branch (165:30): [True: 5.74k, False: 25.2k]
  ------------------
  166|   123k|            for (int pl = 0; pl < 3; pl++)
  ------------------
  |  Branch (166:30): [True: 92.9k, False: 30.9k]
  ------------------
  167|  92.9k|                bot_base[pl] = &lpf[pl][line * (pl ? uv_stride : y_stride)];
  ------------------
  |  Branch (167:49): [True: 61.9k, False: 31.0k]
  ------------------
  168|   280k|        } else {
  169|   280k|            bot_base[0] = ptrs[0] + 8 * y_stride;
  170|   280k|            bot_base[1] = ptrs[1] + (8 >> ss_ver) * uv_stride;
  171|   280k|            bot_base[2] = ptrs[2] + (8 >> ss_ver) * uv_stride;
  172|   280k|        }
  173|       |
  174|   311k|        ALIGN_STK_16(pixel, lr_bak, 2 /* idx */, [3 /* plane */][8 /* y */][2 /* x */]);
  ------------------
  |  |  100|   311k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|   311k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  175|   311k|        enum Backup2x8Flags prev_flag = 0;
  176|  1.28M|        for (int sbx = 0; sbx < sb64w; sbx++) {
  ------------------
  |  Branch (176:27): [True: 973k, False: 311k]
  ------------------
  177|   973k|            const int sb128x = sbx >> 1;
  178|   973k|            const int sb64_idx = ((by & sbsz) >> 3) + (sbx & 1);
  179|   973k|            const int cdef_idx = lflvl[sb128x].cdef_idx[sb64_idx];
  180|   973k|            unsigned row_mask = lflvl[sb128x].noskip_mask[by_idx][sbx & 1];
  181|   973k|            const int y_lvl = cdef_idx == -1 ? 0 : f->frame_hdr->cdef.y_strength[cdef_idx];
  ------------------
  |  Branch (181:31): [True: 545k, False: 428k]
  ------------------
  182|   973k|            const int uv_lvl = cdef_idx == -1 ? 0 : f->frame_hdr->cdef.uv_strength[cdef_idx];
  ------------------
  |  Branch (182:32): [True: 545k, False: 428k]
  ------------------
  183|   973k|            if (!row_mask || !(y_lvl | uv_lvl)) {
  ------------------
  |  Branch (183:17): [True: 634k, False: 338k]
  |  Branch (183:30): [True: 4.95k, False: 334k]
  ------------------
  184|   646k|                prev_flag = 0;
  185|   646k|                continue;
  186|   646k|            }
  187|       |
  188|   327k|            const enum Backup2x8Flags flag = (!!y_lvl) | ((!!uv_lvl) << 1);
  189|       |
  190|   327k|            const int y_pri_lvl = (y_lvl >> 2) << bitdepth_min_8;
  191|   327k|            int y_sec_lvl = y_lvl & 3;
  192|   327k|            y_sec_lvl += y_sec_lvl == 3;
  193|   327k|            y_sec_lvl <<= bitdepth_min_8;
  194|       |
  195|   327k|            const int uv_pri_lvl = (uv_lvl >> 2) << bitdepth_min_8;
  196|   327k|            int uv_sec_lvl = uv_lvl & 3;
  197|   327k|            uv_sec_lvl += uv_sec_lvl == 3;
  198|   327k|            uv_sec_lvl <<= bitdepth_min_8;
  199|       |
  200|   327k|            const int bx_base = sbx * sbsz, bx_limit = imin(sbsz, f->bw - bx_base);
  201|  2.47M|            while (row_mask) {
  ------------------
  |  Branch (201:20): [True: 2.16M, False: 307k]
  ------------------
  202|  2.16M|                const int bx_off = ctz(row_mask) & ~1;
  203|  2.16M|                row_mask &= ~(3U << bx_off);
  204|  2.16M|                if (bx_off >= bx_limit) break;
  ------------------
  |  Branch (204:21): [True: 20.1k, False: 2.14M]
  ------------------
  205|       |
  206|  2.14M|                const int bx = bx_base + bx_off;
  207|  2.14M|                const int have_right = bx + 2 < f->bw;
  208|  2.14M|                const enum CdefEdgeFlags b_edges = edges |
  209|  2.14M|                    (bx > 0 ? CDEF_HAVE_LEFT : 0) | (have_right ? CDEF_HAVE_RIGHT : 0);
  ------------------
  |  Branch (209:22): [True: 2.04M, False: 100k]
  |  Branch (209:54): [True: 2.05M, False: 94.7k]
  ------------------
  210|       |
  211|  2.14M|                const ptrdiff_t x_y = (ptrdiff_t) bx * 4, x_uv = x_y >> ss_hor;
  212|  2.14M|                pixel *const bptrs[3] = { ptrs[0] + x_y, ptrs[1] + x_uv, ptrs[2] + x_uv };
  213|       |
  214|  2.14M|                const enum Backup2x8Flags do_left = (prev_flag ^ flag) & flag;
  215|  2.14M|                if (do_left && bx > 0)
  ------------------
  |  Branch (215:21): [True: 168k, False: 1.98M]
  |  Branch (215:32): [True: 94.1k, False: 74.2k]
  ------------------
  216|  94.1k|                    backup2x8(lr_bak[bit], bptrs, f->cur.stride, 0, layout, do_left);
  217|  2.14M|                if (have_right &&
  ------------------
  |  Branch (217:21): [True: 2.06M, False: 87.7k]
  ------------------
  218|  2.06M|                    (bx_off < 14 ? ((row_mask >> (bx_off + 2)) & 3)
  ------------------
  |  Branch (218:21): [True: 1.93M, False: 126k]
  |  Branch (218:22): [True: 1.81M, False: 248k]
  ------------------
  219|  2.06M|                                 : (lflvl[(sbx + 1) >> 1].noskip_mask[by_idx][(sbx + 1) & 1] & 3)))
  220|  1.91M|                {
  221|  1.91M|                    backup2x8(lr_bak[!bit], bptrs, f->cur.stride, 8, layout, flag);
  222|  1.91M|                    prev_flag = flag;
  223|  1.91M|                } else {
  224|   230k|                    prev_flag = 0;
  225|   230k|                }
  226|       |
  227|  2.14M|                int dir;
  228|  2.14M|                unsigned variance;
  229|  2.14M|                if (y_pri_lvl || uv_pri_lvl)
  ------------------
  |  Branch (229:21): [True: 1.75M, False: 396k]
  |  Branch (229:34): [True: 201k, False: 194k]
  ------------------
  230|  1.81M|                    dir = dsp->cdef.dir(bptrs[0], f->cur.stride[0],
  231|  1.81M|                                        &variance HIGHBD_CALL_SUFFIX);
  232|       |
  233|  2.14M|                if (y_lvl) {
  ------------------
  |  Branch (233:21): [True: 1.91M, False: 234k]
  ------------------
  234|  1.91M|                    const int adj_y_pri_lvl = y_pri_lvl ? adjust_strength(y_pri_lvl, variance) : 0;
  ------------------
  |  Branch (234:47): [True: 1.65M, False: 258k]
  ------------------
  235|  1.91M|                    if (adj_y_pri_lvl || y_sec_lvl)
  ------------------
  |  Branch (235:25): [True: 983k, False: 931k]
  |  Branch (235:42): [True: 569k, False: 362k]
  ------------------
  236|  1.52M|                        dsp->cdef.fb[0](bptrs[0], f->cur.stride[0], lr_bak[bit][0],
  237|  1.52M|                                        top_base[0] + x_y, bot_base[0] + x_y,
  238|  1.52M|                                        adj_y_pri_lvl, y_sec_lvl,
  239|  1.52M|                                        y_pri_lvl ? dir : 0, damping,
  ------------------
  |  Branch (239:41): [True: 1.26M, False: 267k]
  ------------------
  240|  1.52M|                                        b_edges HIGHBD_CALL_SUFFIX);
  241|  1.91M|                }
  242|  2.14M|                if (uv_lvl) {
  ------------------
  |  Branch (242:21): [True: 1.59M, False: 553k]
  ------------------
  243|  1.59M|                    assert(layout != DAV1D_PIXEL_LAYOUT_I400);
  ------------------
  |  Branch (243:21): [True: 1.59M, False: 18.4E]
  ------------------
  244|  1.59M|                    const int uvdir = uv_pri_lvl ? uv_dir[dir] : 0;
  ------------------
  |  Branch (244:39): [True: 1.40M, False: 192k]
  ------------------
  245|  4.71M|                    for (int pl = 1; pl <= 2; pl++)
  ------------------
  |  Branch (245:38): [True: 3.11M, False: 1.59M]
  ------------------
  246|  3.11M|                        dsp->cdef.fb[uv_idx](bptrs[pl], f->cur.stride[1], lr_bak[bit][pl],
  247|  3.11M|                                             top_base[pl] + x_uv, bot_base[pl] + x_uv,
  248|  3.11M|                                             uv_pri_lvl, uv_sec_lvl, uvdir,
  249|  3.11M|                                             damping - 1, b_edges HIGHBD_CALL_SUFFIX);
  250|  1.59M|                }
  251|       |
  252|  2.14M|                bit ^= 1;
  253|  2.14M|            }
  254|   327k|        }
  255|       |
  256|   311k|        ptrs[0] += 8 * y_stride;
  257|   311k|        ptrs[1] += (8 >> ss_ver) * uv_stride;
  258|   311k|        ptrs[2] += (8 >> ss_ver) * uv_stride;
  259|   311k|        tc->top_pre_cdef_toggle ^= 1;
  260|   311k|    }
  261|  60.6k|}
cdef_apply_tmpl.c:backup2lines:
   45|  29.9M|{
   46|  29.9M|    if (flag & BACKUP_2X8_Y) {
  ------------------
  |  Branch (46:9): [True: 29.9M, False: 36.4k]
  ------------------
   47|  29.9M|        const ptrdiff_t y_stride = PXSTRIDE(stride[0]);
  ------------------
  |  |   53|  29.9M|#define PXSTRIDE(x) (x)
  ------------------
   48|  29.9M|        if (y_stride < 0)
  ------------------
  |  Branch (48:13): [True: 0, False: 29.9M]
  ------------------
   49|      0|            pixel_copy(dst[0] + y_stride, src[0] + 7 * y_stride, -2 * y_stride);
  ------------------
  |  |   47|      0|#define pixel_copy memcpy
  ------------------
   50|  29.9M|        else
   51|  29.9M|            pixel_copy(dst[0], src[0] + 6 * y_stride, 2 * y_stride);
  ------------------
  |  |   47|  29.9M|#define pixel_copy memcpy
  ------------------
   52|  29.9M|    }
   53|       |
   54|  29.9M|    if (flag & BACKUP_2X8_UV) {
  ------------------
  |  Branch (54:9): [True: 218k, False: 29.7M]
  ------------------
   55|   218k|        assert(layout != DAV1D_PIXEL_LAYOUT_I400);
  ------------------
  |  Branch (55:9): [True: 218k, False: 18.4E]
  ------------------
   56|   218k|        const ptrdiff_t uv_stride = PXSTRIDE(stride[1]);
  ------------------
  |  |   53|   218k|#define PXSTRIDE(x) (x)
  ------------------
   57|   218k|        if (uv_stride < 0) {
  ------------------
  |  Branch (57:13): [True: 0, False: 218k]
  ------------------
   58|      0|            const int uv_off = layout == DAV1D_PIXEL_LAYOUT_I420 ? 3 : 7;
  ------------------
  |  Branch (58:32): [True: 0, False: 0]
  ------------------
   59|      0|            pixel_copy(dst[1] + uv_stride, src[1] + uv_off * uv_stride, -2 * uv_stride);
  ------------------
  |  |   47|      0|#define pixel_copy memcpy
  ------------------
   60|      0|            pixel_copy(dst[2] + uv_stride, src[2] + uv_off * uv_stride, -2 * uv_stride);
  ------------------
  |  |   47|      0|#define pixel_copy memcpy
  ------------------
   61|   218k|        } else {
   62|   218k|            const int uv_off = layout == DAV1D_PIXEL_LAYOUT_I420 ? 2 : 6;
  ------------------
  |  Branch (62:32): [True: 140k, False: 78.0k]
  ------------------
   63|   218k|            pixel_copy(dst[1], src[1] + uv_off * uv_stride, 2 * uv_stride);
  ------------------
  |  |   47|   218k|#define pixel_copy memcpy
  ------------------
   64|   218k|            pixel_copy(dst[2], src[2] + uv_off * uv_stride, 2 * uv_stride);
  ------------------
  |  |   47|   218k|#define pixel_copy memcpy
  ------------------
   65|   218k|        }
   66|   218k|    }
   67|  29.9M|}
cdef_apply_tmpl.c:backup2x8:
   74|  4.35M|{
   75|  4.35M|    ptrdiff_t y_off = 0;
   76|  4.35M|    if (flag & BACKUP_2X8_Y) {
  ------------------
  |  Branch (76:9): [True: 4.01M, False: 341k]
  ------------------
   77|  4.01M|        const ptrdiff_t y_stride = PXSTRIDE(src_stride[0]);
  ------------------
  |  |   53|  4.01M|#define PXSTRIDE(x) (x)
  ------------------
   78|  4.01M|        const pixel *src0 = &src[0][x_off - 2];
   79|  35.9M|        for (int y = 0; y < 8; y++, y_off += y_stride)
  ------------------
  |  Branch (79:25): [True: 31.9M, False: 4.01M]
  ------------------
   80|  31.9M|            pixel_copy(dst[0][y], &src0[y_off], 2);
  ------------------
  |  |   47|  31.9M|#define pixel_copy memcpy
  ------------------
   81|  4.01M|    }
   82|       |
   83|  4.35M|    if (!(flag & BACKUP_2X8_UV))
  ------------------
  |  Branch (83:9): [True: 913k, False: 3.44M]
  ------------------
   84|   913k|        return;
   85|  4.35M|    assert(layout != DAV1D_PIXEL_LAYOUT_I400);
  ------------------
  |  Branch (85:5): [True: 3.43M, False: 4.01k]
  ------------------
   86|       |
   87|  3.43M|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
   88|  3.43M|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
   89|       |
   90|  3.43M|    x_off >>= ss_hor;
   91|  3.43M|    y_off = 0;
   92|  3.43M|    const ptrdiff_t uv_stride = PXSTRIDE(src_stride[1]);
  ------------------
  |  |   53|  3.43M|#define PXSTRIDE(x) (x)
  ------------------
   93|  3.43M|    const pixel *src1 = &src[1][x_off - 2], *const src2 = &src[2][x_off - 2];
   94|  18.8M|    for (int y = 0; y < (8 >> ss_ver); y++, y_off += uv_stride) {
  ------------------
  |  Branch (94:21): [True: 15.4M, False: 3.43M]
  ------------------
   95|  15.4M|        pixel_copy(dst[1][y], &src1[y_off], 2);
  ------------------
  |  |   47|  15.4M|#define pixel_copy memcpy
  ------------------
   96|  15.4M|        pixel_copy(dst[2][y], &src2[y_off], 2);
  ------------------
  |  |   47|  15.4M|#define pixel_copy memcpy
  ------------------
   97|  15.4M|    }
   98|  3.43M|}
cdef_apply_tmpl.c:adjust_strength:
  100|  3.73M|static int adjust_strength(const int strength, const unsigned var) {
  101|  3.73M|    if (!var) return 0;
  ------------------
  |  Branch (101:9): [True: 1.24M, False: 2.49M]
  ------------------
  102|  2.49M|    const int i = var >> 6 ? imin(ulog2(var >> 6), 12) : 0;
  ------------------
  |  Branch (102:19): [True: 1.98M, False: 507k]
  ------------------
  103|  2.49M|    return (strength * (4 + i) + 8) >> 4;
  104|  3.73M|}
dav1d_cdef_brow_16bpc:
  111|  4.00M|{
  112|  4.00M|    Dav1dFrameContext *const f = (Dav1dFrameContext *)tc->f;
  113|  4.00M|    const int bitdepth_min_8 = BITDEPTH == 8 ? 0 : f->cur.p.bpc - 8;
  ------------------
  |  Branch (113:32): [Folded, False: 4.00M]
  ------------------
  114|  4.00M|    const Dav1dDSPContext *const dsp = f->dsp;
  115|  4.00M|    enum CdefEdgeFlags edges = CDEF_HAVE_BOTTOM | (by_start > 0 ? CDEF_HAVE_TOP : 0);
  ------------------
  |  Branch (115:52): [True: 3.99M, False: 13.1k]
  ------------------
  116|  4.00M|    pixel *ptrs[3] = { p[0], p[1], p[2] };
  117|  4.00M|    const int sbsz = 16;
  118|  4.00M|    const int sb64w = f->sb128w << 1;
  119|  4.00M|    const int damping = f->frame_hdr->cdef.damping + bitdepth_min_8;
  120|  4.00M|    const enum Dav1dPixelLayout layout = f->cur.p.layout;
  121|  4.00M|    const int uv_idx = DAV1D_PIXEL_LAYOUT_I444 - layout;
  122|  4.00M|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
  123|  4.00M|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
  124|  4.00M|    static const uint8_t uv_dirs[2][8] = { { 0, 1, 2, 3, 4, 5, 6, 7 },
  125|  4.00M|                                           { 7, 0, 2, 4, 5, 6, 6, 6 } };
  126|  4.00M|    const uint8_t *uv_dir = uv_dirs[layout == DAV1D_PIXEL_LAYOUT_I422];
  127|  4.00M|    assert(f->lf.cdef_planes);
  ------------------
  |  Branch (127:5): [True: 4.00M, False: 18.4E]
  ------------------
  128|  4.00M|    assert(BACKUP_2X8_Y == 1 && BACKUP_2X8_UV == 2);
  ------------------
  |  Branch (128:5): [True: 0, Folded]
  |  Branch (128:5): [True: 0, Folded]
  ------------------
  129|  4.00M|    const enum Backup2x8Flags frame_backup_flag = f->lf.cdef_planes;
  130|  4.00M|    const int have_tt = f->c->n_tc > 1;
  131|  4.00M|    const int sb128 = f->seq_hdr->sb128;
  132|  4.00M|    const int resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
  133|  4.00M|    const ptrdiff_t y_stride = PXSTRIDE(f->cur.stride[0]);
  134|  4.00M|    const ptrdiff_t uv_stride = PXSTRIDE(f->cur.stride[1]);
  135|       |
  136|  35.3M|    for (int bit = 0, by = by_start; by < by_end; by += 2, edges |= CDEF_HAVE_TOP) {
  ------------------
  |  Branch (136:38): [True: 31.3M, False: 4.00M]
  ------------------
  137|  31.3M|        const int tf = tc->top_pre_cdef_toggle;
  138|  31.3M|        const int by_idx = (by & 30) >> 1;
  139|  31.3M|        if (by + 2 >= f->bh) edges &= ~CDEF_HAVE_BOTTOM;
  ------------------
  |  Branch (139:13): [True: 13.3k, False: 31.3M]
  ------------------
  140|       |
  141|  31.6M|        if ((!have_tt || sbrow_start || by + 2 < by_end) &&
  ------------------
  |  Branch (141:14): [True: 18.4E, False: 31.6M]
  |  Branch (141:26): [True: 1.94M, False: 29.7M]
  |  Branch (141:41): [True: 27.7M, False: 2.02M]
  ------------------
  142|  29.6M|            edges & CDEF_HAVE_BOTTOM)
  ------------------
  |  Branch (142:13): [True: 29.6M, False: 18.4E]
  ------------------
  143|  29.6M|        {
  144|       |            // backup pre-filter data for next iteration
  145|  29.6M|            pixel *const cdef_top_bak[3] = {
  146|  29.6M|                f->lf.cdef_line[!tf][0] + have_tt * sby * 4 * y_stride,
  147|  29.6M|                f->lf.cdef_line[!tf][1] + have_tt * sby * 8 * uv_stride,
  148|  29.6M|                f->lf.cdef_line[!tf][2] + have_tt * sby * 8 * uv_stride
  149|  29.6M|            };
  150|  29.6M|            backup2lines(cdef_top_bak, ptrs, f->cur.stride, layout, frame_backup_flag);
  151|  29.6M|        }
  152|       |
  153|  31.3M|        const pixel *top_base[3], *bot_base[3];
  154|  31.3M|        pixel *const *const lpf = resize ? f->lf.cdef_lpf_line : f->lf.lr_lpf_line;
  ------------------
  |  Branch (154:35): [True: 549k, False: 30.7M]
  ------------------
  155|  31.6M|        if (have_tt && sbrow_start && by == by_start) {
  ------------------
  |  Branch (155:13): [True: 31.6M, False: 18.4E]
  |  Branch (155:24): [True: 2.00M, False: 29.6M]
  |  Branch (155:39): [True: 2.00M, False: 18.4E]
  ------------------
  156|  2.00M|            const int line = resize ? (sby - 1) * 4 : sby * (4 << sb128) - 4;
  ------------------
  |  Branch (156:30): [True: 33.6k, False: 1.96M]
  ------------------
  157|  8.00M|            for (int pl = 0; pl < 3; pl++)
  ------------------
  |  Branch (157:30): [True: 6.00M, False: 2.00M]
  ------------------
  158|  6.00M|                top_base[pl] = &lpf[pl][line * (pl ? uv_stride : y_stride)];
  ------------------
  |  Branch (158:49): [True: 4.00M, False: 2.00M]
  ------------------
  159|  29.3M|        } else {
  160|  29.3M|            top_base[0] = &f->lf.cdef_line[tf][0][have_tt * sby * 4 * y_stride];
  161|  29.3M|            top_base[1] = &f->lf.cdef_line[tf][1][have_tt * sby * 8 * uv_stride];
  162|  29.3M|            top_base[2] = &f->lf.cdef_line[tf][2][have_tt * sby * 8 * uv_stride];
  163|  29.3M|        }
  164|  31.5M|        if (have_tt && !sbrow_start && by + 2 >= by_end) {
  ------------------
  |  Branch (164:13): [True: 31.5M, False: 18.4E]
  |  Branch (164:24): [True: 29.6M, False: 1.94M]
  |  Branch (164:40): [True: 2.02M, False: 27.5M]
  ------------------
  165|  2.02M|            const int line = resize ? sby * 4 + 2 : sby * (4 << sb128) + 4 * sb128 + 2;
  ------------------
  |  Branch (165:30): [True: 35.7k, False: 1.98M]
  ------------------
  166|  8.08M|            for (int pl = 0; pl < 3; pl++)
  ------------------
  |  Branch (166:30): [True: 6.06M, False: 2.02M]
  ------------------
  167|  6.06M|                bot_base[pl] = &lpf[pl][line * (pl ? uv_stride : y_stride)];
  ------------------
  |  Branch (167:49): [True: 4.04M, False: 2.02M]
  ------------------
  168|  29.2M|        } else {
  169|  29.2M|            bot_base[0] = ptrs[0] + 8 * y_stride;
  170|  29.2M|            bot_base[1] = ptrs[1] + (8 >> ss_ver) * uv_stride;
  171|  29.2M|            bot_base[2] = ptrs[2] + (8 >> ss_ver) * uv_stride;
  172|  29.2M|        }
  173|       |
  174|  31.3M|        ALIGN_STK_16(pixel, lr_bak, 2 /* idx */, [3 /* plane */][8 /* y */][2 /* x */]);
  ------------------
  |  |  100|  31.3M|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  31.3M|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  175|  31.3M|        enum Backup2x8Flags prev_flag = 0;
  176|  94.5M|        for (int sbx = 0; sbx < sb64w; sbx++) {
  ------------------
  |  Branch (176:27): [True: 63.2M, False: 31.3M]
  ------------------
  177|  63.2M|            const int sb128x = sbx >> 1;
  178|  63.2M|            const int sb64_idx = ((by & sbsz) >> 3) + (sbx & 1);
  179|  63.2M|            const int cdef_idx = lflvl[sb128x].cdef_idx[sb64_idx];
  180|  63.2M|            unsigned row_mask = lflvl[sb128x].noskip_mask[by_idx][sbx & 1];
  181|  63.2M|            const int y_lvl = cdef_idx == -1 ? 0 : f->frame_hdr->cdef.y_strength[cdef_idx];
  ------------------
  |  Branch (181:31): [True: 62.7M, False: 494k]
  ------------------
  182|  63.2M|            const int uv_lvl = cdef_idx == -1 ? 0 : f->frame_hdr->cdef.uv_strength[cdef_idx];
  ------------------
  |  Branch (182:32): [True: 62.7M, False: 502k]
  ------------------
  183|  63.2M|            if (!row_mask || !(y_lvl | uv_lvl)) {
  ------------------
  |  Branch (183:17): [True: 62.8M, False: 448k]
  |  Branch (183:30): [True: 25.5k, False: 422k]
  ------------------
  184|  62.8M|                prev_flag = 0;
  185|  62.8M|                continue;
  186|  62.8M|            }
  187|       |
  188|   454k|            const enum Backup2x8Flags flag = (!!y_lvl) | ((!!uv_lvl) << 1);
  189|       |
  190|   454k|            const int y_pri_lvl = (y_lvl >> 2) << bitdepth_min_8;
  191|   454k|            int y_sec_lvl = y_lvl & 3;
  192|   454k|            y_sec_lvl += y_sec_lvl == 3;
  193|   454k|            y_sec_lvl <<= bitdepth_min_8;
  194|       |
  195|   454k|            const int uv_pri_lvl = (uv_lvl >> 2) << bitdepth_min_8;
  196|   454k|            int uv_sec_lvl = uv_lvl & 3;
  197|   454k|            uv_sec_lvl += uv_sec_lvl == 3;
  198|   454k|            uv_sec_lvl <<= bitdepth_min_8;
  199|       |
  200|   454k|            const int bx_base = sbx * sbsz, bx_limit = imin(sbsz, f->bw - bx_base);
  201|  2.91M|            while (row_mask) {
  ------------------
  |  Branch (201:20): [True: 2.55M, False: 364k]
  ------------------
  202|  2.55M|                const int bx_off = ctz(row_mask) & ~1;
  203|  2.55M|                row_mask &= ~(3U << bx_off);
  204|  2.55M|                if (bx_off >= bx_limit) break;
  ------------------
  |  Branch (204:21): [True: 86.8k, False: 2.46M]
  ------------------
  205|       |
  206|  2.46M|                const int bx = bx_base + bx_off;
  207|  2.46M|                const int have_right = bx + 2 < f->bw;
  208|  2.46M|                const enum CdefEdgeFlags b_edges = edges |
  209|  2.46M|                    (bx > 0 ? CDEF_HAVE_LEFT : 0) | (have_right ? CDEF_HAVE_RIGHT : 0);
  ------------------
  |  Branch (209:22): [True: 2.35M, False: 113k]
  |  Branch (209:54): [True: 2.35M, False: 109k]
  ------------------
  210|       |
  211|  2.46M|                const ptrdiff_t x_y = (ptrdiff_t) bx * 4, x_uv = x_y >> ss_hor;
  212|  2.46M|                pixel *const bptrs[3] = { ptrs[0] + x_y, ptrs[1] + x_uv, ptrs[2] + x_uv };
  213|       |
  214|  2.46M|                const enum Backup2x8Flags do_left = (prev_flag ^ flag) & flag;
  215|  2.46M|                if (do_left && bx > 0)
  ------------------
  |  Branch (215:21): [True: 203k, False: 2.26M]
  |  Branch (215:32): [True: 87.3k, False: 116k]
  ------------------
  216|  87.3k|                    backup2x8(lr_bak[bit], bptrs, f->cur.stride, 0, layout, do_left);
  217|  2.46M|                if (have_right &&
  ------------------
  |  Branch (217:21): [True: 2.34M, False: 118k]
  ------------------
  218|  2.34M|                    (bx_off < 14 ? ((row_mask >> (bx_off + 2)) & 3)
  ------------------
  |  Branch (218:21): [True: 2.27M, False: 71.4k]
  |  Branch (218:22): [True: 2.09M, False: 256k]
  ------------------
  219|  2.34M|                                 : (lflvl[(sbx + 1) >> 1].noskip_mask[by_idx][(sbx + 1) & 1] & 3)))
  220|  2.27M|                {
  221|  2.27M|                    backup2x8(lr_bak[!bit], bptrs, f->cur.stride, 8, layout, flag);
  222|  2.27M|                    prev_flag = flag;
  223|  2.27M|                } else {
  224|   189k|                    prev_flag = 0;
  225|   189k|                }
  226|       |
  227|  2.46M|                int dir;
  228|  2.46M|                unsigned variance;
  229|  2.46M|                if (y_pri_lvl || uv_pri_lvl)
  ------------------
  |  Branch (229:21): [True: 2.16M, False: 305k]
  |  Branch (229:34): [True: 210k, False: 94.9k]
  ------------------
  230|  2.29M|                    dir = dsp->cdef.dir(bptrs[0], f->cur.stride[0],
  231|  2.29M|                                        &variance HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  2.29M|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
  232|       |
  233|  2.46M|                if (y_lvl) {
  ------------------
  |  Branch (233:21): [True: 2.18M, False: 277k]
  ------------------
  234|  2.18M|                    const int adj_y_pri_lvl = y_pri_lvl ? adjust_strength(y_pri_lvl, variance) : 0;
  ------------------
  |  Branch (234:47): [True: 2.09M, False: 92.1k]
  ------------------
  235|  2.18M|                    if (adj_y_pri_lvl || y_sec_lvl)
  ------------------
  |  Branch (235:25): [True: 1.41M, False: 774k]
  |  Branch (235:42): [True: 405k, False: 368k]
  ------------------
  236|  1.82M|                        dsp->cdef.fb[0](bptrs[0], f->cur.stride[0], lr_bak[bit][0],
  237|  1.82M|                                        top_base[0] + x_y, bot_base[0] + x_y,
  238|  1.82M|                                        adj_y_pri_lvl, y_sec_lvl,
  239|  1.82M|                                        y_pri_lvl ? dir : 0, damping,
  ------------------
  |  Branch (239:41): [True: 1.72M, False: 92.1k]
  ------------------
  240|  1.82M|                                        b_edges HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  1.82M|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
  241|  2.18M|                }
  242|  2.46M|                if (uv_lvl) {
  ------------------
  |  Branch (242:21): [True: 1.90M, False: 563k]
  ------------------
  243|  1.90M|                    assert(layout != DAV1D_PIXEL_LAYOUT_I400);
  ------------------
  |  Branch (243:21): [True: 1.90M, False: 2.47k]
  ------------------
  244|  1.90M|                    const int uvdir = uv_pri_lvl ? uv_dir[dir] : 0;
  ------------------
  |  Branch (244:39): [True: 1.81M, False: 84.3k]
  ------------------
  245|  5.64M|                    for (int pl = 1; pl <= 2; pl++)
  ------------------
  |  Branch (245:38): [True: 3.74M, False: 1.90M]
  ------------------
  246|  3.74M|                        dsp->cdef.fb[uv_idx](bptrs[pl], f->cur.stride[1], lr_bak[bit][pl],
  247|  3.74M|                                             top_base[pl] + x_uv, bot_base[pl] + x_uv,
  248|  3.74M|                                             uv_pri_lvl, uv_sec_lvl, uvdir,
  249|  3.74M|                                             damping - 1, b_edges HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  3.74M|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
  250|  1.90M|                }
  251|       |
  252|  2.46M|                bit ^= 1;
  253|  2.46M|            }
  254|   454k|        }
  255|       |
  256|  31.3M|        ptrs[0] += 8 * y_stride;
  257|  31.3M|        ptrs[1] += (8 >> ss_ver) * uv_stride;
  258|  31.3M|        ptrs[2] += (8 >> ss_ver) * uv_stride;
  259|  31.3M|        tc->top_pre_cdef_toggle ^= 1;
  260|  31.3M|    }
  261|  4.00M|}

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

dav1d_cdf_thread_update:
 3918|  12.7k|{
 3919|  12.7k|#define update_cdf_1d(n1d, name) \
 3920|  12.7k|    do { \
 3921|  12.7k|        dst->name[n1d] = 0; \
 3922|  12.7k|    } while (0)
 3923|  12.7k|#define update_cdf_2d(n1d, n2d, name) \
 3924|  12.7k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
 3925|  12.7k|#define update_cdf_3d(n1d, n2d, n3d, name) \
 3926|  12.7k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
 3927|  12.7k|#define update_cdf_4d(n1d, n2d, n3d, n4d, name) \
 3928|  12.7k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
 3929|       |
 3930|  12.7k|    memcpy(dst, src, offsetof(CdfContext, m.intrabc));
 3931|       |
 3932|  12.7k|    update_cdf_3d(2, 2, 4, coef.eob_bin_16);
  ------------------
  |  | 3926|  38.1k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  76.3k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  50.8k|    do { \
  |  |  |  |  |  | 3921|  50.8k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  50.8k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 50.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 50.8k, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 25.4k, False: 12.7k]
  |  |  ------------------
  ------------------
 3933|  12.7k|    update_cdf_3d(2, 2, 5, coef.eob_bin_32);
  ------------------
  |  | 3926|  38.1k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  76.2k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  50.8k|    do { \
  |  |  |  |  |  | 3921|  50.8k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  50.8k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 50.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 50.8k, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 25.4k, False: 12.7k]
  |  |  ------------------
  ------------------
 3934|  12.7k|    update_cdf_3d(2, 2, 6, coef.eob_bin_64);
  ------------------
  |  | 3926|  38.1k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  76.3k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  50.8k|    do { \
  |  |  |  |  |  | 3921|  50.8k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  50.8k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 50.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 50.8k, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 25.4k, False: 12.7k]
  |  |  ------------------
  ------------------
 3935|  12.7k|    update_cdf_3d(2, 2, 7, coef.eob_bin_128);
  ------------------
  |  | 3926|  38.1k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  76.2k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  50.8k|    do { \
  |  |  |  |  |  | 3921|  50.8k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  50.8k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 50.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 50.8k, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 25.4k, False: 12.7k]
  |  |  ------------------
  ------------------
 3936|  12.7k|    update_cdf_3d(2, 2, 8, coef.eob_bin_256);
  ------------------
  |  | 3926|  38.1k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  76.2k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  50.8k|    do { \
  |  |  |  |  |  | 3921|  50.8k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  50.8k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 50.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 50.8k, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 25.4k, False: 12.7k]
  |  |  ------------------
  ------------------
 3937|  12.7k|    update_cdf_2d(2, 9, coef.eob_bin_512);
  ------------------
  |  | 3924|  38.1k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  25.4k|    do { \
  |  |  |  | 3921|  25.4k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  25.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 25.4k, False: 12.7k]
  |  |  ------------------
  ------------------
 3938|  12.7k|    update_cdf_2d(2, 10, coef.eob_bin_1024);
  ------------------
  |  | 3924|  38.1k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  25.4k|    do { \
  |  |  |  | 3921|  25.4k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  25.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 25.4k, False: 12.7k]
  |  |  ------------------
  ------------------
 3939|  12.7k|    update_cdf_4d(N_TX_SIZES, 2, 4, 2, coef.eob_base_tok);
  ------------------
  |  | 3928|  76.2k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   190k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3924|   635k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3920|   508k|    do { \
  |  |  |  |  |  |  |  | 3921|   508k|        dst->name[n1d] = 0; \
  |  |  |  |  |  |  |  | 3922|   508k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 508k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3924:21): [True: 508k, False: 127k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 127k, False: 63.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 63.5k, False: 12.7k]
  |  |  ------------------
  ------------------
 3940|  12.7k|    update_cdf_4d(N_TX_SIZES, 2, 41 /*42*/, 3, coef.base_tok);
  ------------------
  |  | 3928|  76.2k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   190k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3924|  5.31M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3920|  5.19M|    do { \
  |  |  |  |  |  |  |  | 3921|  5.19M|        dst->name[n1d] = 0; \
  |  |  |  |  |  |  |  | 3922|  5.19M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 5.19M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3924:21): [True: 5.19M, False: 126k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 126k, False: 63.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 63.5k, False: 12.7k]
  |  |  ------------------
  ------------------
 3941|  12.7k|    update_cdf_4d(4, 2, 21, 3, coef.br_tok);
  ------------------
  |  | 3928|  63.5k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   152k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3924|  2.23M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3920|  2.13M|    do { \
  |  |  |  |  |  |  |  | 3921|  2.13M|        dst->name[n1d] = 0; \
  |  |  |  |  |  |  |  | 3922|  2.13M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 2.13M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3924:21): [True: 2.13M, False: 101k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 101k, False: 50.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 50.8k, False: 12.7k]
  |  |  ------------------
  ------------------
 3942|  12.7k|    update_cdf_4d(N_TX_SIZES, 2, 9, 1, coef.eob_hi_bit);
  ------------------
  |  | 3928|  76.3k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   190k|    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.14M|    do { \
  |  |  |  |  |  |  |  | 3921|  1.14M|        dst->name[n1d] = 0; \
  |  |  |  |  |  |  |  | 3922|  1.14M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 1.14M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3924:21): [True: 1.14M, False: 127k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 127k, False: 63.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 63.5k, False: 12.7k]
  |  |  ------------------
  ------------------
 3943|  12.7k|    update_cdf_3d(N_TX_SIZES, 13, 1, coef.skip);
  ------------------
  |  | 3926|  76.2k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   889k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   826k|    do { \
  |  |  |  |  |  | 3921|   826k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   826k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 826k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 826k, False: 63.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 63.5k, False: 12.7k]
  |  |  ------------------
  ------------------
 3944|  12.7k|    update_cdf_3d(2, 3, 1, coef.dc_sign);
  ------------------
  |  | 3926|  38.1k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   101k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  76.3k|    do { \
  |  |  |  |  |  | 3921|  76.3k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  76.3k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 76.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 76.3k, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 25.4k, False: 12.7k]
  |  |  ------------------
  ------------------
 3945|       |
 3946|  12.7k|    update_cdf_3d(2, N_INTRA_PRED_MODES, N_UV_INTRA_PRED_MODES - 1 - !k, m.uv_mode);
  ------------------
  |  | 3926|  38.1k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   356k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   330k|    do { \
  |  |  |  |  |  | 3921|   330k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   330k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 330k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 330k, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 25.4k, False: 12.7k]
  |  |  ------------------
  ------------------
 3947|  12.7k|    update_cdf_2d(4, N_PARTITIONS - 3, m.partition[BL_128X128]);
  ------------------
  |  | 3924|  63.6k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  50.8k|    do { \
  |  |  |  | 3921|  50.8k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  50.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 50.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 50.8k, False: 12.7k]
  |  |  ------------------
  ------------------
 3948|  50.8k|    for (int k = BL_64X64; k < BL_8X8; k++)
  ------------------
  |  Branch (3948:28): [True: 38.1k, False: 12.7k]
  ------------------
 3949|  38.1k|        update_cdf_2d(4, N_PARTITIONS - 1, m.partition[k]);
  ------------------
  |  | 3924|   190k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   152k|    do { \
  |  |  |  | 3921|   152k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   152k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 152k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 152k, False: 38.1k]
  |  |  ------------------
  ------------------
 3950|  12.7k|    update_cdf_2d(4, N_SUB8X8_PARTITIONS - 1, m.partition[BL_8X8]);
  ------------------
  |  | 3924|  63.6k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  50.9k|    do { \
  |  |  |  | 3921|  50.9k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  50.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 50.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 50.9k, False: 12.7k]
  |  |  ------------------
  ------------------
 3951|  12.7k|    update_cdf_2d(6, 15, m.cfl_alpha);
  ------------------
  |  | 3924|  89.0k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  76.3k|    do { \
  |  |  |  | 3921|  76.3k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  76.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 76.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 76.3k, False: 12.7k]
  |  |  ------------------
  ------------------
 3952|  12.7k|    update_cdf_2d(2, 15, m.txtp_inter1);
  ------------------
  |  | 3924|  38.1k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  25.4k|    do { \
  |  |  |  | 3921|  25.4k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  25.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 25.4k, False: 12.7k]
  |  |  ------------------
  ------------------
 3953|  12.7k|    update_cdf_1d(11, m.txtp_inter2);
  ------------------
  |  | 3920|  12.7k|    do { \
  |  | 3921|  12.7k|        dst->name[n1d] = 0; \
  |  | 3922|  12.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.7k]
  |  |  ------------------
  ------------------
 3954|  12.7k|    update_cdf_3d(2, N_INTRA_PRED_MODES, 6, m.txtp_intra1);
  ------------------
  |  | 3926|  38.1k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   356k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   330k|    do { \
  |  |  |  |  |  | 3921|   330k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   330k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 330k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 330k, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 25.4k, False: 12.7k]
  |  |  ------------------
  ------------------
 3955|  12.7k|    update_cdf_3d(3, N_INTRA_PRED_MODES, 4, m.txtp_intra2);
  ------------------
  |  | 3926|  50.8k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   534k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   496k|    do { \
  |  |  |  |  |  | 3921|   496k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   496k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 496k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 496k, False: 38.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 38.1k, False: 12.7k]
  |  |  ------------------
  ------------------
 3956|  12.7k|    update_cdf_1d(7, m.cfl_sign);
  ------------------
  |  | 3920|  12.7k|    do { \
  |  | 3921|  12.7k|        dst->name[n1d] = 0; \
  |  | 3922|  12.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.7k]
  |  |  ------------------
  ------------------
 3957|  12.7k|    update_cdf_2d(8, 6, m.angle_delta);
  ------------------
  |  | 3924|   114k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   101k|    do { \
  |  |  |  | 3921|   101k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   101k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 101k, False: 12.7k]
  |  |  ------------------
  ------------------
 3958|  12.7k|    update_cdf_1d(4, m.filter_intra);
  ------------------
  |  | 3920|  12.7k|    do { \
  |  | 3921|  12.7k|        dst->name[n1d] = 0; \
  |  | 3922|  12.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.7k]
  |  |  ------------------
  ------------------
 3959|  12.7k|    update_cdf_2d(3, DAV1D_MAX_SEGMENTS - 1, m.seg_id);
  ------------------
  |  | 3924|  50.9k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  38.1k|    do { \
  |  |  |  | 3921|  38.1k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  38.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 38.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 38.1k, False: 12.7k]
  |  |  ------------------
  ------------------
 3960|  12.7k|    update_cdf_3d(2, 7, 6, m.pal_sz);
  ------------------
  |  | 3926|  38.1k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   203k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   178k|    do { \
  |  |  |  |  |  | 3921|   178k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   178k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 178k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 178k, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 25.4k, False: 12.7k]
  |  |  ------------------
  ------------------
 3961|  12.7k|    update_cdf_4d(2, 7, 5, k + 1, m.color_map);
  ------------------
  |  | 3928|  38.1k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   203k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3924|  1.06M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3920|   890k|    do { \
  |  |  |  |  |  |  |  | 3921|   890k|        dst->name[n1d] = 0; \
  |  |  |  |  |  |  |  | 3922|   890k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 890k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3924:21): [True: 890k, False: 178k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 178k, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 25.4k, False: 12.7k]
  |  |  ------------------
  ------------------
 3962|  12.7k|    update_cdf_3d(N_TX_SIZES - 1, 3, imin(k + 1, 2), m.txsz);
  ------------------
  |  | 3926|  63.6k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   203k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   152k|    do { \
  |  |  |  |  |  | 3921|   152k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   152k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 152k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 152k, False: 50.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 50.9k, False: 12.7k]
  |  |  ------------------
  ------------------
 3963|  12.7k|    update_cdf_1d(3, m.delta_q);
  ------------------
  |  | 3920|  12.7k|    do { \
  |  | 3921|  12.7k|        dst->name[n1d] = 0; \
  |  | 3922|  12.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.7k]
  |  |  ------------------
  ------------------
 3964|  12.7k|    update_cdf_2d(5, 3, m.delta_lf);
  ------------------
  |  | 3924|  76.3k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  63.6k|    do { \
  |  |  |  | 3921|  63.6k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  63.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 63.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 63.6k, False: 12.7k]
  |  |  ------------------
  ------------------
 3965|  12.7k|    update_cdf_1d(2, m.restore_switchable);
  ------------------
  |  | 3920|  12.7k|    do { \
  |  | 3921|  12.7k|        dst->name[n1d] = 0; \
  |  | 3922|  12.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.7k]
  |  |  ------------------
  ------------------
 3966|  12.7k|    update_cdf_1d(1, m.restore_wiener);
  ------------------
  |  | 3920|  12.7k|    do { \
  |  | 3921|  12.7k|        dst->name[n1d] = 0; \
  |  | 3922|  12.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.7k]
  |  |  ------------------
  ------------------
 3967|  12.7k|    update_cdf_1d(1, m.restore_sgrproj);
  ------------------
  |  | 3920|  12.7k|    do { \
  |  | 3921|  12.7k|        dst->name[n1d] = 0; \
  |  | 3922|  12.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.7k]
  |  |  ------------------
  ------------------
 3968|  12.7k|    update_cdf_2d(4, 1, m.txtp_inter3);
  ------------------
  |  | 3924|  63.6k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  50.9k|    do { \
  |  |  |  | 3921|  50.9k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  50.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 50.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 50.9k, False: 12.7k]
  |  |  ------------------
  ------------------
 3969|  12.7k|    update_cdf_2d(N_BS_SIZES, 1, m.use_filter_intra);
  ------------------
  |  | 3924|   292k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   279k|    do { \
  |  |  |  | 3921|   279k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   279k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 279k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 279k, False: 12.7k]
  |  |  ------------------
  ------------------
 3970|  12.7k|    update_cdf_3d(7, 3, 1, m.txpart);
  ------------------
  |  | 3926|   101k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   356k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   267k|    do { \
  |  |  |  |  |  | 3921|   267k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   267k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 267k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 267k, False: 89.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 89.0k, False: 12.7k]
  |  |  ------------------
  ------------------
 3971|  12.7k|    update_cdf_2d(3, 1, m.skip);
  ------------------
  |  | 3924|  50.8k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  38.1k|    do { \
  |  |  |  | 3921|  38.1k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  38.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 38.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 38.1k, False: 12.7k]
  |  |  ------------------
  ------------------
 3972|  12.7k|    update_cdf_3d(7, 3, 1, m.pal_y);
  ------------------
  |  | 3926|   101k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   356k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   267k|    do { \
  |  |  |  |  |  | 3921|   267k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   267k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 267k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 267k, False: 89.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 89.0k, False: 12.7k]
  |  |  ------------------
  ------------------
 3973|  12.7k|    update_cdf_2d(2, 1, m.pal_uv);
  ------------------
  |  | 3924|  38.1k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  25.4k|    do { \
  |  |  |  | 3921|  25.4k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  25.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 25.4k, False: 12.7k]
  |  |  ------------------
  ------------------
 3974|       |
 3975|  12.7k|    if (IS_KEY_OR_INTRA(hdr))
  ------------------
  |  |   43|  12.7k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  12.7k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 6.33k, False: 6.38k]
  |  |  ------------------
  ------------------
 3976|  6.33k|        return;
 3977|       |
 3978|  6.38k|    memcpy(dst->m.y_mode, src->m.y_mode,
 3979|  6.38k|           offsetof(CdfContext, kfym) - offsetof(CdfContext, m.y_mode));
 3980|       |
 3981|  6.38k|    update_cdf_2d(4, N_INTRA_PRED_MODES - 1, m.y_mode);
  ------------------
  |  | 3924|  31.9k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  31.9k|    do { \
  |  |  |  | 3921|  25.5k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  25.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 25.5k, False: 6.38k]
  |  |  ------------------
  ------------------
 3982|  6.38k|    update_cdf_2d(9, 15, m.wedge_idx);
  ------------------
  |  | 3924|  63.9k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  63.9k|    do { \
  |  |  |  | 3921|  57.5k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  57.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 57.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 57.5k, False: 6.38k]
  |  |  ------------------
  ------------------
 3983|  6.38k|    update_cdf_2d(8, N_COMP_INTER_PRED_MODES - 1, m.comp_inter_mode);
  ------------------
  |  | 3924|  57.5k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  57.5k|    do { \
  |  |  |  | 3921|  51.1k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  51.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 51.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 51.1k, False: 6.38k]
  |  |  ------------------
  ------------------
 3984|  6.38k|    update_cdf_3d(2, 8, DAV1D_N_SWITCHABLE_FILTERS - 1, m.filter);
  ------------------
  |  | 3926|  19.1k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   115k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   108k|    do { \
  |  |  |  |  |  | 3921|   102k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   102k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 102k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 102k, False: 12.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 12.7k, False: 6.38k]
  |  |  ------------------
  ------------------
 3985|  6.38k|    update_cdf_2d(4, 3, m.interintra_mode);
  ------------------
  |  | 3924|  31.9k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  31.9k|    do { \
  |  |  |  | 3921|  25.5k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  25.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 25.5k, False: 6.38k]
  |  |  ------------------
  ------------------
 3986|  6.38k|    update_cdf_2d(N_BS_SIZES, 2, m.motion_mode);
  ------------------
  |  | 3924|   147k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   147k|    do { \
  |  |  |  | 3921|   140k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   140k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 140k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 140k, False: 6.38k]
  |  |  ------------------
  ------------------
 3987|  6.38k|    update_cdf_2d(3, 1, m.skip_mode);
  ------------------
  |  | 3924|  25.5k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  25.5k|    do { \
  |  |  |  | 3921|  19.1k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  19.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 19.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 19.1k, False: 6.38k]
  |  |  ------------------
  ------------------
 3988|  6.38k|    update_cdf_2d(6, 1, m.newmv_mode);
  ------------------
  |  | 3924|  44.7k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  44.7k|    do { \
  |  |  |  | 3921|  38.3k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  38.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 38.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 38.3k, False: 6.38k]
  |  |  ------------------
  ------------------
 3989|  6.38k|    update_cdf_2d(2, 1, m.globalmv_mode);
  ------------------
  |  | 3924|  19.1k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  19.1k|    do { \
  |  |  |  | 3921|  12.7k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  12.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 12.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 12.7k, False: 6.38k]
  |  |  ------------------
  ------------------
 3990|  6.38k|    update_cdf_2d(6, 1, m.refmv_mode);
  ------------------
  |  | 3924|  44.7k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  44.7k|    do { \
  |  |  |  | 3921|  38.3k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  38.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 38.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 38.3k, False: 6.38k]
  |  |  ------------------
  ------------------
 3991|  6.38k|    update_cdf_2d(3, 1, m.drl_bit);
  ------------------
  |  | 3924|  25.5k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  25.5k|    do { \
  |  |  |  | 3921|  19.1k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  19.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 19.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 19.1k, False: 6.38k]
  |  |  ------------------
  ------------------
 3992|  6.38k|    update_cdf_2d(4, 1, m.intra);
  ------------------
  |  | 3924|  31.9k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  31.9k|    do { \
  |  |  |  | 3921|  25.5k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  25.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 25.5k, False: 6.38k]
  |  |  ------------------
  ------------------
 3993|  6.38k|    update_cdf_2d(5, 1, m.comp);
  ------------------
  |  | 3924|  38.3k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  38.3k|    do { \
  |  |  |  | 3921|  31.9k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  31.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 31.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 31.9k, False: 6.38k]
  |  |  ------------------
  ------------------
 3994|  6.38k|    update_cdf_2d(5, 1, m.comp_dir);
  ------------------
  |  | 3924|  38.3k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  38.3k|    do { \
  |  |  |  | 3921|  31.9k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  31.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 31.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 31.9k, False: 6.38k]
  |  |  ------------------
  ------------------
 3995|  6.38k|    update_cdf_2d(6, 1, m.jnt_comp);
  ------------------
  |  | 3924|  44.7k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  44.7k|    do { \
  |  |  |  | 3921|  38.3k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  38.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 38.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 38.3k, False: 6.38k]
  |  |  ------------------
  ------------------
 3996|  6.38k|    update_cdf_2d(6, 1, m.mask_comp);
  ------------------
  |  | 3924|  44.7k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  44.7k|    do { \
  |  |  |  | 3921|  38.3k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  38.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 38.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 38.3k, False: 6.38k]
  |  |  ------------------
  ------------------
 3997|  6.38k|    update_cdf_2d(9, 1, m.wedge_comp);
  ------------------
  |  | 3924|  63.9k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  63.9k|    do { \
  |  |  |  | 3921|  57.5k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  57.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 57.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 57.5k, False: 6.38k]
  |  |  ------------------
  ------------------
 3998|  6.38k|    update_cdf_3d(6, 3, 1, m.ref);
  ------------------
  |  | 3926|  44.7k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   153k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   121k|    do { \
  |  |  |  |  |  | 3921|   115k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   115k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 115k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 115k, False: 38.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 38.3k, False: 6.38k]
  |  |  ------------------
  ------------------
 3999|  6.38k|    update_cdf_3d(3, 3, 1, m.comp_fwd_ref);
  ------------------
  |  | 3926|  25.5k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  76.7k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  63.9k|    do { \
  |  |  |  |  |  | 3921|  57.5k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  57.5k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 57.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 57.5k, False: 19.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 19.1k, False: 6.38k]
  |  |  ------------------
  ------------------
 4000|  6.38k|    update_cdf_3d(2, 3, 1, m.comp_bwd_ref);
  ------------------
  |  | 3926|  19.1k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  51.1k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  44.7k|    do { \
  |  |  |  |  |  | 3921|  38.3k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  38.3k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 38.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 38.3k, False: 12.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 12.7k, False: 6.38k]
  |  |  ------------------
  ------------------
 4001|  6.38k|    update_cdf_3d(3, 3, 1, m.comp_uni_ref);
  ------------------
  |  | 3926|  25.5k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  76.7k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  63.9k|    do { \
  |  |  |  |  |  | 3921|  57.5k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  57.5k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 57.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 57.5k, False: 19.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 19.1k, False: 6.38k]
  |  |  ------------------
  ------------------
 4002|  6.38k|    update_cdf_2d(3, 1, m.seg_pred);
  ------------------
  |  | 3924|  25.5k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  25.5k|    do { \
  |  |  |  | 3921|  19.1k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  19.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 19.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 19.1k, False: 6.38k]
  |  |  ------------------
  ------------------
 4003|  6.38k|    update_cdf_2d(4, 1, m.interintra);
  ------------------
  |  | 3924|  31.9k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  31.9k|    do { \
  |  |  |  | 3921|  25.5k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  25.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 25.5k, False: 6.38k]
  |  |  ------------------
  ------------------
 4004|  6.38k|    update_cdf_2d(7, 1, m.interintra_wedge);
  ------------------
  |  | 3924|  51.1k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  51.1k|    do { \
  |  |  |  | 3921|  44.7k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  44.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 44.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 44.7k, False: 6.38k]
  |  |  ------------------
  ------------------
 4005|  6.38k|    update_cdf_2d(N_BS_SIZES, 1, m.obmc);
  ------------------
  |  | 3924|   147k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   147k|    do { \
  |  |  |  | 3921|   140k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   140k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 140k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 140k, False: 6.38k]
  |  |  ------------------
  ------------------
 4006|       |
 4007|  19.1k|    for (int k = 0; k < 2; k++) {
  ------------------
  |  Branch (4007:21): [True: 12.7k, False: 6.38k]
  ------------------
 4008|  12.7k|        update_cdf_1d(10, mv.comp[k].classes);
  ------------------
  |  | 3920|  12.7k|    do { \
  |  | 3921|  12.7k|        dst->name[n1d] = 0; \
  |  | 3922|  12.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.7k]
  |  |  ------------------
  ------------------
 4009|  12.7k|        update_cdf_1d(1, mv.comp[k].sign);
  ------------------
  |  | 3920|  12.7k|    do { \
  |  | 3921|  12.7k|        dst->name[n1d] = 0; \
  |  | 3922|  12.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.7k]
  |  |  ------------------
  ------------------
 4010|  12.7k|        update_cdf_1d(1, mv.comp[k].class0);
  ------------------
  |  | 3920|  12.7k|    do { \
  |  | 3921|  12.7k|        dst->name[n1d] = 0; \
  |  | 3922|  12.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.7k]
  |  |  ------------------
  ------------------
 4011|  12.7k|        update_cdf_2d(2, 3, mv.comp[k].class0_fp);
  ------------------
  |  | 3924|  38.3k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  25.5k|    do { \
  |  |  |  | 3921|  25.5k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  25.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 25.5k, False: 12.7k]
  |  |  ------------------
  ------------------
 4012|  12.7k|        update_cdf_1d(1, mv.comp[k].class0_hp);
  ------------------
  |  | 3920|  12.7k|    do { \
  |  | 3921|  12.7k|        dst->name[n1d] = 0; \
  |  | 3922|  12.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.7k]
  |  |  ------------------
  ------------------
 4013|  12.7k|        update_cdf_2d(10, 1, mv.comp[k].classN);
  ------------------
  |  | 3924|   140k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   127k|    do { \
  |  |  |  | 3921|   127k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   127k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 127k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 127k, False: 12.7k]
  |  |  ------------------
  ------------------
 4014|  12.7k|        update_cdf_1d(3, mv.comp[k].classN_fp);
  ------------------
  |  | 3920|  12.7k|    do { \
  |  | 3921|  12.7k|        dst->name[n1d] = 0; \
  |  | 3922|  12.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.7k]
  |  |  ------------------
  ------------------
 4015|  12.7k|        update_cdf_1d(1, mv.comp[k].classN_hp);
  ------------------
  |  | 3920|  12.7k|    do { \
  |  | 3921|  12.7k|        dst->name[n1d] = 0; \
  |  | 3922|  12.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.7k]
  |  |  ------------------
  ------------------
 4016|  12.7k|    }
 4017|  6.38k|    update_cdf_1d(N_MV_JOINTS - 1, mv.joint);
  ------------------
  |  | 3920|  6.38k|    do { \
  |  | 3921|  6.38k|        dst->name[n1d] = 0; \
  |  | 3922|  6.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 6.38k]
  |  |  ------------------
  ------------------
 4018|  6.38k|}
dav1d_cdf_thread_init_static:
 4023|   140k|void dav1d_cdf_thread_init_static(CdfThreadContext *const cdf, const unsigned qidx) {
 4024|       |    cdf->ref = NULL;
 4025|   140k|    cdf->data.qcat = (qidx > 20) + (qidx > 60) + (qidx > 120);
 4026|   140k|}
dav1d_cdf_thread_copy:
 4028|   205k|void dav1d_cdf_thread_copy(CdfContext *const dst, const CdfThreadContext *const src) {
 4029|   205k|    if (src->ref) {
  ------------------
  |  Branch (4029:9): [True: 40.3k, False: 165k]
  ------------------
 4030|  40.3k|        memcpy(dst, src->data.cdf, sizeof(*dst));
 4031|   165k|    } else {
 4032|   165k|        dst->coef = default_coef_cdf[src->data.qcat];
 4033|   165k|        memcpy(&dst->m, &default_cdf.m,
 4034|   165k|               offsetof(CdfDefaultContext, mv.joint));
 4035|   165k|        memcpy(&dst->mv.comp[1], &default_cdf.mv.comp,
 4036|       |               sizeof(default_cdf) - offsetof(CdfDefaultContext, mv.comp));
 4037|   165k|    }
 4038|   205k|}
dav1d_cdf_thread_alloc:
 4042|  53.8k|{
 4043|  53.8k|    cdf->ref = dav1d_ref_create_using_pool(c->cdf_pool,
 4044|  53.8k|                                           sizeof(CdfContext) + sizeof(atomic_uint));
 4045|  53.8k|    if (!cdf->ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (4045:9): [True: 0, False: 53.8k]
  ------------------
 4046|  53.8k|    cdf->data.cdf = cdf->ref->data;
 4047|  53.8k|    if (have_frame_mt) {
  ------------------
  |  Branch (4047:9): [True: 53.8k, False: 0]
  ------------------
 4048|  53.8k|        cdf->progress = (atomic_uint *) &cdf->data.cdf[1];
 4049|       |        atomic_init(cdf->progress, 0);
 4050|  53.8k|    }
 4051|  53.8k|    return 0;
 4052|  53.8k|}
dav1d_cdf_thread_ref:
 4056|  1.51M|{
 4057|  1.51M|    *dst = *src;
 4058|  1.51M|    if (src->ref)
  ------------------
  |  Branch (4058:9): [True: 484k, False: 1.03M]
  ------------------
 4059|   484k|        dav1d_ref_inc(src->ref);
 4060|  1.51M|}
dav1d_cdf_thread_unref:
 4062|  2.07M|void dav1d_cdf_thread_unref(CdfThreadContext *const cdf) {
 4063|       |    memset(&cdf->data, 0, sizeof(*cdf) - offsetof(CdfThreadContext, data));
 4064|  2.07M|    dav1d_ref_dec(&cdf->ref);
 4065|  2.07M|}

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|}

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|}
pal.c:dav1d_get_cpu_flags:
  124|  15.1k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  15.1k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|       |#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|       |    flags |= dav1d_get_default_cpu_flags();
  131|       |#endif
  132|       |
  133|  15.1k|    return flags;
  134|  15.1k|}
refmvs.c:dav1d_get_cpu_flags:
  124|  15.1k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  15.1k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|       |#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|       |    flags |= dav1d_get_default_cpu_flags();
  131|       |#endif
  132|       |
  133|  15.1k|    return flags;
  134|  15.1k|}
lf_mask.c:dav1d_get_cpu_flags:
  124|  15.1k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  15.1k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|       |#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|       |    flags |= dav1d_get_default_cpu_flags();
  131|       |#endif
  132|       |
  133|  15.1k|    return flags;
  134|  15.1k|}
msac.c:dav1d_get_cpu_flags:
  124|   183k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|   183k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|       |#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|       |    flags |= dav1d_get_default_cpu_flags();
  131|       |#endif
  132|       |
  133|   183k|    return flags;
  134|   183k|}
cdef_tmpl.c:dav1d_get_cpu_flags:
  124|  13.5k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  13.5k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|       |#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|       |    flags |= dav1d_get_default_cpu_flags();
  131|       |#endif
  132|       |
  133|  13.5k|    return flags;
  134|  13.5k|}
filmgrain_tmpl.c:dav1d_get_cpu_flags:
  124|  13.5k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  13.5k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|       |#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|       |    flags |= dav1d_get_default_cpu_flags();
  131|       |#endif
  132|       |
  133|  13.5k|    return flags;
  134|  13.5k|}
ipred_tmpl.c:dav1d_get_cpu_flags:
  124|  13.5k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  13.5k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|       |#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|       |    flags |= dav1d_get_default_cpu_flags();
  131|       |#endif
  132|       |
  133|  13.5k|    return flags;
  134|  13.5k|}
itx_tmpl.c:dav1d_get_cpu_flags:
  124|  13.5k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  13.5k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|       |#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|       |    flags |= dav1d_get_default_cpu_flags();
  131|       |#endif
  132|       |
  133|  13.5k|    return flags;
  134|  13.5k|}
loopfilter_tmpl.c:dav1d_get_cpu_flags:
  124|  13.5k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  13.5k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|       |#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|       |    flags |= dav1d_get_default_cpu_flags();
  131|       |#endif
  132|       |
  133|  13.5k|    return flags;
  134|  13.5k|}
looprestoration_tmpl.c:dav1d_get_cpu_flags:
  124|  13.5k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  13.5k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|       |#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|       |    flags |= dav1d_get_default_cpu_flags();
  131|       |#endif
  132|       |
  133|  13.5k|    return flags;
  134|  13.5k|}
mc_tmpl.c:dav1d_get_cpu_flags:
  124|  13.5k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  13.5k|    unsigned flags = dav1d_cpu_flags & dav1d_cpu_flags_mask;
  126|       |
  127|       |#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|       |    flags |= dav1d_get_default_cpu_flags();
  131|       |#endif
  132|       |
  133|  13.5k|    return flags;
  134|  13.5k|}

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

lf_mask.c:dav1d_memset_likely_pow2:
   44|  6.58M|static inline void dav1d_memset_likely_pow2(void *const ptr, const int value, const int n) {
   45|  6.58M|    assert(n >= 1 && n <= 32);
  ------------------
  |  Branch (45:5): [True: 6.58M, False: 18.4E]
  |  Branch (45:5): [True: 6.58M, False: 18.4E]
  ------------------
   46|  6.58M|    if ((n&(n-1)) == 0) {
  ------------------
  |  Branch (46:9): [True: 6.14M, False: 434k]
  ------------------
   47|  6.14M|        dav1d_memset_pow2[ulog2(n)](ptr, value);
   48|  6.14M|    } else {
   49|   434k|        memset(ptr, value, n);
   50|   434k|    }
   51|  6.58M|}
recon_tmpl.c:dav1d_memset_likely_pow2:
   44|  79.9M|static inline void dav1d_memset_likely_pow2(void *const ptr, const int value, const int n) {
   45|  79.9M|    assert(n >= 1 && n <= 32);
  ------------------
  |  Branch (45:5): [True: 79.9M, False: 18.4E]
  |  Branch (45:5): [True: 79.9M, False: 18.4E]
  ------------------
   46|  79.8M|    if ((n&(n-1)) == 0) {
  ------------------
  |  Branch (46:9): [True: 78.4M, False: 1.43M]
  ------------------
   47|  78.4M|        dav1d_memset_pow2[ulog2(n)](ptr, value);
   48|  78.4M|    } else {
   49|  1.43M|        memset(ptr, value, n);
   50|  1.43M|    }
   51|  79.8M|}

dav1d_data_create_internal:
   43|   283k|uint8_t *dav1d_data_create_internal(Dav1dData *const buf, const size_t sz) {
   44|   283k|    validate_input_or_ret(buf != NULL, NULL);
  ------------------
  |  |   52|   283k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 283k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
   45|       |
   46|   283k|    if (sz > SIZE_MAX / 2) return NULL;
  ------------------
  |  Branch (46:9): [True: 0, False: 283k]
  ------------------
   47|   283k|    buf->ref = dav1d_ref_create(ALLOC_DAV1DDATA, sz);
  ------------------
  |  |   49|   283k|#define dav1d_ref_create(type, size) dav1d_ref_create(size)
  ------------------
   48|   283k|    if (!buf->ref) return NULL;
  ------------------
  |  Branch (48:9): [True: 0, False: 283k]
  ------------------
   49|   283k|    buf->data = buf->ref->const_data;
   50|   283k|    buf->sz = sz;
   51|   283k|    dav1d_data_props_set_defaults(&buf->m);
   52|   283k|    buf->m.size = sz;
   53|       |
   54|   283k|    return buf->ref->data;
   55|   283k|}
dav1d_data_ref:
   98|   502k|void dav1d_data_ref(Dav1dData *const dst, const Dav1dData *const src) {
   99|   502k|    assert(dst != NULL);
  ------------------
  |  Branch (99:5): [True: 502k, False: 0]
  ------------------
  100|   502k|    assert(dst->data == NULL);
  ------------------
  |  Branch (100:5): [True: 502k, False: 0]
  ------------------
  101|   502k|    assert(src != NULL);
  ------------------
  |  Branch (101:5): [True: 502k, False: 0]
  ------------------
  102|       |
  103|   502k|    if (src->ref) {
  ------------------
  |  Branch (103:9): [True: 502k, False: 0]
  ------------------
  104|   502k|        assert(src->data != NULL);
  ------------------
  |  Branch (104:9): [True: 502k, False: 0]
  ------------------
  105|   502k|        dav1d_ref_inc(src->ref);
  106|   502k|    }
  107|   502k|    if (src->m.user_data.ref) dav1d_ref_inc(src->m.user_data.ref);
  ------------------
  |  Branch (107:9): [True: 0, False: 502k]
  ------------------
  108|   502k|    *dst = *src;
  109|   502k|}
dav1d_data_props_copy:
  113|   491k|{
  114|   491k|    assert(dst != NULL);
  ------------------
  |  Branch (114:5): [True: 491k, False: 0]
  ------------------
  115|   491k|    assert(src != NULL);
  ------------------
  |  Branch (115:5): [True: 491k, False: 0]
  ------------------
  116|       |
  117|   491k|    dav1d_ref_dec(&dst->user_data.ref);
  118|   491k|    *dst = *src;
  119|   491k|    if (dst->user_data.ref) dav1d_ref_inc(dst->user_data.ref);
  ------------------
  |  Branch (119:9): [True: 0, False: 491k]
  ------------------
  120|   491k|}
dav1d_data_props_set_defaults:
  122|  4.35M|void dav1d_data_props_set_defaults(Dav1dDataProps *const props) {
  123|  4.35M|    assert(props != NULL);
  ------------------
  |  Branch (123:5): [True: 4.35M, False: 5]
  ------------------
  124|       |
  125|  4.35M|    memset(props, 0, sizeof(*props));
  126|       |    props->timestamp = INT64_MIN;
  127|  4.35M|    props->offset = -1;
  128|  4.35M|}
dav1d_data_props_unref_internal:
  130|  15.1k|void dav1d_data_props_unref_internal(Dav1dDataProps *const props) {
  131|  15.1k|    validate_input(props != NULL);
  ------------------
  |  |   59|  15.1k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|  15.1k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 15.1k]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |   54|      0|                    #x, __func__); \
  |  |  |  |   55|      0|        debug_abort(); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|      0|#define debug_abort abort
  |  |  |  |  ------------------
  |  |  |  |   56|      0|        return r; \
  |  |  |  |   57|      0|    }
  |  |  ------------------
  ------------------
  132|       |
  133|  15.1k|    struct Dav1dRef *user_data_ref = props->user_data.ref;
  134|  15.1k|    dav1d_data_props_set_defaults(props);
  135|  15.1k|    dav1d_ref_dec(&user_data_ref);
  136|  15.1k|}
dav1d_data_unref_internal:
  138|   801k|void dav1d_data_unref_internal(Dav1dData *const buf) {
  139|   801k|    validate_input(buf != NULL);
  ------------------
  |  |   59|   801k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|   801k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 801k]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |   54|      0|                    #x, __func__); \
  |  |  |  |   55|      0|        debug_abort(); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|      0|#define debug_abort abort
  |  |  |  |  ------------------
  |  |  |  |   56|      0|        return r; \
  |  |  |  |   57|      0|    }
  |  |  ------------------
  ------------------
  140|       |
  141|   801k|    struct Dav1dRef *user_data_ref = buf->m.user_data.ref;
  142|   801k|    if (buf->ref) {
  ------------------
  |  Branch (142:9): [True: 786k, False: 15.1k]
  ------------------
  143|   786k|        validate_input(buf->data != NULL);
  ------------------
  |  |   59|   786k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|   786k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 786k]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |   54|      0|                    #x, __func__); \
  |  |  |  |   55|      0|        debug_abort(); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|      0|#define debug_abort abort
  |  |  |  |  ------------------
  |  |  |  |   56|      0|        return r; \
  |  |  |  |   57|      0|    }
  |  |  ------------------
  ------------------
  144|   786k|        dav1d_ref_dec(&buf->ref);
  145|   786k|    }
  146|   801k|    memset(buf, 0, sizeof(*buf));
  147|   801k|    dav1d_data_props_set_defaults(&buf->m);
  148|   801k|    dav1d_ref_dec(&user_data_ref);
  149|   801k|}

dav1d_decode_tile_sbrow:
 2638|  9.04M|int dav1d_decode_tile_sbrow(Dav1dTaskContext *const t) {
 2639|  9.04M|    const Dav1dFrameContext *const f = t->f;
 2640|  9.04M|    const enum BlockLevel root_bl = f->seq_hdr->sb128 ? BL_128X128 : BL_64X64;
  ------------------
  |  Branch (2640:37): [True: 6.63M, False: 2.40M]
  ------------------
 2641|  9.04M|    Dav1dTileState *const ts = t->ts;
 2642|  9.04M|    const Dav1dContext *const c = f->c;
 2643|  9.04M|    const int sb_step = f->sb_step;
 2644|  9.04M|    const int tile_row = ts->tiling.row, tile_col = ts->tiling.col;
 2645|  9.04M|    const int col_sb_start = f->frame_hdr->tiling.col_start_sb[tile_col];
 2646|  9.04M|    const int col_sb128_start = col_sb_start >> !f->seq_hdr->sb128;
 2647|       |
 2648|  9.04M|    if (IS_INTER_OR_SWITCH(f->frame_hdr) || f->frame_hdr->allow_intrabc) {
  ------------------
  |  |   36|  18.0M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 8.25M, False: 794k]
  |  |  ------------------
  ------------------
  |  Branch (2648:45): [True: 649k, False: 144k]
  ------------------
 2649|  8.90M|        dav1d_refmvs_tile_sbrow_init(&t->rt, &f->rf, ts->tiling.col_start,
 2650|  8.90M|                                     ts->tiling.col_end, ts->tiling.row_start,
 2651|  8.90M|                                     ts->tiling.row_end, t->by >> f->sb_shift,
 2652|  8.90M|                                     ts->tiling.row, t->frame_thread.pass);
 2653|  8.90M|    }
 2654|       |
 2655|  9.04M|    if (IS_INTER_OR_SWITCH(f->frame_hdr) && c->n_fc > 1) {
  ------------------
  |  |   36|  18.0M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 8.25M, False: 794k]
  |  |  ------------------
  ------------------
  |  Branch (2655:45): [True: 8.25M, False: 18.4E]
  ------------------
 2656|  8.24M|        const int sby = (t->by - ts->tiling.row_start) >> f->sb_shift;
 2657|  8.24M|        int (*const lowest_px)[2] = ts->lowest_pixel[sby];
 2658|  65.8M|        for (int n = 0; n < 7; n++)
  ------------------
  |  Branch (2658:25): [True: 57.5M, False: 8.24M]
  ------------------
 2659|   172M|            for (int m = 0; m < 2; m++)
  ------------------
  |  Branch (2659:29): [True: 115M, False: 57.5M]
  ------------------
 2660|   115M|                lowest_px[n][m] = INT_MIN;
 2661|  8.24M|    }
 2662|       |
 2663|  9.04M|    reset_context(&t->l, IS_KEY_OR_INTRA(f->frame_hdr), t->frame_thread.pass);
  ------------------
  |  |   43|  9.04M|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  9.04M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  ------------------
 2664|  9.04M|    if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (2664:9): [True: 4.45M, False: 4.58M]
  ------------------
 2665|  18.4E|        const int off_2pass = c->n_tc > 1 ? f->sb128w * f->frame_hdr->tiling.rows : 0;
  ------------------
  |  Branch (2665:31): [True: 4.45M, False: 18.4E]
  ------------------
 2666|  4.45M|        for (t->bx = ts->tiling.col_start,
 2667|  4.45M|             t->a = f->a + off_2pass + col_sb128_start + tile_row * f->sb128w;
 2668|  9.32M|             t->bx < ts->tiling.col_end; t->bx += sb_step)
  ------------------
  |  Branch (2668:14): [True: 4.87M, False: 4.45M]
  ------------------
 2669|  4.87M|        {
 2670|  4.87M|            if (atomic_load_explicit(c->flush, memory_order_relaxed))
  ------------------
  |  Branch (2670:17): [True: 1, False: 4.87M]
  ------------------
 2671|      1|                return 1;
 2672|  4.87M|            if (decode_sb(t, root_bl, dav1d_intra_edge_tree[root_bl]))
  ------------------
  |  Branch (2672:17): [True: 0, False: 4.87M]
  ------------------
 2673|      0|                return 1;
 2674|  4.87M|            if (t->bx & 16 || f->seq_hdr->sb128)
  ------------------
  |  Branch (2674:17): [True: 762k, False: 4.10M]
  |  Branch (2674:31): [True: 3.33M, False: 770k]
  ------------------
 2675|  4.07M|                t->a++;
 2676|  4.87M|        }
 2677|  4.45M|        f->bd_fn.backup_ipred_edge(t);
 2678|  4.45M|        return 0;
 2679|  4.45M|    }
 2680|       |
 2681|  4.62M|    if (f->c->n_tc > 1 && f->frame_hdr->use_ref_frame_mvs) {
  ------------------
  |  Branch (2681:9): [True: 4.62M, False: 18.4E]
  |  Branch (2681:27): [True: 357k, False: 4.26M]
  ------------------
 2682|   357k|        f->c->refmvs_dsp.load_tmvs(&f->rf, ts->tiling.row,
 2683|   357k|                                   ts->tiling.col_start >> 1, ts->tiling.col_end >> 1,
 2684|   357k|                                   t->by >> 1, (t->by + sb_step) >> 1);
 2685|   357k|    }
 2686|  4.58M|    memset(t->pal_sz_uv[1], 0, sizeof(*t->pal_sz_uv));
 2687|  4.58M|    const int sb128y = t->by >> 5;
 2688|  4.58M|    for (t->bx = ts->tiling.col_start, t->a = f->a + col_sb128_start + tile_row * f->sb128w,
 2689|  4.58M|         t->lf_mask = f->lf.mask + sb128y * f->sb128w + col_sb128_start;
 2690|  10.4M|         t->bx < ts->tiling.col_end; t->bx += sb_step)
  ------------------
  |  Branch (2690:10): [True: 5.91M, False: 4.56M]
  ------------------
 2691|  5.91M|    {
 2692|  5.91M|        if (atomic_load_explicit(c->flush, memory_order_relaxed))
  ------------------
  |  Branch (2692:13): [True: 349, False: 5.91M]
  ------------------
 2693|    349|            return 1;
 2694|  5.91M|        if (root_bl == BL_128X128) {
  ------------------
  |  Branch (2694:13): [True: 3.73M, False: 2.18M]
  ------------------
 2695|  3.73M|            t->cur_sb_cdef_idx_ptr = t->lf_mask->cdef_idx;
 2696|  3.73M|            t->cur_sb_cdef_idx_ptr[0] = -1;
 2697|  3.73M|            t->cur_sb_cdef_idx_ptr[1] = -1;
 2698|  3.73M|            t->cur_sb_cdef_idx_ptr[2] = -1;
 2699|  3.73M|            t->cur_sb_cdef_idx_ptr[3] = -1;
 2700|  3.73M|        } else {
 2701|  2.18M|            t->cur_sb_cdef_idx_ptr =
 2702|  2.18M|                &t->lf_mask->cdef_idx[((t->bx & 16) >> 4) +
 2703|  2.18M|                                      ((t->by & 16) >> 3)];
 2704|  2.18M|            t->cur_sb_cdef_idx_ptr[0] = -1;
 2705|  2.18M|        }
 2706|       |        // Restoration filter
 2707|  23.6M|        for (int p = 0; p < 3; p++) {
  ------------------
  |  Branch (2707:25): [True: 17.7M, False: 5.91M]
  ------------------
 2708|  17.7M|            if (!((f->lf.restore_planes >> p) & 1U))
  ------------------
  |  Branch (2708:17): [True: 17.0M, False: 668k]
  ------------------
 2709|  17.0M|                continue;
 2710|       |
 2711|   668k|            const int ss_ver = p && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (2711:32): [True: 196k, False: 472k]
  |  Branch (2711:37): [True: 121k, False: 75.3k]
  ------------------
 2712|   668k|            const int ss_hor = p && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (2712:32): [True: 196k, False: 472k]
  |  Branch (2712:37): [True: 127k, False: 68.5k]
  ------------------
 2713|   668k|            const int unit_size_log2 = f->frame_hdr->restoration.unit_size[!!p];
 2714|   668k|            const int y = t->by * 4 >> ss_ver;
 2715|   668k|            const int h = (f->cur.p.h + ss_ver) >> ss_ver;
 2716|       |
 2717|   668k|            const int unit_size = 1 << unit_size_log2;
 2718|   668k|            const unsigned mask = unit_size - 1;
 2719|   668k|            if (y & mask) continue;
  ------------------
  |  Branch (2719:17): [True: 210k, False: 458k]
  ------------------
 2720|   458k|            const int half_unit = unit_size >> 1;
 2721|       |            // Round half up at frame boundaries, if there's more than one
 2722|       |            // restoration unit
 2723|   458k|            if (y && y + half_unit > h) continue;
  ------------------
  |  Branch (2723:17): [True: 287k, False: 171k]
  |  Branch (2723:22): [True: 9.07k, False: 278k]
  ------------------
 2724|       |
 2725|   449k|            const enum Dav1dRestorationType frame_type = f->frame_hdr->restoration.type[p];
 2726|       |
 2727|   449k|            if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (2727:17): [True: 81.5k, False: 368k]
  ------------------
 2728|  81.5k|                const int w = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
 2729|  81.5k|                const int n_units = imax(1, (w + half_unit) >> unit_size_log2);
 2730|       |
 2731|  81.5k|                const int d = f->frame_hdr->super_res.width_scale_denominator;
 2732|  81.5k|                const int rnd = unit_size * 8 - 1, shift = unit_size_log2 + 3;
 2733|  81.5k|                const int x0 = ((4 *  t->bx            * d >> ss_hor) + rnd) >> shift;
 2734|  81.5k|                const int x1 = ((4 * (t->bx + sb_step) * d >> ss_hor) + rnd) >> shift;
 2735|       |
 2736|   144k|                for (int x = x0; x < imin(x1, n_units); x++) {
  ------------------
  |  Branch (2736:34): [True: 62.5k, False: 81.5k]
  ------------------
 2737|  62.5k|                    const int px_x = x << (unit_size_log2 + ss_hor);
 2738|  62.5k|                    const int sb_idx = (t->by >> 5) * f->sr_sb128w + (px_x >> 7);
 2739|  62.5k|                    const int unit_idx = ((t->by & 16) >> 3) + ((px_x & 64) >> 6);
 2740|  62.5k|                    Av1RestorationUnit *const lr = &f->lf.lr_mask[sb_idx].lr[p][unit_idx];
 2741|       |
 2742|  62.5k|                    read_restoration_info(t, lr, p, frame_type);
 2743|  62.5k|                }
 2744|   368k|            } else {
 2745|   368k|                const int x = 4 * t->bx >> ss_hor;
 2746|   368k|                if (x & mask) continue;
  ------------------
  |  Branch (2746:21): [True: 109k, False: 258k]
  ------------------
 2747|   258k|                const int w = (f->cur.p.w + ss_hor) >> ss_hor;
 2748|       |                // Round half up at frame boundaries, if there's more than one
 2749|       |                // restoration unit
 2750|   258k|                if (x && x + half_unit > w) continue;
  ------------------
  |  Branch (2750:21): [True: 109k, False: 148k]
  |  Branch (2750:26): [True: 2.07k, False: 107k]
  ------------------
 2751|   256k|                const int sb_idx = (t->by >> 5) * f->sr_sb128w + (t->bx >> 5);
 2752|   256k|                const int unit_idx = ((t->by & 16) >> 3) + ((t->bx & 16) >> 4);
 2753|   256k|                Av1RestorationUnit *const lr = &f->lf.lr_mask[sb_idx].lr[p][unit_idx];
 2754|       |
 2755|   256k|                read_restoration_info(t, lr, p, frame_type);
 2756|   256k|            }
 2757|   449k|        }
 2758|  5.91M|        if (decode_sb(t, root_bl, dav1d_intra_edge_tree[root_bl]))
  ------------------
  |  Branch (2758:13): [True: 26.0k, False: 5.89M]
  ------------------
 2759|  26.0k|            return 1;
 2760|  5.89M|        if (t->bx & 16 || f->seq_hdr->sb128) {
  ------------------
  |  Branch (2760:13): [True: 1.07M, False: 4.81M]
  |  Branch (2760:27): [True: 3.71M, False: 1.10M]
  ------------------
 2761|  4.77M|            t->a++;
 2762|  4.77M|            t->lf_mask++;
 2763|  4.77M|        }
 2764|  5.89M|    }
 2765|       |
 2766|  4.56M|    if (f->seq_hdr->ref_frame_mvs && f->c->n_tc > 1 && IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|   495k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 366k, False: 129k]
  |  |  ------------------
  ------------------
  |  Branch (2766:9): [True: 495k, False: 4.06M]
  |  Branch (2766:38): [True: 495k, False: 0]
  ------------------
 2767|   366k|        dav1d_refmvs_save_tmvs(&f->c->refmvs_dsp, &t->rt,
 2768|   366k|                               ts->tiling.col_start >> 1, ts->tiling.col_end >> 1,
 2769|   366k|                               t->by >> 1, (t->by + sb_step) >> 1);
 2770|   366k|    }
 2771|       |
 2772|       |    // backup pre-loopfilter pixels for intra prediction of the next sbrow
 2773|  4.56M|    if (t->frame_thread.pass != 1)
  ------------------
  |  Branch (2773:9): [True: 0, False: 4.56M]
  ------------------
 2774|      0|        f->bd_fn.backup_ipred_edge(t);
 2775|       |
 2776|       |    // backup t->a/l.tx_lpf_y/uv at tile boundaries to use them to "fix"
 2777|       |    // up the initial value in neighbour tiles when running the loopfilter
 2778|  4.56M|    int align_h = (f->bh + 31) & ~31;
 2779|  4.56M|    memcpy(&f->lf.tx_lpf_right_edge[0][align_h * tile_col + t->by],
 2780|  4.56M|           &t->l.tx_lpf_y[t->by & 16], sb_step);
 2781|  4.56M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2782|  4.56M|    align_h >>= ss_ver;
 2783|  4.56M|    memcpy(&f->lf.tx_lpf_right_edge[1][align_h * tile_col + (t->by >> ss_ver)],
 2784|  4.56M|           &t->l.tx_lpf_uv[(t->by & 16) >> ss_ver], sb_step >> ss_ver);
 2785|       |
 2786|       |    // error out on symbol decoder overread
 2787|  4.56M|    if (ts->msac.cnt <= -15) return 1;
  ------------------
  |  Branch (2787:9): [True: 67.6k, False: 4.49M]
  ------------------
 2788|       |
 2789|  4.49M|    return c->strict_std_compliance &&
  ------------------
  |  Branch (2789:12): [True: 0, False: 4.49M]
  ------------------
 2790|      0|           (t->by >> f->sb_shift) + 1 >= f->frame_hdr->tiling.row_start_sb[tile_row + 1] &&
  ------------------
  |  Branch (2790:12): [True: 0, False: 0]
  ------------------
 2791|      0|           check_trailing_bits_after_symbol_coder(&ts->msac);
  ------------------
  |  Branch (2791:12): [True: 0, False: 0]
  ------------------
 2792|  4.56M|}
dav1d_decode_frame_init:
 2794|   215k|int dav1d_decode_frame_init(Dav1dFrameContext *const f) {
 2795|   215k|    const Dav1dContext *const c = f->c;
 2796|   215k|    int retval = DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|   215k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 2797|       |
 2798|   215k|    if (f->sbh > f->lf.start_of_tile_row_sz) {
  ------------------
  |  Branch (2798:9): [True: 23.1k, False: 192k]
  ------------------
 2799|  23.1k|        dav1d_free(f->lf.start_of_tile_row);
  ------------------
  |  |  135|  23.1k|#define dav1d_free(ptr) free(ptr)
  ------------------
 2800|  23.1k|        f->lf.start_of_tile_row = dav1d_malloc(ALLOC_TILE, f->sbh * sizeof(uint8_t));
  ------------------
  |  |  132|  23.1k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 2801|  23.1k|        if (!f->lf.start_of_tile_row) {
  ------------------
  |  Branch (2801:13): [True: 0, False: 23.1k]
  ------------------
 2802|      0|            f->lf.start_of_tile_row_sz = 0;
 2803|      0|            goto error;
 2804|      0|        }
 2805|  23.1k|        f->lf.start_of_tile_row_sz = f->sbh;
 2806|  23.1k|    }
 2807|   215k|    int sby = 0;
 2808|   499k|    for (int tile_row = 0; tile_row < f->frame_hdr->tiling.rows; tile_row++) {
  ------------------
  |  Branch (2808:28): [True: 284k, False: 215k]
  ------------------
 2809|   284k|        f->lf.start_of_tile_row[sby++] = tile_row;
 2810|  14.1M|        while (sby < f->frame_hdr->tiling.row_start_sb[tile_row + 1])
  ------------------
  |  Branch (2810:16): [True: 13.8M, False: 284k]
  ------------------
 2811|  13.8M|            f->lf.start_of_tile_row[sby++] = 0;
 2812|   284k|    }
 2813|       |
 2814|   215k|    const int n_ts = f->frame_hdr->tiling.cols * f->frame_hdr->tiling.rows;
 2815|   215k|    if (n_ts != f->n_ts) {
  ------------------
  |  Branch (2815:9): [True: 43.8k, False: 171k]
  ------------------
 2816|  43.8k|        if (c->n_fc > 1) {
  ------------------
  |  Branch (2816:13): [True: 43.8k, False: 18.4E]
  ------------------
 2817|  43.8k|            dav1d_free(f->frame_thread.tile_start_off);
  ------------------
  |  |  135|  43.8k|#define dav1d_free(ptr) free(ptr)
  ------------------
 2818|  43.8k|            f->frame_thread.tile_start_off =
 2819|  43.8k|                dav1d_malloc(ALLOC_TILE, sizeof(*f->frame_thread.tile_start_off) * n_ts);
  ------------------
  |  |  132|  43.8k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 2820|  43.8k|            if (!f->frame_thread.tile_start_off) {
  ------------------
  |  Branch (2820:17): [True: 0, False: 43.8k]
  ------------------
 2821|      0|                f->n_ts = 0;
 2822|      0|                goto error;
 2823|      0|            }
 2824|  43.8k|        }
 2825|  43.8k|        dav1d_free_aligned(f->ts);
  ------------------
  |  |  136|  43.8k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2826|  43.8k|        f->ts = dav1d_alloc_aligned(ALLOC_TILE, sizeof(*f->ts) * n_ts, 32);
  ------------------
  |  |  134|  43.8k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2827|  43.8k|        if (!f->ts) {
  ------------------
  |  Branch (2827:13): [True: 0, False: 43.8k]
  ------------------
 2828|      0|            f->n_ts = 0;
 2829|      0|            goto error;
 2830|      0|        }
 2831|  43.8k|        f->n_ts = n_ts;
 2832|  43.8k|    }
 2833|       |
 2834|   215k|    const int a_sz = f->sb128w * f->frame_hdr->tiling.rows * (1 + (c->n_fc > 1 && c->n_tc > 1));
  ------------------
  |  Branch (2834:68): [True: 215k, False: 18.4E]
  |  Branch (2834:83): [True: 215k, False: 18.4E]
  ------------------
 2835|   215k|    if (a_sz != f->a_sz) {
  ------------------
  |  Branch (2835:9): [True: 43.8k, False: 171k]
  ------------------
 2836|  43.8k|        dav1d_free_aligned(f->a);
  ------------------
  |  |  136|  43.8k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2837|  43.8k|        f->a = dav1d_alloc_aligned(ALLOC_TILE, sizeof(*f->a) * a_sz, 16);
  ------------------
  |  |  134|  43.8k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2838|  43.8k|        if (!f->a) {
  ------------------
  |  Branch (2838:13): [True: 0, False: 43.8k]
  ------------------
 2839|      0|            f->a_sz = 0;
 2840|      0|            goto error;
 2841|      0|        }
 2842|  43.8k|        f->a_sz = a_sz;
 2843|  43.8k|    }
 2844|       |
 2845|   215k|    const int num_sb128 = f->sb128w * f->sb128h;
 2846|   215k|    const uint8_t *const size_mul = ss_size_mul[f->cur.p.layout];
 2847|   215k|    const int hbd = !!f->seq_hdr->hbd;
 2848|   215k|    if (c->n_fc > 1) {
  ------------------
  |  Branch (2848:9): [True: 215k, False: 18.4E]
  ------------------
 2849|   215k|        const unsigned sb_step4 = f->sb_step * 4;
 2850|   215k|        int tile_idx = 0;
 2851|   499k|        for (int tile_row = 0; tile_row < f->frame_hdr->tiling.rows; tile_row++) {
  ------------------
  |  Branch (2851:32): [True: 284k, False: 215k]
  ------------------
 2852|   284k|            const unsigned row_off = f->frame_hdr->tiling.row_start_sb[tile_row] *
 2853|   284k|                                     sb_step4 * f->sb128w * 128;
 2854|   284k|            const unsigned b_diff = (f->frame_hdr->tiling.row_start_sb[tile_row + 1] -
 2855|   284k|                                     f->frame_hdr->tiling.row_start_sb[tile_row]) * sb_step4;
 2856|   605k|            for (int tile_col = 0; tile_col < f->frame_hdr->tiling.cols; tile_col++) {
  ------------------
  |  Branch (2856:36): [True: 321k, False: 284k]
  ------------------
 2857|   321k|                f->frame_thread.tile_start_off[tile_idx++] = row_off + b_diff *
 2858|   321k|                    f->frame_hdr->tiling.col_start_sb[tile_col] * sb_step4;
 2859|   321k|            }
 2860|   284k|        }
 2861|       |
 2862|   215k|        const int lowest_pixel_mem_sz = f->frame_hdr->tiling.cols * f->sbh;
 2863|   215k|        if (lowest_pixel_mem_sz != f->tile_thread.lowest_pixel_mem_sz) {
  ------------------
  |  Branch (2863:13): [True: 34.8k, False: 180k]
  ------------------
 2864|  34.8k|            dav1d_free(f->tile_thread.lowest_pixel_mem);
  ------------------
  |  |  135|  34.8k|#define dav1d_free(ptr) free(ptr)
  ------------------
 2865|  34.8k|            f->tile_thread.lowest_pixel_mem =
 2866|  34.8k|                dav1d_malloc(ALLOC_TILE, lowest_pixel_mem_sz *
  ------------------
  |  |  132|  34.8k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 2867|  34.8k|                             sizeof(*f->tile_thread.lowest_pixel_mem));
 2868|  34.8k|            if (!f->tile_thread.lowest_pixel_mem) {
  ------------------
  |  Branch (2868:17): [True: 0, False: 34.8k]
  ------------------
 2869|      0|                f->tile_thread.lowest_pixel_mem_sz = 0;
 2870|      0|                goto error;
 2871|      0|            }
 2872|  34.8k|            f->tile_thread.lowest_pixel_mem_sz = lowest_pixel_mem_sz;
 2873|  34.8k|        }
 2874|   215k|        int (*lowest_pixel_ptr)[7][2] = f->tile_thread.lowest_pixel_mem;
 2875|   499k|        for (int tile_row = 0, tile_row_base = 0; tile_row < f->frame_hdr->tiling.rows;
  ------------------
  |  Branch (2875:51): [True: 283k, False: 215k]
  ------------------
 2876|   283k|             tile_row++, tile_row_base += f->frame_hdr->tiling.cols)
 2877|   283k|        {
 2878|   283k|            const int tile_row_sb_h = f->frame_hdr->tiling.row_start_sb[tile_row + 1] -
 2879|   283k|                                      f->frame_hdr->tiling.row_start_sb[tile_row];
 2880|   605k|            for (int tile_col = 0; tile_col < f->frame_hdr->tiling.cols; tile_col++) {
  ------------------
  |  Branch (2880:36): [True: 321k, False: 283k]
  ------------------
 2881|   321k|                f->ts[tile_row_base + tile_col].lowest_pixel = lowest_pixel_ptr;
 2882|   321k|                lowest_pixel_ptr += tile_row_sb_h;
 2883|   321k|            }
 2884|   283k|        }
 2885|       |
 2886|   215k|        const int cbi_sz = num_sb128 * size_mul[0];
 2887|   215k|        if (cbi_sz != f->frame_thread.cbi_sz) {
  ------------------
  |  Branch (2887:13): [True: 30.8k, False: 184k]
  ------------------
 2888|  30.8k|            dav1d_free_aligned(f->frame_thread.cbi);
  ------------------
  |  |  136|  30.8k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2889|  30.8k|            f->frame_thread.cbi =
 2890|  30.8k|                dav1d_alloc_aligned(ALLOC_BLOCK, sizeof(*f->frame_thread.cbi) *
  ------------------
  |  |  134|  30.8k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2891|  30.8k|                                    cbi_sz * 32 * 32 / 4, 64);
 2892|  30.8k|            if (!f->frame_thread.cbi) {
  ------------------
  |  Branch (2892:17): [True: 0, False: 30.8k]
  ------------------
 2893|      0|                f->frame_thread.cbi_sz = 0;
 2894|      0|                goto error;
 2895|      0|            }
 2896|  30.8k|            f->frame_thread.cbi_sz = cbi_sz;
 2897|  30.8k|        }
 2898|       |
 2899|   215k|        const int cf_sz = (num_sb128 * size_mul[0]) << hbd;
 2900|   215k|        if (cf_sz != f->frame_thread.cf_sz) {
  ------------------
  |  Branch (2900:13): [True: 31.3k, False: 184k]
  ------------------
 2901|  31.3k|            dav1d_free_aligned(f->frame_thread.cf);
  ------------------
  |  |  136|  31.3k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2902|  31.3k|            f->frame_thread.cf =
 2903|  31.3k|                dav1d_alloc_aligned(ALLOC_COEF, (size_t)cf_sz * 128 * 128 / 2, 64);
  ------------------
  |  |  134|  31.3k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2904|  31.3k|            if (!f->frame_thread.cf) {
  ------------------
  |  Branch (2904:17): [True: 0, False: 31.3k]
  ------------------
 2905|      0|                f->frame_thread.cf_sz = 0;
 2906|      0|                goto error;
 2907|      0|            }
 2908|  31.3k|            memset(f->frame_thread.cf, 0, (size_t)cf_sz * 128 * 128 / 2);
 2909|  31.3k|            f->frame_thread.cf_sz = cf_sz;
 2910|  31.3k|        }
 2911|       |
 2912|   215k|        if (f->frame_hdr->allow_screen_content_tools) {
  ------------------
  |  Branch (2912:13): [True: 145k, False: 70.0k]
  ------------------
 2913|   145k|            const int pal_sz = num_sb128 << hbd;
 2914|   145k|            if (pal_sz != f->frame_thread.pal_sz) {
  ------------------
  |  Branch (2914:17): [True: 16.8k, False: 128k]
  ------------------
 2915|  16.8k|                dav1d_free_aligned(f->frame_thread.pal);
  ------------------
  |  |  136|  16.8k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2916|  16.8k|                f->frame_thread.pal =
 2917|  16.8k|                    dav1d_alloc_aligned(ALLOC_PAL, sizeof(*f->frame_thread.pal) *
  ------------------
  |  |  134|  16.8k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2918|  16.8k|                                        pal_sz * 16 * 16, 64);
 2919|  16.8k|                if (!f->frame_thread.pal) {
  ------------------
  |  Branch (2919:21): [True: 0, False: 16.8k]
  ------------------
 2920|      0|                    f->frame_thread.pal_sz = 0;
 2921|      0|                    goto error;
 2922|      0|                }
 2923|  16.8k|                f->frame_thread.pal_sz = pal_sz;
 2924|  16.8k|            }
 2925|       |
 2926|   145k|            const int pal_idx_sz = num_sb128 * size_mul[1];
 2927|   145k|            if (pal_idx_sz != f->frame_thread.pal_idx_sz) {
  ------------------
  |  Branch (2927:17): [True: 16.9k, False: 128k]
  ------------------
 2928|  16.9k|                dav1d_free_aligned(f->frame_thread.pal_idx);
  ------------------
  |  |  136|  16.9k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2929|  16.9k|                f->frame_thread.pal_idx =
 2930|  16.9k|                    dav1d_alloc_aligned(ALLOC_PAL, sizeof(*f->frame_thread.pal_idx) *
  ------------------
  |  |  134|  16.9k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2931|  16.9k|                                        pal_idx_sz * 128 * 128 / 8, 64);
 2932|  16.9k|                if (!f->frame_thread.pal_idx) {
  ------------------
  |  Branch (2932:21): [True: 0, False: 16.9k]
  ------------------
 2933|      0|                    f->frame_thread.pal_idx_sz = 0;
 2934|      0|                    goto error;
 2935|      0|                }
 2936|  16.9k|                f->frame_thread.pal_idx_sz = pal_idx_sz;
 2937|  16.9k|            }
 2938|   145k|        } else if (f->frame_thread.pal) {
  ------------------
  |  Branch (2938:20): [True: 1.88k, False: 68.1k]
  ------------------
 2939|  1.88k|            dav1d_freep_aligned(&f->frame_thread.pal);
 2940|  1.88k|            dav1d_freep_aligned(&f->frame_thread.pal_idx);
 2941|  1.88k|            f->frame_thread.pal_sz = f->frame_thread.pal_idx_sz = 0;
 2942|  1.88k|        }
 2943|   215k|    }
 2944|       |
 2945|       |    // update allocation of block contexts for above
 2946|   215k|    ptrdiff_t y_stride = f->cur.stride[0], uv_stride = f->cur.stride[1];
 2947|   215k|    const int has_resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
 2948|   215k|    const int need_cdef_lpf_copy = c->n_tc > 1 && has_resize;
  ------------------
  |  Branch (2948:36): [True: 215k, False: 44]
  |  Branch (2948:51): [True: 37.7k, False: 177k]
  ------------------
 2949|   215k|    if (y_stride * f->sbh * 4 != f->lf.cdef_buf_plane_sz[0] ||
  ------------------
  |  Branch (2949:9): [True: 30.4k, False: 185k]
  ------------------
 2950|   185k|        uv_stride * f->sbh * 8 != f->lf.cdef_buf_plane_sz[1] ||
  ------------------
  |  Branch (2950:9): [True: 460, False: 184k]
  ------------------
 2951|   184k|        need_cdef_lpf_copy != f->lf.need_cdef_lpf_copy ||
  ------------------
  |  Branch (2951:9): [True: 1.36k, False: 183k]
  ------------------
 2952|   183k|        f->sbh != f->lf.cdef_buf_sbh)
  ------------------
  |  Branch (2952:9): [True: 448, False: 182k]
  ------------------
 2953|  32.6k|    {
 2954|  32.6k|        dav1d_free_aligned(f->lf.cdef_line_buf);
  ------------------
  |  |  136|  32.6k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2955|  32.6k|        size_t alloc_sz = 64;
 2956|  32.6k|        alloc_sz += (size_t)llabs(y_stride) * 4 * f->sbh << need_cdef_lpf_copy;
 2957|  32.6k|        alloc_sz += (size_t)llabs(uv_stride) * 8 * f->sbh << need_cdef_lpf_copy;
 2958|  32.6k|        uint8_t *ptr = f->lf.cdef_line_buf = dav1d_alloc_aligned(ALLOC_CDEF, alloc_sz, 32);
  ------------------
  |  |  134|  32.6k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2959|  32.6k|        if (!ptr) {
  ------------------
  |  Branch (2959:13): [True: 0, False: 32.6k]
  ------------------
 2960|      0|            f->lf.cdef_buf_plane_sz[0] = f->lf.cdef_buf_plane_sz[1] = 0;
 2961|      0|            goto error;
 2962|      0|        }
 2963|       |
 2964|  32.6k|        ptr += 32;
 2965|  32.6k|        if (y_stride < 0) {
  ------------------
  |  Branch (2965:13): [True: 0, False: 32.6k]
  ------------------
 2966|      0|            f->lf.cdef_line[0][0] = ptr - y_stride * (f->sbh * 4 - 1);
 2967|      0|            f->lf.cdef_line[1][0] = ptr - y_stride * (f->sbh * 4 - 3);
 2968|  32.6k|        } else {
 2969|  32.6k|            f->lf.cdef_line[0][0] = ptr + y_stride * 0;
 2970|  32.6k|            f->lf.cdef_line[1][0] = ptr + y_stride * 2;
 2971|  32.6k|        }
 2972|  32.6k|        ptr += llabs(y_stride) * f->sbh * 4;
 2973|  32.6k|        if (uv_stride < 0) {
  ------------------
  |  Branch (2973:13): [True: 0, False: 32.6k]
  ------------------
 2974|      0|            f->lf.cdef_line[0][1] = ptr - uv_stride * (f->sbh * 8 - 1);
 2975|      0|            f->lf.cdef_line[0][2] = ptr - uv_stride * (f->sbh * 8 - 3);
 2976|      0|            f->lf.cdef_line[1][1] = ptr - uv_stride * (f->sbh * 8 - 5);
 2977|      0|            f->lf.cdef_line[1][2] = ptr - uv_stride * (f->sbh * 8 - 7);
 2978|  32.6k|        } else {
 2979|  32.6k|            f->lf.cdef_line[0][1] = ptr + uv_stride * 0;
 2980|  32.6k|            f->lf.cdef_line[0][2] = ptr + uv_stride * 2;
 2981|  32.6k|            f->lf.cdef_line[1][1] = ptr + uv_stride * 4;
 2982|  32.6k|            f->lf.cdef_line[1][2] = ptr + uv_stride * 6;
 2983|  32.6k|        }
 2984|       |
 2985|  32.6k|        if (need_cdef_lpf_copy) {
  ------------------
  |  Branch (2985:13): [True: 9.05k, False: 23.6k]
  ------------------
 2986|  9.05k|            ptr += llabs(uv_stride) * f->sbh * 8;
 2987|  9.05k|            if (y_stride < 0)
  ------------------
  |  Branch (2987:17): [True: 0, False: 9.05k]
  ------------------
 2988|      0|                f->lf.cdef_lpf_line[0] = ptr - y_stride * (f->sbh * 4 - 1);
 2989|  9.05k|            else
 2990|  9.05k|                f->lf.cdef_lpf_line[0] = ptr;
 2991|  9.05k|            ptr += llabs(y_stride) * f->sbh * 4;
 2992|  9.05k|            if (uv_stride < 0) {
  ------------------
  |  Branch (2992:17): [True: 0, False: 9.05k]
  ------------------
 2993|      0|                f->lf.cdef_lpf_line[1] = ptr - uv_stride * (f->sbh * 4 - 1);
 2994|      0|                f->lf.cdef_lpf_line[2] = ptr - uv_stride * (f->sbh * 8 - 1);
 2995|  9.05k|            } else {
 2996|  9.05k|                f->lf.cdef_lpf_line[1] = ptr;
 2997|  9.05k|                f->lf.cdef_lpf_line[2] = ptr + uv_stride * f->sbh * 4;
 2998|  9.05k|            }
 2999|  9.05k|        }
 3000|       |
 3001|  32.6k|        f->lf.cdef_buf_plane_sz[0] = (int) y_stride * f->sbh * 4;
 3002|  32.6k|        f->lf.cdef_buf_plane_sz[1] = (int) uv_stride * f->sbh * 8;
 3003|  32.6k|        f->lf.need_cdef_lpf_copy = need_cdef_lpf_copy;
 3004|  32.6k|        f->lf.cdef_buf_sbh = f->sbh;
 3005|  32.6k|    }
 3006|       |
 3007|   215k|    const int sb128 = f->seq_hdr->sb128;
 3008|   215k|    const int num_lines = c->n_tc > 1 ? f->sbh * 4 << sb128 : 12;
  ------------------
  |  Branch (3008:27): [True: 215k, False: 61]
  ------------------
 3009|   215k|    y_stride = f->sr_cur.p.stride[0], uv_stride = f->sr_cur.p.stride[1];
 3010|   215k|    if (y_stride * num_lines != f->lf.lr_buf_plane_sz[0] ||
  ------------------
  |  Branch (3010:9): [True: 28.3k, False: 187k]
  ------------------
 3011|   187k|        uv_stride * num_lines * 2 != f->lf.lr_buf_plane_sz[1])
  ------------------
  |  Branch (3011:9): [True: 457, False: 186k]
  ------------------
 3012|  28.7k|    {
 3013|  28.7k|        dav1d_free_aligned(f->lf.lr_line_buf);
  ------------------
  |  |  136|  28.7k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 3014|       |        // lr simd may overread the input, so slightly over-allocate the lpf buffer
 3015|  28.7k|        size_t alloc_sz = 128;
 3016|  28.7k|        alloc_sz += (size_t)llabs(y_stride) * num_lines;
 3017|  28.7k|        alloc_sz += (size_t)llabs(uv_stride) * num_lines * 2;
 3018|  28.7k|        uint8_t *ptr = f->lf.lr_line_buf = dav1d_alloc_aligned(ALLOC_LR, alloc_sz, 64);
  ------------------
  |  |  134|  28.7k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 3019|  28.7k|        if (!ptr) {
  ------------------
  |  Branch (3019:13): [True: 0, False: 28.7k]
  ------------------
 3020|      0|            f->lf.lr_buf_plane_sz[0] = f->lf.lr_buf_plane_sz[1] = 0;
 3021|      0|            goto error;
 3022|      0|        }
 3023|       |
 3024|  28.7k|        ptr += 64;
 3025|  28.7k|        if (y_stride < 0)
  ------------------
  |  Branch (3025:13): [True: 0, False: 28.7k]
  ------------------
 3026|      0|            f->lf.lr_lpf_line[0] = ptr - y_stride * (num_lines - 1);
 3027|  28.7k|        else
 3028|  28.7k|            f->lf.lr_lpf_line[0] = ptr;
 3029|  28.7k|        ptr += llabs(y_stride) * num_lines;
 3030|  28.7k|        if (uv_stride < 0) {
  ------------------
  |  Branch (3030:13): [True: 0, False: 28.7k]
  ------------------
 3031|      0|            f->lf.lr_lpf_line[1] = ptr - uv_stride * (num_lines * 1 - 1);
 3032|      0|            f->lf.lr_lpf_line[2] = ptr - uv_stride * (num_lines * 2 - 1);
 3033|  28.7k|        } else {
 3034|  28.7k|            f->lf.lr_lpf_line[1] = ptr;
 3035|  28.7k|            f->lf.lr_lpf_line[2] = ptr + uv_stride * num_lines;
 3036|  28.7k|        }
 3037|       |
 3038|  28.7k|        f->lf.lr_buf_plane_sz[0] = (int) y_stride * num_lines;
 3039|  28.7k|        f->lf.lr_buf_plane_sz[1] = (int) uv_stride * num_lines * 2;
 3040|  28.7k|    }
 3041|       |
 3042|       |    // update allocation for loopfilter masks
 3043|   215k|    if (num_sb128 != f->lf.mask_sz) {
  ------------------
  |  Branch (3043:9): [True: 30.4k, False: 185k]
  ------------------
 3044|  30.4k|        dav1d_free(f->lf.mask);
  ------------------
  |  |  135|  30.4k|#define dav1d_free(ptr) free(ptr)
  ------------------
 3045|  30.4k|        dav1d_free_aligned(f->lf.level[0]);
  ------------------
  |  |  136|  30.4k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 3046|  30.4k|        f->lf.mask = dav1d_malloc(ALLOC_LF, sizeof(*f->lf.mask) * num_sb128);
  ------------------
  |  |  132|  30.4k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3047|       |        // over-allocate by 3 bytes since some of the SIMD implementations
 3048|       |        // index these from the level type and can thus over-read by up to 3
 3049|  30.4k|        size_t level_bytes = sizeof(*f->lf.level[0]) * num_sb128 * 32 * 32;
 3050|  30.4k|        f->lf.level[0] = dav1d_alloc_aligned(ALLOC_LF, 2 * level_bytes + 3, 64);
  ------------------
  |  |  134|  30.4k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 3051|  30.4k|        if (!f->lf.mask || !f->lf.level[0]) {
  ------------------
  |  Branch (3051:13): [True: 2, False: 30.4k]
  |  Branch (3051:28): [True: 0, False: 30.4k]
  ------------------
 3052|      0|            f->lf.mask_sz = 0;
 3053|      0|            goto error;
 3054|      0|        }
 3055|  30.4k|        f->lf.level[1] = (void*)((uint8_t*)f->lf.level[0] + level_bytes);
 3056|  30.4k|        if (c->n_fc > 1) {
  ------------------
  |  Branch (3056:13): [True: 30.4k, False: 2]
  ------------------
 3057|  30.4k|            dav1d_free(f->frame_thread.b);
  ------------------
  |  |  135|  30.4k|#define dav1d_free(ptr) free(ptr)
  ------------------
 3058|  30.4k|            f->frame_thread.b = dav1d_malloc(ALLOC_BLOCK, sizeof(*f->frame_thread.b) *
  ------------------
  |  |  132|  30.4k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3059|  30.4k|                                             num_sb128 * 32 * 32);
 3060|  30.4k|            if (!f->frame_thread.b) {
  ------------------
  |  Branch (3060:17): [True: 0, False: 30.4k]
  ------------------
 3061|      0|                f->lf.mask_sz = 0;
 3062|      0|                goto error;
 3063|      0|            }
 3064|  30.4k|        }
 3065|  30.4k|        f->lf.mask_sz = num_sb128;
 3066|  30.4k|    }
 3067|       |
 3068|   215k|    f->sr_sb128w = (f->sr_cur.p.p.w + 127) >> 7;
 3069|   215k|    const int lr_mask_sz = f->sr_sb128w * f->sb128h;
 3070|   215k|    if (lr_mask_sz != f->lf.lr_mask_sz) {
  ------------------
  |  Branch (3070:9): [True: 27.7k, False: 187k]
  ------------------
 3071|  27.7k|        dav1d_free(f->lf.lr_mask);
  ------------------
  |  |  135|  27.7k|#define dav1d_free(ptr) free(ptr)
  ------------------
 3072|  27.7k|        f->lf.lr_mask = dav1d_malloc(ALLOC_LR, sizeof(*f->lf.lr_mask) * lr_mask_sz);
  ------------------
  |  |  132|  27.7k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3073|  27.7k|        if (!f->lf.lr_mask) {
  ------------------
  |  Branch (3073:13): [True: 0, False: 27.7k]
  ------------------
 3074|      0|            f->lf.lr_mask_sz = 0;
 3075|      0|            goto error;
 3076|      0|        }
 3077|  27.7k|        f->lf.lr_mask_sz = lr_mask_sz;
 3078|  27.7k|    }
 3079|   215k|    int cdef_planes = 0;
 3080|   215k|    if (c->inloop_filters & DAV1D_INLOOPFILTER_CDEF) {
  ------------------
  |  Branch (3080:9): [True: 215k, False: 72]
  ------------------
 3081|   457k|        for (int i = 0; i < (1 << f->frame_hdr->cdef.n_bits); i++) {
  ------------------
  |  Branch (3081:25): [True: 241k, False: 215k]
  ------------------
 3082|   241k|            cdef_planes |= (!!f->frame_hdr->cdef.y_strength[i]) |
 3083|   241k|                           ((!!f->frame_hdr->cdef.uv_strength[i]) << 1);
 3084|   241k|        }
 3085|   215k|    }
 3086|   215k|    f->lf.cdef_planes = cdef_planes;
 3087|   215k|    f->lf.restore_planes =
 3088|   215k|        ((f->frame_hdr->restoration.type[0] != DAV1D_RESTORATION_NONE) << 0) +
 3089|   215k|        ((f->frame_hdr->restoration.type[1] != DAV1D_RESTORATION_NONE) << 1) +
 3090|   215k|        ((f->frame_hdr->restoration.type[2] != DAV1D_RESTORATION_NONE) << 2);
 3091|   215k|    if (f->frame_hdr->loopfilter.sharpness != f->lf.last_sharpness) {
  ------------------
  |  Branch (3091:9): [True: 40.3k, False: 175k]
  ------------------
 3092|  40.3k|        dav1d_calc_eih(&f->lf.lim_lut, f->frame_hdr->loopfilter.sharpness);
 3093|  40.3k|        f->lf.last_sharpness = f->frame_hdr->loopfilter.sharpness;
 3094|  40.3k|    }
 3095|   215k|    dav1d_calc_lf_values(f->lf.lvl, f->frame_hdr, (int8_t[4]) { 0, 0, 0, 0 });
 3096|   215k|    memset(f->lf.mask, 0, sizeof(*f->lf.mask) * num_sb128);
 3097|       |
 3098|   215k|    const int ipred_edge_sz = f->sbh * f->sb128w << hbd;
 3099|   215k|    if (ipred_edge_sz != f->ipred_edge_sz) {
  ------------------
  |  Branch (3099:9): [True: 30.3k, False: 185k]
  ------------------
 3100|  30.3k|        dav1d_free_aligned(f->ipred_edge[0]);
  ------------------
  |  |  136|  30.3k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 3101|  30.3k|        uint8_t *ptr = f->ipred_edge[0] =
 3102|  30.3k|            dav1d_alloc_aligned(ALLOC_IPRED, ipred_edge_sz * 128 * 3, 64);
  ------------------
  |  |  134|  30.3k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 3103|  30.3k|        if (!ptr) {
  ------------------
  |  Branch (3103:13): [True: 0, False: 30.3k]
  ------------------
 3104|      0|            f->ipred_edge_sz = 0;
 3105|      0|            goto error;
 3106|      0|        }
 3107|  30.3k|        f->ipred_edge[1] = ptr + ipred_edge_sz * 128 * 1;
 3108|  30.3k|        f->ipred_edge[2] = ptr + ipred_edge_sz * 128 * 2;
 3109|  30.3k|        f->ipred_edge_sz = ipred_edge_sz;
 3110|  30.3k|    }
 3111|       |
 3112|   215k|    const int re_sz = f->sb128h * f->frame_hdr->tiling.cols;
 3113|   215k|    if (re_sz != f->lf.re_sz) {
  ------------------
  |  Branch (3113:9): [True: 34.3k, False: 181k]
  ------------------
 3114|  34.3k|        dav1d_free(f->lf.tx_lpf_right_edge[0]);
  ------------------
  |  |  135|  34.3k|#define dav1d_free(ptr) free(ptr)
  ------------------
 3115|  34.3k|        f->lf.tx_lpf_right_edge[0] = dav1d_malloc(ALLOC_LF, re_sz * 32 * 2);
  ------------------
  |  |  132|  34.3k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3116|  34.3k|        if (!f->lf.tx_lpf_right_edge[0]) {
  ------------------
  |  Branch (3116:13): [True: 0, False: 34.3k]
  ------------------
 3117|      0|            f->lf.re_sz = 0;
 3118|      0|            goto error;
 3119|      0|        }
 3120|  34.3k|        f->lf.tx_lpf_right_edge[1] = f->lf.tx_lpf_right_edge[0] + re_sz * 32;
 3121|  34.3k|        f->lf.re_sz = re_sz;
 3122|  34.3k|    }
 3123|       |
 3124|       |    // init ref mvs
 3125|   215k|    if (IS_INTER_OR_SWITCH(f->frame_hdr) || f->frame_hdr->allow_intrabc) {
  ------------------
  |  |   36|   431k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 90.0k, False: 125k]
  |  |  ------------------
  ------------------
  |  Branch (3125:45): [True: 90.7k, False: 34.7k]
  ------------------
 3126|   180k|        const int ret =
 3127|   180k|            dav1d_refmvs_init_frame(&f->rf, f->seq_hdr, f->frame_hdr,
 3128|   180k|                                    f->refpoc, f->mvs, f->refrefpoc, f->ref_mvs,
 3129|   180k|                                    f->c->n_tc, f->c->n_fc);
 3130|   180k|        if (ret < 0) goto error;
  ------------------
  |  Branch (3130:13): [True: 0, False: 180k]
  ------------------
 3131|   180k|    }
 3132|       |
 3133|       |    // setup dequant tables
 3134|   215k|    init_quant_tables(f->seq_hdr, f->frame_hdr, f->frame_hdr->quant.yac, f->dq);
 3135|   215k|    if (f->frame_hdr->quant.qm)
  ------------------
  |  Branch (3135:9): [True: 35.4k, False: 180k]
  ------------------
 3136|   708k|        for (int i = 0; i < N_RECT_TX_SIZES; i++) {
  ------------------
  |  Branch (3136:25): [True: 673k, False: 35.4k]
  ------------------
 3137|   673k|            f->qm[i][0] = dav1d_qm_tbl[f->frame_hdr->quant.qm_y][0][i];
 3138|   673k|            f->qm[i][1] = dav1d_qm_tbl[f->frame_hdr->quant.qm_u][1][i];
 3139|   673k|            f->qm[i][2] = dav1d_qm_tbl[f->frame_hdr->quant.qm_v][1][i];
 3140|   673k|        }
 3141|   180k|    else
 3142|   180k|        memset(f->qm, 0, sizeof(f->qm));
 3143|       |
 3144|       |    // setup jnt_comp weights
 3145|   215k|    if (f->frame_hdr->switchable_comp_refs) {
  ------------------
  |  Branch (3145:9): [True: 39.7k, False: 175k]
  ------------------
 3146|   316k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3146:25): [True: 276k, False: 39.7k]
  ------------------
 3147|   276k|            const unsigned ref0poc = f->refp[i].p.frame_hdr->frame_offset;
 3148|       |
 3149|  1.10M|            for (int j = i + 1; j < 7; j++) {
  ------------------
  |  Branch (3149:33): [True: 829k, False: 276k]
  ------------------
 3150|   829k|                const unsigned ref1poc = f->refp[j].p.frame_hdr->frame_offset;
 3151|       |
 3152|   829k|                const unsigned d1 =
 3153|   829k|                    imin(abs(get_poc_diff(f->seq_hdr->order_hint_n_bits, ref0poc,
 3154|   829k|                                          f->cur.frame_hdr->frame_offset)), 31);
 3155|   829k|                const unsigned d0 =
 3156|   829k|                    imin(abs(get_poc_diff(f->seq_hdr->order_hint_n_bits, ref1poc,
 3157|   829k|                                          f->cur.frame_hdr->frame_offset)), 31);
 3158|   829k|                const int order = d0 <= d1;
 3159|       |
 3160|   829k|                static const uint8_t quant_dist_weight[3][2] = {
 3161|   829k|                    { 2, 3 }, { 2, 5 }, { 2, 7 }
 3162|   829k|                };
 3163|   829k|                static const uint8_t quant_dist_lookup_table[4][2] = {
 3164|   829k|                    { 9, 7 }, { 11, 5 }, { 12, 4 }, { 13, 3 }
 3165|   829k|                };
 3166|       |
 3167|   829k|                int k;
 3168|  2.15M|                for (k = 0; k < 3; k++) {
  ------------------
  |  Branch (3168:29): [True: 1.77M, False: 385k]
  ------------------
 3169|  1.77M|                    const int c0 = quant_dist_weight[k][order];
 3170|  1.77M|                    const int c1 = quant_dist_weight[k][!order];
 3171|  1.77M|                    const int d0_c0 = d0 * c0;
 3172|  1.77M|                    const int d1_c1 = d1 * c1;
 3173|  1.77M|                    if ((d0 > d1 && d0_c0 < d1_c1) || (d0 <= d1 && d0_c0 > d1_c1)) break;
  ------------------
  |  Branch (3173:26): [True: 482k, False: 1.29M]
  |  Branch (3173:37): [True: 117k, False: 365k]
  |  Branch (3173:56): [True: 1.29M, False: 362k]
  |  Branch (3173:68): [True: 327k, False: 967k]
  ------------------
 3174|  1.77M|                }
 3175|       |
 3176|   829k|                f->jnt_weights[i][j] = quant_dist_lookup_table[k][order];
 3177|   829k|            }
 3178|   276k|        }
 3179|  39.7k|    }
 3180|       |
 3181|       |    /* Init loopfilter pointers. Increasing NULL pointers is technically UB,
 3182|       |     * so just point the chroma pointers in 4:0:0 to the luma plane here to
 3183|       |     * avoid having additional in-loop branches in various places. We never
 3184|       |     * dereference those pointers so it doesn't really matter what they
 3185|       |     * point at, as long as the pointers are valid. */
 3186|   215k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400;
 3187|   215k|    f->lf.p[0] = f->cur.data[0];
 3188|   215k|    f->lf.p[1] = f->cur.data[has_chroma ? 1 : 0];
  ------------------
  |  Branch (3188:30): [True: 141k, False: 74.0k]
  ------------------
 3189|   215k|    f->lf.p[2] = f->cur.data[has_chroma ? 2 : 0];
  ------------------
  |  Branch (3189:30): [True: 141k, False: 74.0k]
  ------------------
 3190|   215k|    f->lf.sr_p[0] = f->sr_cur.p.data[0];
 3191|   215k|    f->lf.sr_p[1] = f->sr_cur.p.data[has_chroma ? 1 : 0];
  ------------------
  |  Branch (3191:38): [True: 141k, False: 74.0k]
  ------------------
 3192|   215k|    f->lf.sr_p[2] = f->sr_cur.p.data[has_chroma ? 2 : 0];
  ------------------
  |  Branch (3192:38): [True: 141k, False: 74.0k]
  ------------------
 3193|       |
 3194|   215k|    retval = 0;
 3195|   215k|error:
 3196|   215k|    return retval;
 3197|   215k|}
dav1d_decode_frame_init_cdf:
 3199|   171k|int dav1d_decode_frame_init_cdf(Dav1dFrameContext *const f) {
 3200|   171k|    const Dav1dContext *const c = f->c;
 3201|   171k|    int retval = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|   171k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3202|       |
 3203|   171k|    if (f->frame_hdr->refresh_context)
  ------------------
  |  Branch (3203:9): [True: 21.8k, False: 149k]
  ------------------
 3204|  21.8k|        dav1d_cdf_thread_copy(f->out_cdf.data.cdf, &f->in_cdf);
 3205|       |
 3206|       |    // parse individual tiles per tile group
 3207|   171k|    int tile_row = 0, tile_col = 0;
 3208|   333k|    for (int i = 0; i < f->n_tile_data; i++) {
  ------------------
  |  Branch (3208:21): [True: 171k, False: 162k]
  ------------------
 3209|   171k|        const uint8_t *data = f->tile[i].data.data;
 3210|   171k|        size_t size = f->tile[i].data.sz;
 3211|       |
 3212|   355k|        for (int j = f->tile[i].start; j <= f->tile[i].end; j++) {
  ------------------
  |  Branch (3212:40): [True: 192k, False: 162k]
  ------------------
 3213|   192k|            size_t tile_sz;
 3214|   192k|            if (j == f->tile[i].end) {
  ------------------
  |  Branch (3214:17): [True: 162k, False: 29.7k]
  ------------------
 3215|   162k|                tile_sz = size;
 3216|   162k|            } else {
 3217|  29.7k|                if (f->frame_hdr->tiling.n_bytes > size) goto error;
  ------------------
  |  Branch (3217:21): [True: 7.30k, False: 22.4k]
  ------------------
 3218|  22.4k|                tile_sz = 0;
 3219|  50.3k|                for (unsigned k = 0; k < f->frame_hdr->tiling.n_bytes; k++)
  ------------------
  |  Branch (3219:38): [True: 27.9k, False: 22.4k]
  ------------------
 3220|  27.9k|                    tile_sz |= (unsigned)*data++ << (k * 8);
 3221|  22.4k|                tile_sz++;
 3222|  22.4k|                size -= f->frame_hdr->tiling.n_bytes;
 3223|  22.4k|                if (tile_sz > size) goto error;
  ------------------
  |  Branch (3223:21): [True: 1.44k, False: 21.0k]
  ------------------
 3224|  22.4k|            }
 3225|       |
 3226|   183k|            setup_tile(&f->ts[j], f, data, tile_sz, tile_row, tile_col++,
 3227|  18.4E|                       c->n_fc > 1 ? f->frame_thread.tile_start_off[j] : 0);
  ------------------
  |  Branch (3227:24): [True: 183k, False: 18.4E]
  ------------------
 3228|       |
 3229|   183k|            if (tile_col == f->frame_hdr->tiling.cols) {
  ------------------
  |  Branch (3229:17): [True: 174k, False: 9.64k]
  ------------------
 3230|   174k|                tile_col = 0;
 3231|   174k|                tile_row++;
 3232|   174k|            }
 3233|   183k|            data += tile_sz;
 3234|   183k|            size -= tile_sz;
 3235|   183k|        }
 3236|   171k|    }
 3237|       |
 3238|   162k|    if (c->n_tc > 1) {
  ------------------
  |  Branch (3238:9): [True: 162k, False: 18.4E]
  ------------------
 3239|   162k|        const int uses_2pass = c->n_fc > 1;
 3240|  2.78M|        for (int n = 0; n < f->sb128w * f->frame_hdr->tiling.rows * (1 + uses_2pass); n++)
  ------------------
  |  Branch (3240:25): [True: 2.61M, False: 162k]
  ------------------
 3241|  2.61M|            reset_context(&f->a[n], IS_KEY_OR_INTRA(f->frame_hdr),
  ------------------
  |  |   43|  2.61M|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  2.61M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  ------------------
 3242|  18.4E|                          uses_2pass ? 1 + (n >= f->sb128w * f->frame_hdr->tiling.rows) : 0);
  ------------------
  |  Branch (3242:27): [True: 2.61M, False: 18.4E]
  ------------------
 3243|   162k|    }
 3244|       |
 3245|   162k|    retval = 0;
 3246|   171k|error:
 3247|   171k|    return retval;
 3248|   162k|}
dav1d_decode_frame_exit:
 3296|   274k|void dav1d_decode_frame_exit(Dav1dFrameContext *const f, int retval) {
 3297|   274k|    const Dav1dContext *const c = f->c;
 3298|       |
 3299|   274k|    if (f->sr_cur.p.data[0])
  ------------------
  |  Branch (3299:9): [True: 216k, False: 58.2k]
  ------------------
 3300|   274k|        atomic_init(&f->task_thread.error, 0);
 3301|       |
 3302|   274k|    if (c->n_fc > 1 && retval && f->frame_thread.cf) {
  ------------------
  |  Branch (3302:9): [True: 274k, False: 0]
  |  Branch (3302:24): [True: 216k, False: 58.6k]
  |  Branch (3302:34): [True: 178k, False: 37.4k]
  ------------------
 3303|   178k|        memset(f->frame_thread.cf, 0,
 3304|   178k|               (size_t)f->frame_thread.cf_sz * 128 * 128 / 2);
 3305|   178k|    }
 3306|  2.19M|    for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3306:21): [True: 1.92M, False: 274k]
  ------------------
 3307|  1.92M|        if (f->refp[i].p.frame_hdr) {
  ------------------
  |  Branch (3307:13): [True: 632k, False: 1.29M]
  ------------------
 3308|   632k|            if (!retval && c->n_fc > 1 && c->strict_std_compliance &&
  ------------------
  |  Branch (3308:17): [True: 146k, False: 486k]
  |  Branch (3308:28): [True: 146k, False: 0]
  |  Branch (3308:43): [True: 0, False: 146k]
  ------------------
 3309|   632k|                atomic_load_explicit(&f->refp[i].progress[1], memory_order_relaxed) == FRAME_ERROR)
  ------------------
  |  |   35|      0|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  |  Branch (3309:17): [True: 0, False: 0]
  ------------------
 3310|      0|            {
 3311|      0|                retval = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3312|      0|                atomic_store_explicit(&f->task_thread.error, 1, memory_order_relaxed);
 3313|      0|                atomic_store_explicit(&f->sr_cur.progress[1], FRAME_ERROR, memory_order_relaxed);
  ------------------
  |  |   35|      0|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
 3314|      0|            }
 3315|   632k|            dav1d_thread_picture_unref(&f->refp[i]);
 3316|   632k|        }
 3317|  1.92M|        dav1d_ref_dec(&f->ref_mvs_ref[i]);
 3318|  1.92M|    }
 3319|       |
 3320|   274k|    dav1d_picture_unref_internal(&f->cur);
 3321|   274k|    dav1d_thread_picture_unref(&f->sr_cur);
 3322|   274k|    dav1d_cdf_thread_unref(&f->in_cdf);
 3323|   274k|    if (f->frame_hdr && f->frame_hdr->refresh_context) {
  ------------------
  |  Branch (3323:9): [True: 237k, False: 37.0k]
  |  Branch (3323:25): [True: 58.5k, False: 179k]
  ------------------
 3324|  58.5k|        if (f->out_cdf.progress)
  ------------------
  |  Branch (3324:13): [True: 53.8k, False: 4.72k]
  ------------------
 3325|  58.5k|            atomic_store_explicit(f->out_cdf.progress, retval == 0 ? 1 : TILE_ERROR,
  ------------------
  |  |   36|  95.0k|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (3325:56): [True: 12.7k, False: 41.1k]
  ------------------
 3326|  53.8k|                                  memory_order_release);
 3327|  58.5k|        dav1d_cdf_thread_unref(&f->out_cdf);
 3328|  58.5k|    }
 3329|   274k|    dav1d_ref_dec(&f->cur_segmap_ref);
 3330|   274k|    dav1d_ref_dec(&f->prev_segmap_ref);
 3331|   274k|    dav1d_ref_dec(&f->mvs_ref);
 3332|   274k|    dav1d_ref_dec(&f->seq_hdr_ref);
 3333|   274k|    dav1d_ref_dec(&f->frame_hdr_ref);
 3334|       |
 3335|   491k|    for (int i = 0; i < f->n_tile_data; i++)
  ------------------
  |  Branch (3335:21): [True: 216k, False: 274k]
  ------------------
 3336|   216k|        dav1d_data_unref_internal(&f->tile[i].data);
 3337|   274k|    f->task_thread.retval = retval;
 3338|   274k|}
dav1d_submit_frame:
 3382|   219k|int dav1d_submit_frame(Dav1dContext *const c) {
 3383|   219k|    Dav1dFrameContext *f;
 3384|   219k|    int res = -1;
 3385|       |
 3386|       |    // wait for c->out_delayed[next] and move into c->out if visible
 3387|   219k|    Dav1dThreadPicture *out_delayed;
 3388|   219k|    if (c->n_fc > 1) {
  ------------------
  |  Branch (3388:9): [True: 219k, False: 0]
  ------------------
 3389|   219k|        pthread_mutex_lock(&c->task_thread.lock);
 3390|   219k|        const unsigned next = c->frame_thread.next++;
 3391|   219k|        if (c->frame_thread.next == c->n_fc)
  ------------------
  |  Branch (3391:13): [True: 50.4k, False: 169k]
  ------------------
 3392|  50.4k|            c->frame_thread.next = 0;
 3393|       |
 3394|   219k|        f = &c->fc[next];
 3395|   311k|        while (f->n_tile_data > 0)
  ------------------
  |  Branch (3395:16): [True: 91.9k, False: 219k]
  ------------------
 3396|  91.9k|            pthread_cond_wait(&f->task_thread.cond,
 3397|  91.9k|                              &c->task_thread.lock);
 3398|   219k|        out_delayed = &c->frame_thread.out_delayed[next];
 3399|   219k|        if (out_delayed->p.data[0] ||
  ------------------
  |  Branch (3399:13): [True: 194k, False: 25.7k]
  ------------------
 3400|   219k|            atomic_load_explicit(&f->task_thread.error, memory_order_relaxed))
  ------------------
  |  Branch (3400:13): [True: 2.42k, False: 23.2k]
  ------------------
 3401|   196k|        {
 3402|   196k|            unsigned first = atomic_load_explicit(&c->task_thread.first, memory_order_relaxed);
 3403|   196k|            if (first + 1U < c->n_fc)
  ------------------
  |  Branch (3403:17): [True: 147k, False: 48.6k]
  ------------------
 3404|   196k|                atomic_fetch_add_explicit(&c->task_thread.first, 1U, memory_order_relaxed);
 3405|  48.6k|            else
 3406|   196k|                atomic_store_explicit(&c->task_thread.first, 0, memory_order_relaxed);
 3407|   196k|            atomic_compare_exchange_strong_explicit(&c->task_thread.reset_task_cur,
 3408|   196k|                                                    &first, UINT_MAX,
 3409|   196k|                                                    memory_order_relaxed,
 3410|   196k|                                                    memory_order_relaxed);
 3411|   196k|            if (c->task_thread.cur && c->task_thread.cur < c->n_fc)
  ------------------
  |  Branch (3411:17): [True: 192k, False: 3.76k]
  |  Branch (3411:39): [True: 114k, False: 78.3k]
  ------------------
 3412|   114k|                c->task_thread.cur--;
 3413|   196k|        }
 3414|   219k|        const int error = f->task_thread.retval;
 3415|   219k|        if (error) {
  ------------------
  |  Branch (3415:13): [True: 145k, False: 74.5k]
  ------------------
 3416|   145k|            f->task_thread.retval = 0;
 3417|   145k|            c->cached_error = error;
 3418|   145k|            dav1d_data_props_copy(&c->cached_error_props, &out_delayed->p.m);
 3419|   145k|            dav1d_thread_picture_unref(out_delayed);
 3420|   145k|        } else if (out_delayed->p.data[0]) {
  ------------------
  |  Branch (3420:20): [True: 48.8k, False: 25.7k]
  ------------------
 3421|  48.8k|            const unsigned progress = atomic_load_explicit(&out_delayed->progress[1],
 3422|  48.8k|                                                           memory_order_relaxed);
 3423|  48.8k|            if ((out_delayed->visible || c->output_invisible_frames) &&
  ------------------
  |  Branch (3423:18): [True: 33.1k, False: 15.6k]
  |  Branch (3423:42): [True: 0, False: 15.6k]
  ------------------
 3424|  33.1k|                progress != FRAME_ERROR)
  ------------------
  |  |   35|  33.1k|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  |  Branch (3424:17): [True: 28.8k, False: 4.31k]
  ------------------
 3425|  28.8k|            {
 3426|  28.8k|                dav1d_thread_picture_ref(&c->out, out_delayed);
 3427|  28.8k|                c->event_flags |= dav1d_picture_get_event_flags(out_delayed);
 3428|  28.8k|            }
 3429|  48.8k|            dav1d_thread_picture_unref(out_delayed);
 3430|  48.8k|        }
 3431|   219k|    } else {
 3432|      0|        f = c->fc;
 3433|      0|    }
 3434|       |
 3435|   219k|    f->seq_hdr = c->seq_hdr;
 3436|   219k|    f->seq_hdr_ref = c->seq_hdr_ref;
 3437|   219k|    dav1d_ref_inc(f->seq_hdr_ref);
 3438|   219k|    f->frame_hdr = c->frame_hdr;
 3439|   219k|    f->frame_hdr_ref = c->frame_hdr_ref;
 3440|   219k|    c->frame_hdr = NULL;
 3441|   219k|    c->frame_hdr_ref = NULL;
 3442|   219k|    f->dsp = &c->dsp[f->seq_hdr->hbd];
 3443|       |
 3444|   219k|    const int bpc = 8 + 2 * f->seq_hdr->hbd;
 3445|       |
 3446|   219k|    if (!f->dsp->ipred.intra_pred[DC_PRED]) {
  ------------------
  |  Branch (3446:9): [True: 13.5k, False: 206k]
  ------------------
 3447|  13.5k|        Dav1dDSPContext *const dsp = &c->dsp[f->seq_hdr->hbd];
 3448|       |
 3449|  13.5k|        switch (bpc) {
 3450|      0|#define assign_bitdepth_case(bd) \
 3451|      0|            dav1d_cdef_dsp_init_##bd##bpc(&dsp->cdef); \
 3452|      0|            dav1d_intra_pred_dsp_init_##bd##bpc(&dsp->ipred); \
 3453|      0|            dav1d_itx_dsp_init_##bd##bpc(&dsp->itx, bpc); \
 3454|      0|            dav1d_loop_filter_dsp_init_##bd##bpc(&dsp->lf); \
 3455|      0|            dav1d_loop_restoration_dsp_init_##bd##bpc(&dsp->lr, bpc); \
 3456|      0|            dav1d_mc_dsp_init_##bd##bpc(&dsp->mc); \
 3457|      0|            dav1d_film_grain_dsp_init_##bd##bpc(&dsp->fg); \
 3458|      0|            break
 3459|      0|#if CONFIG_8BPC
 3460|  5.08k|        case 8:
  ------------------
  |  Branch (3460:9): [True: 5.08k, False: 8.47k]
  ------------------
 3461|  5.08k|            assign_bitdepth_case(8);
  ------------------
  |  | 3451|  5.08k|            dav1d_cdef_dsp_init_##bd##bpc(&dsp->cdef); \
  |  | 3452|  5.08k|            dav1d_intra_pred_dsp_init_##bd##bpc(&dsp->ipred); \
  |  | 3453|  5.08k|            dav1d_itx_dsp_init_##bd##bpc(&dsp->itx, bpc); \
  |  | 3454|  5.08k|            dav1d_loop_filter_dsp_init_##bd##bpc(&dsp->lf); \
  |  | 3455|  5.08k|            dav1d_loop_restoration_dsp_init_##bd##bpc(&dsp->lr, bpc); \
  |  | 3456|  5.08k|            dav1d_mc_dsp_init_##bd##bpc(&dsp->mc); \
  |  | 3457|  5.08k|            dav1d_film_grain_dsp_init_##bd##bpc(&dsp->fg); \
  |  | 3458|  5.08k|            break
  ------------------
 3462|      0|#endif
 3463|      0|#if CONFIG_16BPC
 3464|  3.41k|        case 10:
  ------------------
  |  Branch (3464:9): [True: 3.41k, False: 10.1k]
  ------------------
 3465|  8.47k|        case 12:
  ------------------
  |  Branch (3465:9): [True: 5.05k, False: 8.49k]
  ------------------
 3466|  8.47k|            assign_bitdepth_case(16);
  ------------------
  |  | 3451|  8.47k|            dav1d_cdef_dsp_init_##bd##bpc(&dsp->cdef); \
  |  | 3452|  8.47k|            dav1d_intra_pred_dsp_init_##bd##bpc(&dsp->ipred); \
  |  | 3453|  8.47k|            dav1d_itx_dsp_init_##bd##bpc(&dsp->itx, bpc); \
  |  | 3454|  8.47k|            dav1d_loop_filter_dsp_init_##bd##bpc(&dsp->lf); \
  |  | 3455|  8.47k|            dav1d_loop_restoration_dsp_init_##bd##bpc(&dsp->lr, bpc); \
  |  | 3456|  8.47k|            dav1d_mc_dsp_init_##bd##bpc(&dsp->mc); \
  |  | 3457|  8.47k|            dav1d_film_grain_dsp_init_##bd##bpc(&dsp->fg); \
  |  | 3458|  8.47k|            break
  ------------------
 3467|      0|#endif
 3468|      0|#undef assign_bitdepth_case
 3469|      0|        default:
  ------------------
  |  Branch (3469:9): [True: 0, False: 13.5k]
  ------------------
 3470|      0|            dav1d_log(c, "Compiled without support for %d-bit decoding\n",
  ------------------
  |  |   44|      0|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3471|      0|                    8 + 2 * f->seq_hdr->hbd);
 3472|      0|            res = DAV1D_ERR(ENOPROTOOPT);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3473|      0|            goto error;
 3474|  13.5k|        }
 3475|  13.5k|    }
 3476|       |
 3477|   219k|#define assign_bitdepth_case(bd) \
 3478|   219k|        f->bd_fn.recon_b_inter = dav1d_recon_b_inter_##bd##bpc; \
 3479|   219k|        f->bd_fn.recon_b_intra = dav1d_recon_b_intra_##bd##bpc; \
 3480|   219k|        f->bd_fn.filter_sbrow = dav1d_filter_sbrow_##bd##bpc; \
 3481|   219k|        f->bd_fn.filter_sbrow_deblock_cols = dav1d_filter_sbrow_deblock_cols_##bd##bpc; \
 3482|   219k|        f->bd_fn.filter_sbrow_deblock_rows = dav1d_filter_sbrow_deblock_rows_##bd##bpc; \
 3483|   219k|        f->bd_fn.filter_sbrow_cdef = dav1d_filter_sbrow_cdef_##bd##bpc; \
 3484|   219k|        f->bd_fn.filter_sbrow_resize = dav1d_filter_sbrow_resize_##bd##bpc; \
 3485|   219k|        f->bd_fn.filter_sbrow_lr = dav1d_filter_sbrow_lr_##bd##bpc; \
 3486|   219k|        f->bd_fn.backup_ipred_edge = dav1d_backup_ipred_edge_##bd##bpc; \
 3487|   219k|        f->bd_fn.read_coef_blocks = dav1d_read_coef_blocks_##bd##bpc; \
 3488|   219k|        f->bd_fn.copy_pal_block_y = dav1d_copy_pal_block_y_##bd##bpc; \
 3489|   219k|        f->bd_fn.copy_pal_block_uv = dav1d_copy_pal_block_uv_##bd##bpc; \
 3490|   219k|        f->bd_fn.read_pal_plane = dav1d_read_pal_plane_##bd##bpc; \
 3491|   219k|        f->bd_fn.read_pal_uv = dav1d_read_pal_uv_##bd##bpc
 3492|   219k|    if (!f->seq_hdr->hbd) {
  ------------------
  |  Branch (3492:9): [True: 89.7k, False: 130k]
  ------------------
 3493|  89.7k|#if CONFIG_8BPC
 3494|  89.7k|        assign_bitdepth_case(8);
  ------------------
  |  | 3478|  89.7k|        f->bd_fn.recon_b_inter = dav1d_recon_b_inter_##bd##bpc; \
  |  | 3479|  89.7k|        f->bd_fn.recon_b_intra = dav1d_recon_b_intra_##bd##bpc; \
  |  | 3480|  89.7k|        f->bd_fn.filter_sbrow = dav1d_filter_sbrow_##bd##bpc; \
  |  | 3481|  89.7k|        f->bd_fn.filter_sbrow_deblock_cols = dav1d_filter_sbrow_deblock_cols_##bd##bpc; \
  |  | 3482|  89.7k|        f->bd_fn.filter_sbrow_deblock_rows = dav1d_filter_sbrow_deblock_rows_##bd##bpc; \
  |  | 3483|  89.7k|        f->bd_fn.filter_sbrow_cdef = dav1d_filter_sbrow_cdef_##bd##bpc; \
  |  | 3484|  89.7k|        f->bd_fn.filter_sbrow_resize = dav1d_filter_sbrow_resize_##bd##bpc; \
  |  | 3485|  89.7k|        f->bd_fn.filter_sbrow_lr = dav1d_filter_sbrow_lr_##bd##bpc; \
  |  | 3486|  89.7k|        f->bd_fn.backup_ipred_edge = dav1d_backup_ipred_edge_##bd##bpc; \
  |  | 3487|  89.7k|        f->bd_fn.read_coef_blocks = dav1d_read_coef_blocks_##bd##bpc; \
  |  | 3488|  89.7k|        f->bd_fn.copy_pal_block_y = dav1d_copy_pal_block_y_##bd##bpc; \
  |  | 3489|  89.7k|        f->bd_fn.copy_pal_block_uv = dav1d_copy_pal_block_uv_##bd##bpc; \
  |  | 3490|  89.7k|        f->bd_fn.read_pal_plane = dav1d_read_pal_plane_##bd##bpc; \
  |  | 3491|  89.7k|        f->bd_fn.read_pal_uv = dav1d_read_pal_uv_##bd##bpc
  ------------------
 3495|  89.7k|#endif
 3496|   130k|    } else {
 3497|   130k|#if CONFIG_16BPC
 3498|   130k|        assign_bitdepth_case(16);
  ------------------
  |  | 3478|   130k|        f->bd_fn.recon_b_inter = dav1d_recon_b_inter_##bd##bpc; \
  |  | 3479|   130k|        f->bd_fn.recon_b_intra = dav1d_recon_b_intra_##bd##bpc; \
  |  | 3480|   130k|        f->bd_fn.filter_sbrow = dav1d_filter_sbrow_##bd##bpc; \
  |  | 3481|   130k|        f->bd_fn.filter_sbrow_deblock_cols = dav1d_filter_sbrow_deblock_cols_##bd##bpc; \
  |  | 3482|   130k|        f->bd_fn.filter_sbrow_deblock_rows = dav1d_filter_sbrow_deblock_rows_##bd##bpc; \
  |  | 3483|   130k|        f->bd_fn.filter_sbrow_cdef = dav1d_filter_sbrow_cdef_##bd##bpc; \
  |  | 3484|   130k|        f->bd_fn.filter_sbrow_resize = dav1d_filter_sbrow_resize_##bd##bpc; \
  |  | 3485|   130k|        f->bd_fn.filter_sbrow_lr = dav1d_filter_sbrow_lr_##bd##bpc; \
  |  | 3486|   130k|        f->bd_fn.backup_ipred_edge = dav1d_backup_ipred_edge_##bd##bpc; \
  |  | 3487|   130k|        f->bd_fn.read_coef_blocks = dav1d_read_coef_blocks_##bd##bpc; \
  |  | 3488|   130k|        f->bd_fn.copy_pal_block_y = dav1d_copy_pal_block_y_##bd##bpc; \
  |  | 3489|   130k|        f->bd_fn.copy_pal_block_uv = dav1d_copy_pal_block_uv_##bd##bpc; \
  |  | 3490|   130k|        f->bd_fn.read_pal_plane = dav1d_read_pal_plane_##bd##bpc; \
  |  | 3491|   130k|        f->bd_fn.read_pal_uv = dav1d_read_pal_uv_##bd##bpc
  ------------------
 3499|   130k|#endif
 3500|   130k|    }
 3501|   219k|#undef assign_bitdepth_case
 3502|       |
 3503|   219k|    int ref_coded_width[7];
 3504|   219k|    if (IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|   219k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 93.6k, False: 126k]
  |  |  ------------------
  ------------------
 3505|  93.6k|        if (f->frame_hdr->primary_ref_frame != DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|  93.6k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (3505:13): [True: 77.9k, False: 15.7k]
  ------------------
 3506|  77.9k|            const int pri_ref = f->frame_hdr->refidx[f->frame_hdr->primary_ref_frame];
 3507|  77.9k|            if (!c->refs[pri_ref].p.p.data[0]) {
  ------------------
  |  Branch (3507:17): [True: 520, False: 77.4k]
  ------------------
 3508|    520|                res = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|    520|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3509|    520|                goto error;
 3510|    520|            }
 3511|  77.9k|        }
 3512|   727k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3512:25): [True: 637k, False: 90.3k]
  ------------------
 3513|   637k|            const int refidx = f->frame_hdr->refidx[i];
 3514|   637k|            if (!c->refs[refidx].p.p.data[0] ||
  ------------------
  |  Branch (3514:17): [True: 665, False: 636k]
  ------------------
 3515|   636k|                f->frame_hdr->width[0] * 2 < c->refs[refidx].p.p.p.w ||
  ------------------
  |  Branch (3515:17): [True: 752, False: 636k]
  ------------------
 3516|   636k|                f->frame_hdr->height * 2 < c->refs[refidx].p.p.p.h ||
  ------------------
  |  Branch (3516:17): [True: 233, False: 635k]
  ------------------
 3517|   635k|                f->frame_hdr->width[0] > c->refs[refidx].p.p.p.w * 16 ||
  ------------------
  |  Branch (3517:17): [True: 257, False: 635k]
  ------------------
 3518|   635k|                f->frame_hdr->height > c->refs[refidx].p.p.p.h * 16 ||
  ------------------
  |  Branch (3518:17): [True: 916, False: 634k]
  ------------------
 3519|   634k|                f->seq_hdr->layout != c->refs[refidx].p.p.p.layout ||
  ------------------
  |  Branch (3519:17): [True: 0, False: 634k]
  ------------------
 3520|   634k|                bpc != c->refs[refidx].p.p.p.bpc)
  ------------------
  |  Branch (3520:17): [True: 0, False: 634k]
  ------------------
 3521|  2.82k|            {
 3522|  5.16k|                for (int j = 0; j < i; j++)
  ------------------
  |  Branch (3522:33): [True: 2.34k, False: 2.82k]
  ------------------
 3523|  2.34k|                    dav1d_thread_picture_unref(&f->refp[j]);
 3524|  2.82k|                res = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|  2.82k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3525|  2.82k|                goto error;
 3526|  2.82k|            }
 3527|   634k|            dav1d_thread_picture_ref(&f->refp[i], &c->refs[refidx].p);
 3528|   634k|            ref_coded_width[i] = c->refs[refidx].p.p.frame_hdr->width[0];
 3529|   634k|            if (f->frame_hdr->width[0] != c->refs[refidx].p.p.p.w ||
  ------------------
  |  Branch (3529:17): [True: 186k, False: 448k]
  ------------------
 3530|   448k|                f->frame_hdr->height != c->refs[refidx].p.p.p.h)
  ------------------
  |  Branch (3530:17): [True: 3.71k, False: 444k]
  ------------------
 3531|   190k|            {
 3532|   190k|#define scale_fac(ref_sz, this_sz) \
 3533|   190k|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
 3534|   190k|                f->svc[i][0].scale = scale_fac(c->refs[refidx].p.p.p.w,
  ------------------
  |  | 3533|   190k|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
  ------------------
 3535|   190k|                                               f->frame_hdr->width[0]);
 3536|   190k|                f->svc[i][1].scale = scale_fac(c->refs[refidx].p.p.p.h,
  ------------------
  |  | 3533|   190k|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
  ------------------
 3537|   190k|                                               f->frame_hdr->height);
 3538|   190k|                f->svc[i][0].step = (f->svc[i][0].scale + 8) >> 4;
 3539|   190k|                f->svc[i][1].step = (f->svc[i][1].scale + 8) >> 4;
 3540|   444k|            } else {
 3541|   444k|                f->svc[i][0].scale = f->svc[i][1].scale = 0;
 3542|   444k|            }
 3543|   634k|            f->gmv_warp_allowed[i] = f->frame_hdr->gmv[i].type > DAV1D_WM_TYPE_TRANSLATION &&
  ------------------
  |  Branch (3543:38): [True: 30.2k, False: 604k]
  ------------------
 3544|  30.2k|                                     !f->frame_hdr->force_integer_mv &&
  ------------------
  |  Branch (3544:38): [True: 29.3k, False: 922]
  ------------------
 3545|  29.3k|                                     !dav1d_get_shear_params(&f->frame_hdr->gmv[i]) &&
  ------------------
  |  Branch (3545:38): [True: 27.4k, False: 1.91k]
  ------------------
 3546|  27.4k|                                     !f->svc[i][0].scale;
  ------------------
  |  Branch (3546:38): [True: 17.0k, False: 10.4k]
  ------------------
 3547|   634k|        }
 3548|  93.1k|    }
 3549|       |
 3550|       |    // setup entropy
 3551|   216k|    if (f->frame_hdr->primary_ref_frame == DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|   216k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (3551:9): [True: 140k, False: 75.5k]
  ------------------
 3552|   140k|        dav1d_cdf_thread_init_static(&f->in_cdf, f->frame_hdr->quant.yac);
 3553|   140k|    } else {
 3554|  75.5k|        const int pri_ref = f->frame_hdr->refidx[f->frame_hdr->primary_ref_frame];
 3555|  75.5k|        dav1d_cdf_thread_ref(&f->in_cdf, &c->cdf[pri_ref]);
 3556|  75.5k|    }
 3557|   216k|    if (f->frame_hdr->refresh_context) {
  ------------------
  |  Branch (3557:9): [True: 53.8k, False: 162k]
  ------------------
 3558|  53.8k|        res = dav1d_cdf_thread_alloc(c, &f->out_cdf, c->n_fc > 1);
 3559|  53.8k|        if (res < 0) goto error;
  ------------------
  |  Branch (3559:13): [True: 0, False: 53.8k]
  ------------------
 3560|  53.8k|    }
 3561|       |
 3562|       |    // FIXME qsort so tiles are in order (for frame threading)
 3563|   216k|    if (f->n_tile_data_alloc < c->n_tile_data) {
  ------------------
  |  Branch (3563:9): [True: 23.1k, False: 193k]
  ------------------
 3564|  23.1k|        dav1d_free(f->tile);
  ------------------
  |  |  135|  23.1k|#define dav1d_free(ptr) free(ptr)
  ------------------
 3565|  23.1k|        assert(c->n_tile_data < INT_MAX / (int)sizeof(*f->tile));
  ------------------
  |  Branch (3565:9): [True: 23.1k, False: 0]
  ------------------
 3566|  23.1k|        f->tile = dav1d_malloc(ALLOC_TILE, c->n_tile_data * sizeof(*f->tile));
  ------------------
  |  |  132|  23.1k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3567|  23.1k|        if (!f->tile) {
  ------------------
  |  Branch (3567:13): [True: 0, False: 23.1k]
  ------------------
 3568|      0|            f->n_tile_data_alloc = f->n_tile_data = 0;
 3569|      0|            res = DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3570|      0|            goto error;
 3571|      0|        }
 3572|  23.1k|        f->n_tile_data_alloc = c->n_tile_data;
 3573|  23.1k|    }
 3574|   216k|    memcpy(f->tile, c->tile, c->n_tile_data * sizeof(*f->tile));
 3575|   216k|    memset(c->tile, 0, c->n_tile_data * sizeof(*c->tile));
 3576|   216k|    f->n_tile_data = c->n_tile_data;
 3577|   216k|    c->n_tile_data = 0;
 3578|       |
 3579|       |    // allocate frame
 3580|   216k|    res = dav1d_thread_picture_alloc(c, f, bpc);
 3581|   216k|    if (res < 0) goto error;
  ------------------
  |  Branch (3581:9): [True: 0, False: 216k]
  ------------------
 3582|       |
 3583|   216k|    if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (3583:9): [True: 37.9k, False: 178k]
  ------------------
 3584|  37.9k|        res = dav1d_picture_alloc_copy(c, &f->cur, f->frame_hdr->width[0], &f->sr_cur.p);
 3585|  37.9k|        if (res < 0) goto error;
  ------------------
  |  Branch (3585:13): [True: 0, False: 37.9k]
  ------------------
 3586|   178k|    } else {
 3587|   178k|        dav1d_picture_ref(&f->cur, &f->sr_cur.p);
 3588|   178k|    }
 3589|       |
 3590|   216k|    if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (3590:9): [True: 37.9k, False: 178k]
  ------------------
 3591|  37.9k|        f->resize_step[0] = scale_fac(f->cur.p.w, f->sr_cur.p.p.w);
  ------------------
  |  | 3533|  37.9k|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
  ------------------
 3592|  37.9k|        const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 3593|  37.9k|        const int in_cw = (f->cur.p.w + ss_hor) >> ss_hor;
 3594|  37.9k|        const int out_cw = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
 3595|  37.9k|        f->resize_step[1] = scale_fac(in_cw, out_cw);
  ------------------
  |  | 3533|  37.9k|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
  ------------------
 3596|  37.9k|#undef scale_fac
 3597|  37.9k|        f->resize_start[0] = get_upscale_x0(f->cur.p.w, f->sr_cur.p.p.w, f->resize_step[0]);
 3598|  37.9k|        f->resize_start[1] = get_upscale_x0(in_cw, out_cw, f->resize_step[1]);
 3599|  37.9k|    }
 3600|       |
 3601|       |    // move f->cur into output queue
 3602|   216k|    if (c->n_fc == 1) {
  ------------------
  |  Branch (3602:9): [True: 0, False: 216k]
  ------------------
 3603|      0|        if (f->frame_hdr->show_frame || c->output_invisible_frames) {
  ------------------
  |  Branch (3603:13): [True: 0, False: 0]
  |  Branch (3603:41): [True: 0, False: 0]
  ------------------
 3604|      0|            dav1d_thread_picture_ref(&c->out, &f->sr_cur);
 3605|      0|            c->event_flags |= dav1d_picture_get_event_flags(&f->sr_cur);
 3606|      0|        }
 3607|   216k|    } else {
 3608|   216k|        dav1d_thread_picture_ref(out_delayed, &f->sr_cur);
 3609|   216k|    }
 3610|       |
 3611|   216k|    f->w4 = (f->frame_hdr->width[0] + 3) >> 2;
 3612|   216k|    f->h4 = (f->frame_hdr->height + 3) >> 2;
 3613|   216k|    f->bw = ((f->frame_hdr->width[0] + 7) >> 3) << 1;
 3614|   216k|    f->bh = ((f->frame_hdr->height + 7) >> 3) << 1;
 3615|   216k|    f->sb128w = (f->bw + 31) >> 5;
 3616|   216k|    f->sb128h = (f->bh + 31) >> 5;
 3617|   216k|    f->sb_shift = 4 + f->seq_hdr->sb128;
 3618|   216k|    f->sb_step = 16 << f->seq_hdr->sb128;
 3619|   216k|    f->sbh = (f->bh + f->sb_step - 1) >> f->sb_shift;
 3620|   216k|    f->b4_stride = (f->bw + 31) & ~31;
 3621|   216k|    f->bitdepth_max = (1 << f->cur.p.bpc) - 1;
 3622|   216k|    atomic_init(&f->task_thread.error, 0);
 3623|   216k|    const int uses_2pass = c->n_fc > 1;
 3624|   216k|    const int cols = f->frame_hdr->tiling.cols;
 3625|   216k|    const int rows = f->frame_hdr->tiling.rows;
 3626|   216k|    f->task_thread.task_counter = (cols * rows + f->sbh) << uses_2pass;
 3627|       |
 3628|       |    // ref_mvs
 3629|   216k|    if (IS_INTER_OR_SWITCH(f->frame_hdr) || f->frame_hdr->allow_intrabc) {
  ------------------
  |  |   36|   432k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 90.3k, False: 126k]
  |  |  ------------------
  ------------------
  |  Branch (3629:45): [True: 91.0k, False: 35.0k]
  ------------------
 3630|   181k|        f->mvs_ref = dav1d_ref_create_using_pool(c->refmvs_pool,
 3631|   181k|            sizeof(*f->mvs) * f->sb128h * 16 * (f->b4_stride >> 1));
 3632|   181k|        if (!f->mvs_ref) {
  ------------------
  |  Branch (3632:13): [True: 0, False: 181k]
  ------------------
 3633|      0|            res = DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3634|      0|            goto error;
 3635|      0|        }
 3636|   181k|        f->mvs = f->mvs_ref->data;
 3637|   181k|        if (!f->frame_hdr->allow_intrabc) {
  ------------------
  |  Branch (3637:13): [True: 90.3k, False: 91.0k]
  ------------------
 3638|   722k|            for (int i = 0; i < 7; i++)
  ------------------
  |  Branch (3638:29): [True: 632k, False: 90.3k]
  ------------------
 3639|   632k|                f->refpoc[i] = f->refp[i].p.frame_hdr->frame_offset;
 3640|  91.0k|        } else {
 3641|  91.0k|            memset(f->refpoc, 0, sizeof(f->refpoc));
 3642|  91.0k|        }
 3643|   181k|        if (f->frame_hdr->use_ref_frame_mvs) {
  ------------------
  |  Branch (3643:13): [True: 54.7k, False: 126k]
  ------------------
 3644|   438k|            for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3644:29): [True: 383k, False: 54.7k]
  ------------------
 3645|   383k|                const int refidx = f->frame_hdr->refidx[i];
 3646|   383k|                const int ref_w = ((ref_coded_width[i] + 7) >> 3) << 1;
 3647|   383k|                const int ref_h = ((f->refp[i].p.p.h + 7) >> 3) << 1;
 3648|   383k|                if (c->refs[refidx].refmvs != NULL &&
  ------------------
  |  Branch (3648:21): [True: 306k, False: 77.4k]
  ------------------
 3649|   306k|                    ref_w == f->bw && ref_h == f->bh)
  ------------------
  |  Branch (3649:21): [True: 285k, False: 20.1k]
  |  Branch (3649:39): [True: 285k, False: 559]
  ------------------
 3650|   285k|                {
 3651|   285k|                    f->ref_mvs_ref[i] = c->refs[refidx].refmvs;
 3652|   285k|                    dav1d_ref_inc(f->ref_mvs_ref[i]);
 3653|   285k|                    f->ref_mvs[i] = c->refs[refidx].refmvs->data;
 3654|   285k|                } else {
 3655|  98.2k|                    f->ref_mvs[i] = NULL;
 3656|  98.2k|                    f->ref_mvs_ref[i] = NULL;
 3657|  98.2k|                }
 3658|   383k|                memcpy(f->refrefpoc[i], c->refs[refidx].refpoc,
 3659|   383k|                       sizeof(*f->refrefpoc));
 3660|   383k|            }
 3661|   126k|        } else {
 3662|   126k|            memset(f->ref_mvs_ref, 0, sizeof(f->ref_mvs_ref));
 3663|   126k|        }
 3664|   181k|    } else {
 3665|  35.0k|        f->mvs_ref = NULL;
 3666|  35.0k|        memset(f->ref_mvs_ref, 0, sizeof(f->ref_mvs_ref));
 3667|  35.0k|    }
 3668|       |
 3669|       |    // segmap
 3670|   216k|    if (f->frame_hdr->segmentation.enabled) {
  ------------------
  |  Branch (3670:9): [True: 30.6k, False: 185k]
  ------------------
 3671|       |        // By default, the previous segmentation map is not initialised.
 3672|  30.6k|        f->prev_segmap_ref = NULL;
 3673|  30.6k|        f->prev_segmap = NULL;
 3674|       |
 3675|       |        // We might need a previous frame's segmentation map. This
 3676|       |        // happens if there is either no update or a temporal update.
 3677|  30.6k|        if (f->frame_hdr->segmentation.temporal || !f->frame_hdr->segmentation.update_map) {
  ------------------
  |  Branch (3677:13): [True: 18.8k, False: 11.7k]
  |  Branch (3677:52): [True: 7.85k, False: 3.92k]
  ------------------
 3678|  26.6k|            const int pri_ref = f->frame_hdr->primary_ref_frame;
 3679|  26.6k|            assert(pri_ref != DAV1D_PRIMARY_REF_NONE);
  ------------------
  |  Branch (3679:13): [True: 26.6k, False: 0]
  ------------------
 3680|  26.6k|            const int ref_w = ((ref_coded_width[pri_ref] + 7) >> 3) << 1;
 3681|  26.6k|            const int ref_h = ((f->refp[pri_ref].p.p.h + 7) >> 3) << 1;
 3682|  26.6k|            if (ref_w == f->bw && ref_h == f->bh) {
  ------------------
  |  Branch (3682:17): [True: 18.7k, False: 7.92k]
  |  Branch (3682:35): [True: 17.3k, False: 1.42k]
  ------------------
 3683|  17.3k|                f->prev_segmap_ref = c->refs[f->frame_hdr->refidx[pri_ref]].segmap;
 3684|  17.3k|                if (f->prev_segmap_ref) {
  ------------------
  |  Branch (3684:21): [True: 16.2k, False: 1.10k]
  ------------------
 3685|  16.2k|                    dav1d_ref_inc(f->prev_segmap_ref);
 3686|  16.2k|                    f->prev_segmap = f->prev_segmap_ref->data;
 3687|  16.2k|                }
 3688|  17.3k|            }
 3689|  26.6k|        }
 3690|       |
 3691|  30.6k|        if (f->frame_hdr->segmentation.update_map) {
  ------------------
  |  Branch (3691:13): [True: 22.7k, False: 7.85k]
  ------------------
 3692|       |            // We're updating an existing map, but need somewhere to
 3693|       |            // put the new values. Allocate them here (the data
 3694|       |            // actually gets set elsewhere)
 3695|  22.7k|            f->cur_segmap_ref = dav1d_ref_create_using_pool(c->segmap_pool,
 3696|  22.7k|                sizeof(*f->cur_segmap) * f->b4_stride * 32 * f->sb128h);
 3697|  22.7k|            if (!f->cur_segmap_ref) {
  ------------------
  |  Branch (3697:17): [True: 0, False: 22.7k]
  ------------------
 3698|      0|                dav1d_ref_dec(&f->prev_segmap_ref);
 3699|      0|                res = DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3700|      0|                goto error;
 3701|      0|            }
 3702|  22.7k|            f->cur_segmap = f->cur_segmap_ref->data;
 3703|  22.7k|        } else if (f->prev_segmap_ref) {
  ------------------
  |  Branch (3703:20): [True: 6.62k, False: 1.22k]
  ------------------
 3704|       |            // We're not updating an existing map, and we have a valid
 3705|       |            // reference. Use that.
 3706|  6.62k|            f->cur_segmap_ref = f->prev_segmap_ref;
 3707|  6.62k|            dav1d_ref_inc(f->cur_segmap_ref);
 3708|  6.62k|            f->cur_segmap = f->prev_segmap_ref->data;
 3709|  6.62k|        } else {
 3710|       |            // We need to make a new map. Allocate one here and zero it out.
 3711|  1.22k|            const size_t segmap_size = sizeof(*f->cur_segmap) * f->b4_stride * 32 * f->sb128h;
 3712|  1.22k|            f->cur_segmap_ref = dav1d_ref_create_using_pool(c->segmap_pool, segmap_size);
 3713|  1.22k|            if (!f->cur_segmap_ref) {
  ------------------
  |  Branch (3713:17): [True: 0, False: 1.22k]
  ------------------
 3714|      0|                res = DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3715|      0|                goto error;
 3716|      0|            }
 3717|  1.22k|            f->cur_segmap = f->cur_segmap_ref->data;
 3718|  1.22k|            memset(f->cur_segmap, 0, segmap_size);
 3719|  1.22k|        }
 3720|   185k|    } else {
 3721|   185k|        f->cur_segmap = NULL;
 3722|   185k|        f->cur_segmap_ref = NULL;
 3723|   185k|        f->prev_segmap_ref = NULL;
 3724|   185k|    }
 3725|       |
 3726|       |    // update references etc.
 3727|   216k|    const unsigned refresh_frame_flags = f->frame_hdr->refresh_frame_flags;
 3728|  1.94M|    for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (3728:21): [True: 1.73M, False: 216k]
  ------------------
 3729|  1.73M|        if (refresh_frame_flags & (1 << i)) {
  ------------------
  |  Branch (3729:13): [True: 1.34M, False: 386k]
  ------------------
 3730|  1.34M|            if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (3730:17): [True: 1.20M, False: 139k]
  ------------------
 3731|  1.20M|                dav1d_thread_picture_unref(&c->refs[i].p);
 3732|  1.34M|            dav1d_thread_picture_ref(&c->refs[i].p, &f->sr_cur);
 3733|       |
 3734|  1.34M|            dav1d_cdf_thread_unref(&c->cdf[i]);
 3735|  1.34M|            if (f->frame_hdr->refresh_context) {
  ------------------
  |  Branch (3735:17): [True: 204k, False: 1.14M]
  ------------------
 3736|   204k|                dav1d_cdf_thread_ref(&c->cdf[i], &f->out_cdf);
 3737|  1.14M|            } else {
 3738|  1.14M|                dav1d_cdf_thread_ref(&c->cdf[i], &f->in_cdf);
 3739|  1.14M|            }
 3740|       |
 3741|  1.34M|            dav1d_ref_dec(&c->refs[i].segmap);
 3742|  1.34M|            c->refs[i].segmap = f->cur_segmap_ref;
 3743|  1.34M|            if (f->cur_segmap_ref)
  ------------------
  |  Branch (3743:17): [True: 161k, False: 1.18M]
  ------------------
 3744|   161k|                dav1d_ref_inc(f->cur_segmap_ref);
 3745|  1.34M|            dav1d_ref_dec(&c->refs[i].refmvs);
 3746|  1.34M|            if (!f->frame_hdr->allow_intrabc) {
  ------------------
  |  Branch (3746:17): [True: 616k, False: 728k]
  ------------------
 3747|   616k|                c->refs[i].refmvs = f->mvs_ref;
 3748|   616k|                if (f->mvs_ref)
  ------------------
  |  Branch (3748:21): [True: 345k, False: 270k]
  ------------------
 3749|   345k|                    dav1d_ref_inc(f->mvs_ref);
 3750|   616k|            }
 3751|  1.34M|            memcpy(c->refs[i].refpoc, f->refpoc, sizeof(f->refpoc));
 3752|  1.34M|        }
 3753|  1.73M|    }
 3754|       |
 3755|   216k|    if (c->n_fc == 1) {
  ------------------
  |  Branch (3755:9): [True: 0, False: 216k]
  ------------------
 3756|      0|        if ((res = dav1d_decode_frame(f)) < 0) {
  ------------------
  |  Branch (3756:13): [True: 0, False: 0]
  ------------------
 3757|      0|            dav1d_thread_picture_unref(&c->out);
 3758|      0|            for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (3758:29): [True: 0, False: 0]
  ------------------
 3759|      0|                if (refresh_frame_flags & (1 << i)) {
  ------------------
  |  Branch (3759:21): [True: 0, False: 0]
  ------------------
 3760|      0|                    if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (3760:25): [True: 0, False: 0]
  ------------------
 3761|      0|                        dav1d_thread_picture_unref(&c->refs[i].p);
 3762|      0|                    dav1d_cdf_thread_unref(&c->cdf[i]);
 3763|      0|                    dav1d_ref_dec(&c->refs[i].segmap);
 3764|      0|                    dav1d_ref_dec(&c->refs[i].refmvs);
 3765|      0|                }
 3766|      0|            }
 3767|      0|            goto error;
 3768|      0|        }
 3769|   216k|    } else {
 3770|   216k|        dav1d_task_frame_init(f);
 3771|   216k|        pthread_mutex_unlock(&c->task_thread.lock);
 3772|   216k|    }
 3773|       |
 3774|   216k|    return 0;
 3775|  3.34k|error:
 3776|  3.34k|    atomic_init(&f->task_thread.error, 1);
 3777|  3.34k|    dav1d_cdf_thread_unref(&f->in_cdf);
 3778|  3.34k|    if (f->frame_hdr->refresh_context)
  ------------------
  |  Branch (3778:9): [True: 2.94k, False: 395]
  ------------------
 3779|  2.94k|        dav1d_cdf_thread_unref(&f->out_cdf);
 3780|  26.7k|    for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3780:21): [True: 23.4k, False: 3.34k]
  ------------------
 3781|  23.4k|        if (f->refp[i].p.frame_hdr)
  ------------------
  |  Branch (3781:13): [True: 0, False: 23.4k]
  ------------------
 3782|      0|            dav1d_thread_picture_unref(&f->refp[i]);
 3783|  23.4k|        dav1d_ref_dec(&f->ref_mvs_ref[i]);
 3784|  23.4k|    }
 3785|  3.34k|    if (c->n_fc == 1)
  ------------------
  |  Branch (3785:9): [True: 0, False: 3.34k]
  ------------------
 3786|      0|        dav1d_thread_picture_unref(&c->out);
 3787|  3.34k|    else
 3788|  3.34k|        dav1d_thread_picture_unref(out_delayed);
 3789|  3.34k|    dav1d_picture_unref_internal(&f->cur);
 3790|  3.34k|    dav1d_thread_picture_unref(&f->sr_cur);
 3791|  3.34k|    dav1d_ref_dec(&f->mvs_ref);
 3792|  3.34k|    dav1d_ref_dec(&f->seq_hdr_ref);
 3793|  3.34k|    dav1d_ref_dec(&f->frame_hdr_ref);
 3794|  3.34k|    dav1d_data_props_copy(&c->cached_error_props, &c->in.m);
 3795|       |
 3796|  3.34k|    for (int i = 0; i < f->n_tile_data; i++)
  ------------------
  |  Branch (3796:21): [True: 0, False: 3.34k]
  ------------------
 3797|      0|        dav1d_data_unref_internal(&f->tile[i].data);
 3798|  3.34k|    f->n_tile_data = 0;
 3799|       |
 3800|  3.34k|    if (c->n_fc > 1)
  ------------------
  |  Branch (3800:9): [True: 3.34k, False: 0]
  ------------------
 3801|  3.34k|        pthread_mutex_unlock(&c->task_thread.lock);
 3802|       |
 3803|  3.34k|    return res;
 3804|   216k|}
decode.c:reset_context:
 2433|  11.6M|static void reset_context(BlockContext *const ctx, const int keyframe, const int pass) {
 2434|  11.6M|    memset(ctx->intra, keyframe, sizeof(ctx->intra));
 2435|  11.6M|    memset(ctx->uvmode, DC_PRED, sizeof(ctx->uvmode));
 2436|  11.6M|    if (keyframe)
  ------------------
  |  Branch (2436:9): [True: 2.30M, False: 9.29M]
  ------------------
 2437|  2.30M|        memset(ctx->mode, DC_PRED, sizeof(ctx->mode));
 2438|       |
 2439|  11.6M|    if (pass == 2) return;
  ------------------
  |  Branch (2439:9): [True: 5.77M, False: 5.83M]
  ------------------
 2440|       |
 2441|  5.83M|    memset(ctx->partition, 0, sizeof(ctx->partition));
 2442|  5.83M|    memset(ctx->skip, 0, sizeof(ctx->skip));
 2443|  5.83M|    memset(ctx->skip_mode, 0, sizeof(ctx->skip_mode));
 2444|  5.83M|    memset(ctx->tx_lpf_y, 2, sizeof(ctx->tx_lpf_y));
 2445|  5.83M|    memset(ctx->tx_lpf_uv, 1, sizeof(ctx->tx_lpf_uv));
 2446|  5.83M|    memset(ctx->tx_intra, -1, sizeof(ctx->tx_intra));
 2447|  5.83M|    memset(ctx->tx, TX_64X64, sizeof(ctx->tx));
 2448|  5.83M|    if (!keyframe) {
  ------------------
  |  Branch (2448:9): [True: 4.72M, False: 1.10M]
  ------------------
 2449|  4.72M|        memset(ctx->ref, -1, sizeof(ctx->ref));
 2450|  4.72M|        memset(ctx->comp_type, 0, sizeof(ctx->comp_type));
 2451|  4.72M|        memset(ctx->mode, NEARESTMV, sizeof(ctx->mode));
 2452|  4.72M|    }
 2453|  5.83M|    memset(ctx->lcoef, 0x40, sizeof(ctx->lcoef));
 2454|  5.83M|    memset(ctx->ccoef, 0x40, sizeof(ctx->ccoef));
 2455|  5.83M|    memset(ctx->filter, DAV1D_N_SWITCHABLE_FILTERS, sizeof(ctx->filter));
 2456|  5.83M|    memset(ctx->seg_pred, 0, sizeof(ctx->seg_pred));
 2457|  5.83M|    memset(ctx->pal_sz, 0, sizeof(ctx->pal_sz));
 2458|  5.83M|}
decode.c:decode_sb:
 2162|  19.8M|{
 2163|  19.8M|    const Dav1dFrameContext *const f = t->f;
 2164|  19.8M|    Dav1dTileState *const ts = t->ts;
 2165|  19.8M|    const int hsz = 16 >> bl;
 2166|  19.8M|    const int have_h_split = f->bw > t->bx + hsz;
 2167|  19.8M|    const int have_v_split = f->bh > t->by + hsz;
 2168|       |
 2169|  19.8M|    if (!have_h_split && !have_v_split) {
  ------------------
  |  Branch (2169:9): [True: 480k, False: 19.3M]
  |  Branch (2169:26): [True: 117k, False: 363k]
  ------------------
 2170|   117k|        assert(bl < BL_8X8);
  ------------------
  |  Branch (2170:9): [True: 117k, False: 10]
  ------------------
 2171|   117k|        return decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 0));
  ------------------
  |  |   51|   117k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
 2172|   117k|    }
 2173|       |
 2174|  19.7M|    uint16_t *pc;
 2175|  19.7M|    enum BlockPartition bp;
 2176|  19.7M|    int ctx, bx8, by8;
 2177|  19.7M|    if (t->frame_thread.pass != 2) {
  ------------------
  |  Branch (2177:9): [True: 13.2M, False: 6.44M]
  ------------------
 2178|  13.2M|        if (0 && bl == BL_64X64)
  ------------------
  |  Branch (2178:13): [Folded, False: 13.2M]
  |  Branch (2178:18): [True: 0, False: 0]
  ------------------
 2179|      0|            printf("poc=%d,y=%d,x=%d,bl=%d,r=%d\n",
 2180|      0|                   f->frame_hdr->frame_offset, t->by, t->bx, bl, ts->msac.rng);
 2181|  13.2M|        bx8 = (t->bx & 31) >> 1;
 2182|  13.2M|        by8 = (t->by & 31) >> 1;
 2183|  13.2M|        ctx = get_partition_ctx(t->a, &t->l, bl, by8, bx8);
 2184|  13.2M|        pc = ts->cdf.m.partition[bl][ctx];
 2185|  13.2M|    }
 2186|       |
 2187|  19.7M|    if (have_h_split && have_v_split) {
  ------------------
  |  Branch (2187:9): [True: 19.2M, False: 404k]
  |  Branch (2187:25): [True: 18.2M, False: 1.06M]
  ------------------
 2188|  18.2M|        if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (2188:13): [True: 6.57M, False: 11.6M]
  ------------------
 2189|  6.57M|            const Av1Block *const b = &f->frame_thread.b[t->by * f->b4_stride + t->bx];
 2190|  6.57M|            bp = b->bl == bl ? b->bp : PARTITION_SPLIT;
  ------------------
  |  Branch (2190:18): [True: 6.14M, False: 426k]
  ------------------
 2191|  11.6M|        } else {
 2192|  11.6M|            bp = dav1d_msac_decode_symbol_adapt16(&ts->msac, pc,
  ------------------
  |  |   57|  11.6M|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 2193|  11.6M|                                                  dav1d_partition_type_count[bl]);
 2194|  11.6M|            if (f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I422 &&
  ------------------
  |  Branch (2194:17): [True: 26.2k, False: 11.6M]
  ------------------
 2195|  26.2k|                (bp == PARTITION_V || bp == PARTITION_V4 ||
  ------------------
  |  Branch (2195:18): [True: 271, False: 25.9k]
  |  Branch (2195:39): [True: 343, False: 25.6k]
  ------------------
 2196|  25.6k|                 bp == PARTITION_T_LEFT_SPLIT || bp == PARTITION_T_RIGHT_SPLIT))
  ------------------
  |  Branch (2196:18): [True: 650, False: 24.9k]
  |  Branch (2196:50): [True: 10.9k, False: 14.0k]
  ------------------
 2197|  12.2k|            {
 2198|  12.2k|                return 1;
 2199|  12.2k|            }
 2200|  11.6M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  11.6M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 11.6M]
  |  |  ------------------
  |  |   35|  11.6M|        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|  11.6M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2201|      0|                printf("poc=%d,y=%d,x=%d,bl=%d,ctx=%d,bp=%d: r=%d\n",
 2202|      0|                       f->frame_hdr->frame_offset, t->by, t->bx, bl, ctx, bp,
 2203|      0|                       ts->msac.rng);
 2204|  11.6M|        }
 2205|  18.2M|        const uint8_t *const b = dav1d_block_sizes[bl][bp];
 2206|       |
 2207|  18.2M|        switch (bp) {
 2208|  13.1M|        case PARTITION_NONE:
  ------------------
  |  Branch (2208:9): [True: 13.1M, False: 5.05M]
  ------------------
 2209|  13.1M|            if (decode_b(t, bl, b[0], PARTITION_NONE, node->o))
  ------------------
  |  Branch (2209:17): [True: 909, False: 13.1M]
  ------------------
 2210|    909|                return -1;
 2211|  13.1M|            break;
 2212|  13.1M|        case PARTITION_H:
  ------------------
  |  Branch (2212:9): [True: 941k, False: 17.2M]
  ------------------
 2213|   941k|            if (decode_b(t, bl, b[0], PARTITION_H, node->h[0]))
  ------------------
  |  Branch (2213:17): [True: 176, False: 941k]
  ------------------
 2214|    176|                return -1;
 2215|   941k|            t->by += hsz;
 2216|   941k|            if (decode_b(t, bl, b[0], PARTITION_H, node->h[1]))
  ------------------
  |  Branch (2216:17): [True: 510, False: 941k]
  ------------------
 2217|    510|                return -1;
 2218|   941k|            t->by -= hsz;
 2219|   941k|            break;
 2220|   613k|        case PARTITION_V:
  ------------------
  |  Branch (2220:9): [True: 613k, False: 17.5M]
  ------------------
 2221|   613k|            if (decode_b(t, bl, b[0], PARTITION_V, node->v[0]))
  ------------------
  |  Branch (2221:17): [True: 3.64k, False: 610k]
  ------------------
 2222|  3.64k|                return -1;
 2223|   610k|            t->bx += hsz;
 2224|   610k|            if (decode_b(t, bl, b[0], PARTITION_V, node->v[1]))
  ------------------
  |  Branch (2224:17): [True: 506, False: 609k]
  ------------------
 2225|    506|                return -1;
 2226|   609k|            t->bx -= hsz;
 2227|   609k|            break;
 2228|  2.38M|        case PARTITION_SPLIT:
  ------------------
  |  Branch (2228:9): [True: 2.38M, False: 15.8M]
  ------------------
 2229|  2.38M|            if (bl == BL_8X8) {
  ------------------
  |  Branch (2229:17): [True: 517k, False: 1.86M]
  ------------------
 2230|   517k|                const EdgeTip *const tip = (const EdgeTip *) node;
 2231|   517k|                assert(hsz == 1);
  ------------------
  |  Branch (2231:17): [True: 517k, False: 18.4E]
  ------------------
 2232|   517k|                if (decode_b(t, bl, BS_4x4, PARTITION_SPLIT, EDGE_ALL_TR_AND_BL))
  ------------------
  |  Branch (2232:21): [True: 199, False: 517k]
  ------------------
 2233|    199|                    return -1;
 2234|   517k|                const enum Filter2d tl_filter = t->tl_4x4_filter;
 2235|   517k|                t->bx++;
 2236|   517k|                if (decode_b(t, bl, BS_4x4, PARTITION_SPLIT, tip->split[0]))
  ------------------
  |  Branch (2236:21): [True: 216, False: 516k]
  ------------------
 2237|    216|                    return -1;
 2238|   516k|                t->bx--;
 2239|   516k|                t->by++;
 2240|   516k|                if (decode_b(t, bl, BS_4x4, PARTITION_SPLIT, tip->split[1]))
  ------------------
  |  Branch (2240:21): [True: 202, False: 516k]
  ------------------
 2241|    202|                    return -1;
 2242|   516k|                t->bx++;
 2243|   516k|                t->tl_4x4_filter = tl_filter;
 2244|   516k|                if (decode_b(t, bl, BS_4x4, PARTITION_SPLIT, tip->split[2]))
  ------------------
  |  Branch (2244:21): [True: 202, False: 516k]
  ------------------
 2245|    202|                    return -1;
 2246|   516k|                t->bx--;
 2247|   516k|                t->by--;
 2248|   516k|#if ARCH_X86_64
 2249|   516k|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (2249:21): [True: 516k, False: 7]
  ------------------
 2250|       |                    /* In 8-bit mode with 2-pass decoding the coefficient buffer
 2251|       |                     * can end up misaligned due to skips here. Work around
 2252|       |                     * the issue by explicitly realigning the buffer. */
 2253|   516k|                    const int p = t->frame_thread.pass & 1;
 2254|   516k|                    ts->frame_thread[p].cf =
 2255|   516k|                        (void*)(((uintptr_t)ts->frame_thread[p].cf + 63) & ~63);
 2256|   516k|                }
 2257|   516k|#endif
 2258|  1.86M|            } else {
 2259|  1.86M|                if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 0)))
  ------------------
  |  |   51|  1.86M|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2259:21): [True: 1.77k, False: 1.86M]
  ------------------
 2260|  1.77k|                    return 1;
 2261|  1.86M|                t->bx += hsz;
 2262|  1.86M|                if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 1)))
  ------------------
  |  |   51|  1.86M|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2262:21): [True: 1.54k, False: 1.86M]
  ------------------
 2263|  1.54k|                    return 1;
 2264|  1.86M|                t->bx -= hsz;
 2265|  1.86M|                t->by += hsz;
 2266|  1.86M|                if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 2)))
  ------------------
  |  |   51|  1.86M|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2266:21): [True: 2.17k, False: 1.85M]
  ------------------
 2267|  2.17k|                    return 1;
 2268|  1.85M|                t->bx += hsz;
 2269|  1.85M|                if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 3)))
  ------------------
  |  |   51|  1.85M|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2269:21): [True: 1.70k, False: 1.85M]
  ------------------
 2270|  1.70k|                    return 1;
 2271|  1.85M|                t->bx -= hsz;
 2272|  1.85M|                t->by -= hsz;
 2273|  1.85M|            }
 2274|  2.37M|            break;
 2275|  2.37M|        case PARTITION_T_TOP_SPLIT: {
  ------------------
  |  Branch (2275:9): [True: 129k, False: 18.0M]
  ------------------
 2276|   129k|            if (decode_b(t, bl, b[0], PARTITION_T_TOP_SPLIT, EDGE_ALL_TR_AND_BL))
  ------------------
  |  Branch (2276:17): [True: 770, False: 128k]
  ------------------
 2277|    770|                return -1;
 2278|   128k|            t->bx += hsz;
 2279|   128k|            if (decode_b(t, bl, b[0], PARTITION_T_TOP_SPLIT, node->v[1]))
  ------------------
  |  Branch (2279:17): [True: 134, False: 128k]
  ------------------
 2280|    134|                return -1;
 2281|   128k|            t->bx -= hsz;
 2282|   128k|            t->by += hsz;
 2283|   128k|            if (decode_b(t, bl, b[1], PARTITION_T_TOP_SPLIT, node->h[1]))
  ------------------
  |  Branch (2283:17): [True: 109, False: 128k]
  ------------------
 2284|    109|                return -1;
 2285|   128k|            t->by -= hsz;
 2286|   128k|            break;
 2287|   128k|        }
 2288|   160k|        case PARTITION_T_BOTTOM_SPLIT: {
  ------------------
  |  Branch (2288:9): [True: 160k, False: 18.0M]
  ------------------
 2289|   160k|            if (decode_b(t, bl, b[0], PARTITION_T_BOTTOM_SPLIT, node->h[0]))
  ------------------
  |  Branch (2289:17): [True: 214, False: 160k]
  ------------------
 2290|    214|                return -1;
 2291|   160k|            t->by += hsz;
 2292|   160k|            if (decode_b(t, bl, b[1], PARTITION_T_BOTTOM_SPLIT, node->v[0]))
  ------------------
  |  Branch (2292:17): [True: 264, False: 160k]
  ------------------
 2293|    264|                return -1;
 2294|   160k|            t->bx += hsz;
 2295|   160k|            if (decode_b(t, bl, b[1], PARTITION_T_BOTTOM_SPLIT, 0))
  ------------------
  |  Branch (2295:17): [True: 440, False: 159k]
  ------------------
 2296|    440|                return -1;
 2297|   159k|            t->bx -= hsz;
 2298|   159k|            t->by -= hsz;
 2299|   159k|            break;
 2300|   160k|        }
 2301|   109k|        case PARTITION_T_LEFT_SPLIT: {
  ------------------
  |  Branch (2301:9): [True: 109k, False: 18.0M]
  ------------------
 2302|   109k|            if (decode_b(t, bl, b[0], PARTITION_T_LEFT_SPLIT, EDGE_ALL_TR_AND_BL))
  ------------------
  |  Branch (2302:17): [True: 115, False: 109k]
  ------------------
 2303|    115|                return -1;
 2304|   109k|            t->by += hsz;
 2305|   109k|            if (decode_b(t, bl, b[0], PARTITION_T_LEFT_SPLIT, node->h[1]))
  ------------------
  |  Branch (2305:17): [True: 168, False: 109k]
  ------------------
 2306|    168|                return -1;
 2307|   109k|            t->by -= hsz;
 2308|   109k|            t->bx += hsz;
 2309|   109k|            if (decode_b(t, bl, b[1], PARTITION_T_LEFT_SPLIT, node->v[1]))
  ------------------
  |  Branch (2309:17): [True: 87, False: 108k]
  ------------------
 2310|     87|                return -1;
 2311|   108k|            t->bx -= hsz;
 2312|   108k|            break;
 2313|   109k|        }
 2314|   223k|        case PARTITION_T_RIGHT_SPLIT: {
  ------------------
  |  Branch (2314:9): [True: 223k, False: 17.9M]
  ------------------
 2315|   223k|            if (decode_b(t, bl, b[0], PARTITION_T_RIGHT_SPLIT, node->v[0]))
  ------------------
  |  Branch (2315:17): [True: 86, False: 223k]
  ------------------
 2316|     86|                return -1;
 2317|   223k|            t->bx += hsz;
 2318|   223k|            if (decode_b(t, bl, b[1], PARTITION_T_RIGHT_SPLIT, node->h[0]))
  ------------------
  |  Branch (2318:17): [True: 279, False: 223k]
  ------------------
 2319|    279|                return -1;
 2320|   223k|            t->by += hsz;
 2321|   223k|            if (decode_b(t, bl, b[1], PARTITION_T_RIGHT_SPLIT, 0))
  ------------------
  |  Branch (2321:17): [True: 241, False: 223k]
  ------------------
 2322|    241|                return -1;
 2323|   223k|            t->by -= hsz;
 2324|   223k|            t->bx -= hsz;
 2325|   223k|            break;
 2326|   223k|        }
 2327|   409k|        case PARTITION_H4: {
  ------------------
  |  Branch (2327:9): [True: 409k, False: 17.7M]
  ------------------
 2328|   409k|            const EdgeBranch *const branch = (const EdgeBranch *) node;
 2329|   409k|            if (decode_b(t, bl, b[0], PARTITION_H4, node->h[0]))
  ------------------
  |  Branch (2329:17): [True: 508, False: 409k]
  ------------------
 2330|    508|                return -1;
 2331|   409k|            t->by += hsz >> 1;
 2332|   409k|            if (decode_b(t, bl, b[0], PARTITION_H4, branch->h4))
  ------------------
  |  Branch (2332:17): [True: 54, False: 409k]
  ------------------
 2333|     54|                return -1;
 2334|   409k|            t->by += hsz >> 1;
 2335|   409k|            if (decode_b(t, bl, b[0], PARTITION_H4, EDGE_ALL_LEFT_HAS_BOTTOM))
  ------------------
  |  Branch (2335:17): [True: 204, False: 409k]
  ------------------
 2336|    204|                return -1;
 2337|   409k|            t->by += hsz >> 1;
 2338|   409k|            if (t->by < f->bh)
  ------------------
  |  Branch (2338:17): [True: 324k, False: 84.3k]
  ------------------
 2339|   324k|                if (decode_b(t, bl, b[0], PARTITION_H4, node->h[1]))
  ------------------
  |  Branch (2339:21): [True: 264, False: 324k]
  ------------------
 2340|    264|                    return -1;
 2341|   408k|            t->by -= hsz * 3 >> 1;
 2342|   408k|            break;
 2343|   409k|        }
 2344|   271k|        case PARTITION_V4: {
  ------------------
  |  Branch (2344:9): [True: 271k, False: 17.9M]
  ------------------
 2345|   271k|            const EdgeBranch *const branch = (const EdgeBranch *) node;
 2346|   271k|            if (decode_b(t, bl, b[0], PARTITION_V4, node->v[0]))
  ------------------
  |  Branch (2346:17): [True: 245, False: 271k]
  ------------------
 2347|    245|                return -1;
 2348|   271k|            t->bx += hsz >> 1;
 2349|   271k|            if (decode_b(t, bl, b[0], PARTITION_V4, branch->v4))
  ------------------
  |  Branch (2349:17): [True: 330, False: 270k]
  ------------------
 2350|    330|                return -1;
 2351|   270k|            t->bx += hsz >> 1;
 2352|   270k|            if (decode_b(t, bl, b[0], PARTITION_V4, EDGE_ALL_TOP_HAS_RIGHT))
  ------------------
  |  Branch (2352:17): [True: 994, False: 269k]
  ------------------
 2353|    994|                return -1;
 2354|   269k|            t->bx += hsz >> 1;
 2355|   269k|            if (t->bx < f->bw)
  ------------------
  |  Branch (2355:17): [True: 261k, False: 8.74k]
  ------------------
 2356|   261k|                if (decode_b(t, bl, b[0], PARTITION_V4, node->v[1]))
  ------------------
  |  Branch (2356:21): [True: 81, False: 261k]
  ------------------
 2357|     81|                    return -1;
 2358|   269k|            t->bx -= hsz * 3 >> 1;
 2359|   269k|            break;
 2360|   269k|        }
 2361|      0|        default: assert(0);
  ------------------
  |  Branch (2361:9): [True: 0, False: 18.2M]
  |  Branch (2361:18): [Folded, False: 0]
  ------------------
 2362|  18.2M|        }
 2363|  18.2M|    } else if (have_h_split) {
  ------------------
  |  Branch (2363:16): [True: 1.09M, False: 389k]
  ------------------
 2364|  1.09M|        unsigned is_split;
 2365|  1.09M|        if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (2365:13): [True: 57.5k, False: 1.04M]
  ------------------
 2366|  57.5k|            const Av1Block *const b = &f->frame_thread.b[t->by * f->b4_stride + t->bx];
 2367|  57.5k|            is_split = b->bl != bl;
 2368|  1.04M|        } else {
 2369|  1.04M|            is_split = dav1d_msac_decode_bool(&ts->msac,
  ------------------
  |  |   54|  1.04M|#define dav1d_msac_decode_bool           dav1d_msac_decode_bool_sse2
  ------------------
 2370|  1.04M|                           gather_top_partition_prob(pc, bl));
 2371|  1.04M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.04M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.04M]
  |  |  ------------------
  |  |   35|  1.04M|        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.04M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2372|      0|                printf("poc=%d,y=%d,x=%d,bl=%d,ctx=%d,bp=%d: r=%d\n",
 2373|      0|                       f->frame_hdr->frame_offset, t->by, t->bx, bl, ctx,
 2374|      0|                       is_split ? PARTITION_SPLIT : PARTITION_H, ts->msac.rng);
  ------------------
  |  Branch (2374:24): [True: 0, False: 0]
  ------------------
 2375|  1.04M|        }
 2376|       |
 2377|  1.09M|        assert(bl < BL_8X8);
  ------------------
  |  Branch (2377:9): [True: 1.09M, False: 419]
  ------------------
 2378|  1.09M|        if (is_split) {
  ------------------
  |  Branch (2378:13): [True: 724k, False: 373k]
  ------------------
 2379|   724k|            bp = PARTITION_SPLIT;
 2380|   724k|            if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 0))) return 1;
  ------------------
  |  |   51|   724k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2380:17): [True: 3.02k, False: 721k]
  ------------------
 2381|   721k|            t->bx += hsz;
 2382|   721k|            if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 1))) return 1;
  ------------------
  |  |   51|   721k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2382:17): [True: 1.53k, False: 720k]
  ------------------
 2383|   720k|            t->bx -= hsz;
 2384|   720k|        } else {
 2385|   373k|            bp = PARTITION_H;
 2386|   373k|            if (decode_b(t, bl, dav1d_block_sizes[bl][PARTITION_H][0],
  ------------------
  |  Branch (2386:17): [True: 337, False: 373k]
  ------------------
 2387|   373k|                         PARTITION_H, node->h[0]))
 2388|    337|                return -1;
 2389|   373k|        }
 2390|  1.09M|    } else {
 2391|   389k|        assert(have_v_split);
  ------------------
  |  Branch (2391:9): [True: 362k, False: 26.4k]
  ------------------
 2392|   362k|        unsigned is_split;
 2393|   362k|        if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (2393:13): [True: 94.7k, False: 268k]
  ------------------
 2394|  94.7k|            const Av1Block *const b = &f->frame_thread.b[t->by * f->b4_stride + t->bx];
 2395|  94.7k|            is_split = b->bl != bl;
 2396|   268k|        } else {
 2397|   268k|            is_split = dav1d_msac_decode_bool(&ts->msac,
  ------------------
  |  |   54|   268k|#define dav1d_msac_decode_bool           dav1d_msac_decode_bool_sse2
  ------------------
 2398|   268k|                           gather_left_partition_prob(pc, bl));
 2399|   268k|            if (f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I422 && !is_split)
  ------------------
  |  Branch (2399:17): [True: 14.4k, False: 253k]
  |  Branch (2399:63): [True: 1.09k, False: 13.3k]
  ------------------
 2400|  1.09k|                return 1;
 2401|   266k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   266k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 266k]
  |  |  ------------------
  |  |   35|   266k|        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|   266k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2402|      0|                printf("poc=%d,y=%d,x=%d,bl=%d,ctx=%d,bp=%d: r=%d\n",
 2403|      0|                       f->frame_hdr->frame_offset, t->by, t->bx, bl, ctx,
 2404|      0|                       is_split ? PARTITION_SPLIT : PARTITION_V, ts->msac.rng);
  ------------------
  |  Branch (2404:24): [True: 0, False: 0]
  ------------------
 2405|   266k|        }
 2406|       |
 2407|   362k|        assert(bl < BL_8X8);
  ------------------
  |  Branch (2407:9): [True: 361k, False: 139]
  ------------------
 2408|   361k|        if (is_split) {
  ------------------
  |  Branch (2408:13): [True: 211k, False: 150k]
  ------------------
 2409|   211k|            bp = PARTITION_SPLIT;
 2410|   211k|            if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 0))) return 1;
  ------------------
  |  |   51|   211k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2410:17): [True: 21.0k, False: 190k]
  ------------------
 2411|   190k|            t->by += hsz;
 2412|   190k|            if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 2))) return 1;
  ------------------
  |  |   51|   190k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2412:17): [True: 11.7k, False: 178k]
  ------------------
 2413|   178k|            t->by -= hsz;
 2414|   178k|        } else {
 2415|   150k|            bp = PARTITION_V;
 2416|   150k|            if (decode_b(t, bl, dav1d_block_sizes[bl][PARTITION_V][0],
  ------------------
  |  Branch (2416:17): [True: 235, False: 150k]
  ------------------
 2417|   150k|                         PARTITION_V, node->v[0]))
 2418|    235|                return -1;
 2419|   150k|        }
 2420|   361k|    }
 2421|       |
 2422|  19.5M|    if (t->frame_thread.pass != 2 && (bp != PARTITION_SPLIT || bl == BL_8X8)) {
  ------------------
  |  Branch (2422:9): [True: 13.2M, False: 6.32M]
  |  Branch (2422:39): [True: 10.5M, False: 2.69M]
  |  Branch (2422:64): [True: 420k, False: 2.27M]
  ------------------
 2423|  10.9M|#define set_ctx(rep_macro) \
 2424|  10.9M|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
 2425|  10.9M|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
 2426|  10.9M|        case_set_upto16(ulog2(hsz));
  ------------------
  |  |   80|  10.9M|    switch (var) { \
  |  |   81|  2.02M|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 2424|  2.02M|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  2.02M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  2.02M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2425|  2.02M|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  2.02M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  2.02M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:5): [True: 2.02M, False: 8.95M]
  |  |  ------------------
  |  |   82|  2.24M|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 2424|  2.24M|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  2.24M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  2.24M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2425|  2.24M|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  2.24M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  2.24M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (82:5): [True: 2.24M, False: 8.73M]
  |  |  ------------------
  |  |   83|  1.28M|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 2424|  1.28M|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.28M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.28M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2425|  1.28M|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  1.28M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.28M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (83:5): [True: 1.28M, False: 9.69M]
  |  |  ------------------
  |  |   84|  1.94M|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 2424|  1.94M|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  1.94M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  1.94M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2425|  1.94M|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  1.94M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  1.94M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (84:5): [True: 1.94M, False: 9.02M]
  |  |  ------------------
  |  |   85|  3.53M|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 2424|  3.53M|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  3.53M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  3.53M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  3.53M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  3.53M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 3.53M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2425|  3.53M|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  3.53M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  3.53M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  3.53M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  3.53M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 3.53M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (85:5): [True: 3.53M, False: 7.43M]
  |  |  ------------------
  |  |   86|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (86:5): [True: 0, False: 10.9M]
  |  |  ------------------
  |  |   87|  10.9M|    }
  ------------------
  |  Branch (2426:9): [Folded, False: 0]
  ------------------
 2427|  10.9M|#undef set_ctx
 2428|  10.9M|    }
 2429|       |
 2430|  19.5M|    return 0;
 2431|  19.5M|}
decode.c:decode_b:
  724|  22.7M|                    const enum EdgeFlags intra_edge_flags) {
  725|  22.7M|    Dav1dTileState *const ts = t->ts;
  726|  22.7M|    const Dav1dFrameContext *const f = t->f;
  727|  22.7M|    Av1Block b_mem, *const b = t->frame_thread.pass ?
  ------------------
  |  Branch (727:32): [True: 22.7M, False: 18.4E]
  ------------------
  728|  18.4E|        &f->frame_thread.b[t->by * f->b4_stride + t->bx] : &b_mem;
  729|  22.7M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  730|  22.7M|    const int bx4 = t->bx & 31, by4 = t->by & 31;
  731|  22.7M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  732|  22.7M|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  733|  22.7M|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
  734|  22.7M|    const int bw4 = b_dim[0], bh4 = b_dim[1];
  735|  22.7M|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
  736|  22.7M|    const int cbw4 = (bw4 + ss_hor) >> ss_hor, cbh4 = (bh4 + ss_ver) >> ss_ver;
  737|  22.7M|    const int have_left = t->bx > ts->tiling.col_start;
  738|  22.7M|    const int have_top = t->by > ts->tiling.row_start;
  739|  22.7M|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (739:28): [True: 12.3M, False: 10.4M]
  ------------------
  740|  12.3M|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (740:29): [True: 11.0M, False: 1.25M]
  |  Branch (740:45): [True: 614k, False: 640k]
  ------------------
  741|  11.7M|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (741:29): [True: 10.7M, False: 971k]
  |  Branch (741:45): [True: 481k, False: 490k]
  ------------------
  742|       |
  743|  22.7M|    if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (743:9): [True: 7.19M, False: 15.5M]
  ------------------
  744|  7.19M|        if (b->intra) {
  ------------------
  |  Branch (744:13): [True: 1.46M, False: 5.73M]
  ------------------
  745|  1.46M|            f->bd_fn.recon_b_intra(t, bs, intra_edge_flags, b);
  746|       |
  747|  1.46M|            const enum IntraPredMode y_mode_nofilt =
  748|  1.46M|                b->y_mode == FILTER_PRED ? DC_PRED : b->y_mode;
  ------------------
  |  Branch (748:17): [True: 197k, False: 1.26M]
  ------------------
  749|  1.46M|#define set_ctx(rep_macro) \
  750|  1.46M|            rep_macro(edge->mode, off, y_mode_nofilt); \
  751|  1.46M|            rep_macro(edge->intra, off, 1)
  752|  1.46M|            BlockContext *edge = t->a;
  753|  4.39M|            for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (753:40): [True: 2.93M, False: 1.46M]
  ------------------
  754|  2.93M|                case_set(b_dim[2 + i]);
  ------------------
  |  |   70|  2.93M|    switch (var) { \
  |  |   71|   471k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  |  750|   471k|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   471k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   471k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  751|   471k|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   471k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   471k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 471k, False: 2.46M]
  |  |  ------------------
  |  |   72|   561k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  |  750|   561k|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   561k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   561k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  751|   561k|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   561k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   561k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 561k, False: 2.37M]
  |  |  ------------------
  |  |   73|   500k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  |  750|   500k|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   500k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   500k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  751|   500k|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   500k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   500k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 500k, False: 2.43M]
  |  |  ------------------
  |  |   74|   245k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  |  750|   245k|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   245k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   245k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  751|   245k|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   245k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   245k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 245k, False: 2.68M]
  |  |  ------------------
  |  |   75|   857k|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  |  750|   857k|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   857k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   857k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   857k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   857k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 857k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  751|   857k|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   857k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   857k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   857k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   857k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 857k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 857k, False: 2.07M]
  |  |  ------------------
  |  |   76|   303k|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  |  750|   303k|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   303k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   303k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   303k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   303k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 303k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  751|   303k|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   303k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   303k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   303k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   303k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 303k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 303k, False: 2.63M]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 2.93M]
  |  |  ------------------
  |  |   78|  2.93M|    }
  ------------------
  |  Branch (754:17): [Folded, False: 0]
  ------------------
  755|  2.93M|            }
  756|  1.46M|#undef set_ctx
  757|  1.46M|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|  1.46M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 211k, False: 1.25M]
  |  |  ------------------
  ------------------
  758|   211k|                refmvs_block *const r = &t->rt.r[(t->by & 31) + 5 + bh4 - 1][t->bx];
  759|  1.04M|                for (int x = 0; x < bw4; x++) {
  ------------------
  |  Branch (759:33): [True: 831k, False: 211k]
  ------------------
  760|   831k|                    r[x].ref.ref[0] = 0;
  761|   831k|                    r[x].bs = bs;
  762|   831k|                }
  763|   211k|                refmvs_block *const *rr = &t->rt.r[(t->by & 31) + 5];
  764|   211k|                const int bx = t->bx + bw4 - 1;
  765|   832k|                for (int y = 0; y < bh4 - 1; y++) {
  ------------------
  |  Branch (765:33): [True: 621k, False: 211k]
  ------------------
  766|   621k|                    refmvs_block *d = &rr[y][bx];
  767|   621k|                    d->ref.ref[0] = 0;
  768|   621k|                    d->bs = bs;
  769|   621k|                }
  770|   211k|            }
  771|       |
  772|  1.46M|            if (has_chroma) {
  ------------------
  |  Branch (772:17): [True: 793k, False: 671k]
  ------------------
  773|   793k|                uint8_t uv_mode = b->uv_mode;
  774|   793k|                dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], uv_mode);
  775|   793k|                dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], uv_mode);
  776|   793k|            }
  777|  5.73M|        } else {
  778|  5.73M|            if (IS_INTER_OR_SWITCH(f->frame_hdr) /* not intrabc */ &&
  ------------------
  |  |   36|  11.4M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 5.73M, False: 18.4E]
  |  |  ------------------
  ------------------
  779|  5.73M|                b->comp_type == COMP_INTER_NONE && b->motion_mode == MM_WARP)
  ------------------
  |  Branch (779:17): [True: 5.64M, False: 94.7k]
  |  Branch (779:52): [True: 162k, False: 5.48M]
  ------------------
  780|   162k|            {
  781|   162k|                if (b->matrix[0] == INT16_MIN) {
  ------------------
  |  Branch (781:21): [True: 6.32k, False: 156k]
  ------------------
  782|  6.32k|                    t->warpmv.type = DAV1D_WM_TYPE_IDENTITY;
  783|   156k|                } else {
  784|   156k|                    t->warpmv.type = DAV1D_WM_TYPE_AFFINE;
  785|   156k|                    t->warpmv.matrix[2] = b->matrix[0] + 0x10000;
  786|   156k|                    t->warpmv.matrix[3] = b->matrix[1];
  787|   156k|                    t->warpmv.matrix[4] = b->matrix[2];
  788|   156k|                    t->warpmv.matrix[5] = b->matrix[3] + 0x10000;
  789|   156k|                    dav1d_set_affine_mv2d(bw4, bh4, b->mv2d, &t->warpmv,
  790|   156k|                                          t->bx, t->by);
  791|   156k|                    dav1d_get_shear_params(&t->warpmv);
  792|   156k|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  793|   156k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   156k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 156k]
  |  |  ------------------
  |  |   35|   156k|        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|   156k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  794|      0|                        printf("[ %c%x %c%x %c%x\n  %c%x %c%x %c%x ]\n"
  795|      0|                               "alpha=%c%x, beta=%c%x, gamma=%c%x, delta=%c%x, mv=y:%d,x:%d\n",
  796|      0|                               signabs(t->warpmv.matrix[0]),
  ------------------
  |  |  792|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (792:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  797|      0|                               signabs(t->warpmv.matrix[1]),
  ------------------
  |  |  792|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (792:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  798|      0|                               signabs(t->warpmv.matrix[2]),
  ------------------
  |  |  792|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (792:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  799|      0|                               signabs(t->warpmv.matrix[3]),
  ------------------
  |  |  792|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (792:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  800|      0|                               signabs(t->warpmv.matrix[4]),
  ------------------
  |  |  792|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (792:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  801|      0|                               signabs(t->warpmv.matrix[5]),
  ------------------
  |  |  792|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (792:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  802|      0|                               signabs(t->warpmv.u.p.alpha),
  ------------------
  |  |  792|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (792:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  803|      0|                               signabs(t->warpmv.u.p.beta),
  ------------------
  |  |  792|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (792:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  804|      0|                               signabs(t->warpmv.u.p.gamma),
  ------------------
  |  |  792|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (792:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  805|      0|                               signabs(t->warpmv.u.p.delta),
  ------------------
  |  |  792|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (792:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  806|      0|                               b->mv2d.y, b->mv2d.x);
  807|   156k|#undef signabs
  808|   156k|                }
  809|   162k|            }
  810|  5.73M|            if (f->bd_fn.recon_b_inter(t, bs, b)) return -1;
  ------------------
  |  Branch (810:17): [True: 0, False: 5.73M]
  ------------------
  811|       |
  812|  5.73M|            const uint8_t *const filter = dav1d_filter_dir[b->filter2d];
  813|  5.73M|            BlockContext *edge = t->a;
  814|  17.1M|            for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (814:40): [True: 11.4M, False: 5.72M]
  ------------------
  815|  11.4M|#define set_ctx(rep_macro) \
  816|  11.4M|                rep_macro(edge->filter[0], off, filter[0]); \
  817|  11.4M|                rep_macro(edge->filter[1], off, filter[1]); \
  818|  11.4M|                rep_macro(edge->intra, off, 0)
  819|  11.4M|                case_set(b_dim[2 + i]);
  ------------------
  |  |   70|  11.4M|    switch (var) { \
  |  |   71|   638k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  |  816|   638k|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   638k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   638k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  817|   638k|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   638k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   638k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  818|   638k|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   638k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   638k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 638k, False: 10.8M]
  |  |  ------------------
  |  |   72|  1.20M|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  |  816|  1.20M|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.20M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.20M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  817|  1.20M|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.20M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.20M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  818|  1.20M|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.20M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.20M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 1.20M, False: 10.2M]
  |  |  ------------------
  |  |   73|   854k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  |  816|   854k|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   854k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   854k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  817|   854k|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   854k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   854k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  818|   854k|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   854k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   854k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 854k, False: 10.5M]
  |  |  ------------------
  |  |   74|   257k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  |  816|   257k|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   257k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   257k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  817|   257k|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   257k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   257k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  818|   257k|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   257k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   257k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 257k, False: 11.1M]
  |  |  ------------------
  |  |   75|  2.27M|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  |  816|  2.27M|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.27M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.27M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.27M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.27M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.27M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  817|  2.27M|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.27M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.27M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.27M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.27M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.27M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  818|  2.27M|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.27M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.27M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.27M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.27M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.27M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 2.27M, False: 9.17M]
  |  |  ------------------
  |  |   76|  6.24M|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  |  816|  6.24M|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.24M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.24M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.24M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.24M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.24M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  817|  6.24M|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.24M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.24M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.24M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.24M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.24M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  818|  6.24M|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.24M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.24M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.24M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.24M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.24M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 6.24M, False: 5.20M]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 11.4M]
  |  |  ------------------
  |  |   78|  11.4M|    }
  ------------------
  |  Branch (819:17): [Folded, False: 0]
  ------------------
  820|  11.4M|#undef set_ctx
  821|  11.4M|            }
  822|       |
  823|  5.72M|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|  5.72M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 5.70M, False: 19.3k]
  |  |  ------------------
  ------------------
  824|  5.70M|                refmvs_block *const r = &t->rt.r[(t->by & 31) + 5 + bh4 - 1][t->bx];
  825|  5.70M|                const int ref1 = b->ref[0] + 1;
  826|  5.70M|                const union mv mv1 = b->mv[0];
  827|   127M|                for (int x = 0; x < bw4; x++) {
  ------------------
  |  Branch (827:33): [True: 121M, False: 5.70M]
  ------------------
  828|   121M|                    r[x].ref.ref[0] = ref1;
  829|   121M|                    r[x].mv.mv[0] = mv1;
  830|   121M|                    r[x].bs = bs;
  831|   121M|                }
  832|  5.70M|                refmvs_block *const *rr = &t->rt.r[(t->by & 31) + 5];
  833|  5.70M|                const int bx = t->bx + bw4 - 1;
  834|   121M|                for (int y = 0; y < bh4 - 1; y++) {
  ------------------
  |  Branch (834:33): [True: 115M, False: 5.70M]
  ------------------
  835|   115M|                    refmvs_block* d = &rr[y][bx];
  836|   115M|                    d->ref.ref[0] = ref1;
  837|   115M|                    d->mv.mv[0] = mv1;
  838|   115M|                    d->bs = bs;
  839|   115M|                }
  840|  5.70M|            }
  841|       |
  842|  5.72M|            if (has_chroma) {
  ------------------
  |  Branch (842:17): [True: 1.26M, False: 4.45M]
  ------------------
  843|  1.26M|                dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], DC_PRED);
  844|  1.26M|                dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], DC_PRED);
  845|  1.26M|            }
  846|  5.72M|        }
  847|  7.18M|        return 0;
  848|  7.19M|    }
  849|       |
  850|  15.5M|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
  851|       |
  852|  15.5M|    b->bl = bl;
  853|  15.5M|    b->bp = bp;
  854|  15.5M|    b->bs = bs;
  855|       |
  856|  15.5M|    const Dav1dSegmentationData *seg = NULL;
  857|       |
  858|       |    // segment_id (if seg_feature for skip/ref/gmv is enabled)
  859|  15.5M|    int seg_pred = 0;
  860|  15.5M|    if (f->frame_hdr->segmentation.enabled) {
  ------------------
  |  Branch (860:9): [True: 6.24M, False: 9.29M]
  ------------------
  861|  6.24M|        if (!f->frame_hdr->segmentation.update_map) {
  ------------------
  |  Branch (861:13): [True: 1.19M, False: 5.04M]
  ------------------
  862|  1.19M|            if (f->prev_segmap) {
  ------------------
  |  Branch (862:17): [True: 981k, False: 217k]
  ------------------
  863|   981k|                unsigned seg_id = get_prev_frame_segid(f, t->by, t->bx, w4, h4,
  864|   981k|                                                       f->prev_segmap,
  865|   981k|                                                       f->b4_stride);
  866|   981k|                if (seg_id >= 8) return -1;
  ------------------
  |  Branch (866:21): [True: 0, False: 981k]
  ------------------
  867|   981k|                b->seg_id = seg_id;
  868|   981k|            } else {
  869|   217k|                b->seg_id = 0;
  870|   217k|            }
  871|  1.19M|            seg = &f->frame_hdr->segmentation.seg_data.d[b->seg_id];
  872|  5.04M|        } else if (f->frame_hdr->segmentation.seg_data.preskip) {
  ------------------
  |  Branch (872:20): [True: 4.54M, False: 492k]
  ------------------
  873|  4.54M|            if (f->frame_hdr->segmentation.temporal &&
  ------------------
  |  Branch (873:17): [True: 3.27M, False: 1.27M]
  ------------------
  874|  3.27M|                (seg_pred = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  3.27M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (874:17): [True: 203k, False: 3.07M]
  ------------------
  875|  3.27M|                                ts->cdf.m.seg_pred[t->a->seg_pred[bx4] +
  876|  3.27M|                                t->l.seg_pred[by4]])))
  877|   203k|            {
  878|       |                // temporal predicted seg_id
  879|   203k|                if (f->prev_segmap) {
  ------------------
  |  Branch (879:21): [True: 39.7k, False: 164k]
  ------------------
  880|  39.7k|                    unsigned seg_id = get_prev_frame_segid(f, t->by, t->bx,
  881|  39.7k|                                                           w4, h4,
  882|  39.7k|                                                           f->prev_segmap,
  883|  39.7k|                                                           f->b4_stride);
  884|  39.7k|                    if (seg_id >= 8) return -1;
  ------------------
  |  Branch (884:25): [True: 0, False: 39.7k]
  ------------------
  885|  39.7k|                    b->seg_id = seg_id;
  886|   164k|                } else {
  887|   164k|                    b->seg_id = 0;
  888|   164k|                }
  889|  4.34M|            } else {
  890|  4.34M|                int seg_ctx;
  891|  4.34M|                const unsigned pred_seg_id =
  892|  4.34M|                    get_cur_frame_segid(t->by, t->bx, have_top, have_left,
  893|  4.34M|                                        &seg_ctx, f->cur_segmap, f->b4_stride);
  894|  4.34M|                const unsigned diff = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|  4.34M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  895|  4.34M|                                          ts->cdf.m.seg_id[seg_ctx],
  896|  4.34M|                                          DAV1D_MAX_SEGMENTS - 1);
  ------------------
  |  |   43|  4.34M|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  897|  4.34M|                const unsigned last_active_seg_id =
  898|  4.34M|                    f->frame_hdr->segmentation.seg_data.last_active_segid;
  899|  4.34M|                b->seg_id = neg_deinterleave(diff, pred_seg_id,
  900|  4.34M|                                             last_active_seg_id + 1);
  901|  4.34M|                if (b->seg_id > last_active_seg_id) b->seg_id = 0; // error?
  ------------------
  |  Branch (901:21): [True: 59.1k, False: 4.28M]
  ------------------
  902|  4.34M|                if (b->seg_id >= DAV1D_MAX_SEGMENTS) b->seg_id = 0; // error?
  ------------------
  |  |   43|  4.34M|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (902:21): [True: 0, False: 4.34M]
  ------------------
  903|  4.34M|            }
  904|       |
  905|  4.54M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  4.54M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 4.54M]
  |  |  ------------------
  |  |   35|  4.54M|        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|  4.54M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  906|      0|                printf("Post-segid[preskip;%d]: r=%d\n",
  907|      0|                       b->seg_id, ts->msac.rng);
  908|       |
  909|  4.54M|            seg = &f->frame_hdr->segmentation.seg_data.d[b->seg_id];
  910|  4.54M|        }
  911|  9.29M|    } else {
  912|  9.29M|        b->seg_id = 0;
  913|  9.29M|    }
  914|       |
  915|       |    // skip_mode
  916|  15.5M|    if ((!seg || (!seg->globalmv && seg->ref == -1 && !seg->skip)) &&
  ------------------
  |  Branch (916:10): [True: 9.80M, False: 5.73M]
  |  Branch (916:19): [True: 718k, False: 5.02M]
  |  Branch (916:37): [True: 393k, False: 324k]
  |  Branch (916:55): [True: 306k, False: 87.5k]
  ------------------
  917|  10.5M|        f->frame_hdr->skip_mode_enabled && imin(bw4, bh4) > 1)
  ------------------
  |  Branch (917:9): [True: 388k, False: 10.1M]
  |  Branch (917:44): [True: 287k, False: 101k]
  ------------------
  918|   287k|    {
  919|   287k|        const int smctx = t->a->skip_mode[bx4] + t->l.skip_mode[by4];
  920|   287k|        b->skip_mode = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   287k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  921|   287k|                           ts->cdf.m.skip_mode[smctx]);
  922|   287k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   287k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 287k]
  |  |  ------------------
  |  |   35|   287k|        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|   287k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  923|      0|            printf("Post-skipmode[%d]: r=%d\n", b->skip_mode, ts->msac.rng);
  924|  15.2M|    } else {
  925|  15.2M|        b->skip_mode = 0;
  926|  15.2M|    }
  927|       |
  928|       |    // skip
  929|  15.9M|    if (b->skip_mode || (seg && seg->skip)) {
  ------------------
  |  Branch (929:9): [True: 18.4E, False: 15.9M]
  |  Branch (929:26): [True: 5.73M, False: 10.1M]
  |  Branch (929:33): [True: 5.14M, False: 591k]
  ------------------
  930|  5.17M|        b->skip = 1;
  931|  10.3M|    } else {
  932|  10.3M|        const int sctx = t->a->skip[bx4] + t->l.skip[by4];
  933|  10.3M|        b->skip = dav1d_msac_decode_bool_adapt(&ts->msac, ts->cdf.m.skip[sctx]);
  ------------------
  |  |   52|  10.3M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  934|  10.3M|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  10.3M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 10.3M]
  |  |  ------------------
  |  |   35|  10.3M|        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|  10.3M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  935|      0|            printf("Post-skip[%d]: r=%d\n", b->skip, ts->msac.rng);
  936|  10.3M|    }
  937|       |
  938|       |    // segment_id
  939|  15.5M|    if (f->frame_hdr->segmentation.enabled &&
  ------------------
  |  Branch (939:9): [True: 6.22M, False: 9.31M]
  ------------------
  940|  6.22M|        f->frame_hdr->segmentation.update_map &&
  ------------------
  |  Branch (940:9): [True: 5.03M, False: 1.19M]
  ------------------
  941|  5.03M|        !f->frame_hdr->segmentation.seg_data.preskip)
  ------------------
  |  Branch (941:9): [True: 492k, False: 4.54M]
  ------------------
  942|   492k|    {
  943|   492k|        if (!b->skip && f->frame_hdr->segmentation.temporal &&
  ------------------
  |  Branch (943:13): [True: 336k, False: 155k]
  |  Branch (943:25): [True: 32.4k, False: 304k]
  ------------------
  944|  32.4k|            (seg_pred = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  32.4k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (944:13): [True: 14.7k, False: 17.6k]
  ------------------
  945|  32.4k|                            ts->cdf.m.seg_pred[t->a->seg_pred[bx4] +
  946|  32.4k|                            t->l.seg_pred[by4]])))
  947|  14.7k|        {
  948|       |            // temporal predicted seg_id
  949|  14.7k|            if (f->prev_segmap) {
  ------------------
  |  Branch (949:17): [True: 1.64k, False: 13.1k]
  ------------------
  950|  1.64k|                unsigned seg_id = get_prev_frame_segid(f, t->by, t->bx, w4, h4,
  951|  1.64k|                                                       f->prev_segmap,
  952|  1.64k|                                                       f->b4_stride);
  953|  1.64k|                if (seg_id >= 8) return -1;
  ------------------
  |  Branch (953:21): [True: 0, False: 1.64k]
  ------------------
  954|  1.64k|                b->seg_id = seg_id;
  955|  13.1k|            } else {
  956|  13.1k|                b->seg_id = 0;
  957|  13.1k|            }
  958|   477k|        } else {
  959|   477k|            int seg_ctx;
  960|   477k|            const unsigned pred_seg_id =
  961|   477k|                get_cur_frame_segid(t->by, t->bx, have_top, have_left,
  962|   477k|                                    &seg_ctx, f->cur_segmap, f->b4_stride);
  963|   477k|            if (b->skip) {
  ------------------
  |  Branch (963:17): [True: 164k, False: 313k]
  ------------------
  964|   164k|                b->seg_id = pred_seg_id;
  965|   313k|            } else {
  966|   313k|                const unsigned diff = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|   313k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  967|   313k|                                          ts->cdf.m.seg_id[seg_ctx],
  968|   313k|                                          DAV1D_MAX_SEGMENTS - 1);
  ------------------
  |  |   43|   313k|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  969|   313k|                const unsigned last_active_seg_id =
  970|   313k|                    f->frame_hdr->segmentation.seg_data.last_active_segid;
  971|   313k|                b->seg_id = neg_deinterleave(diff, pred_seg_id,
  972|   313k|                                             last_active_seg_id + 1);
  973|   313k|                if (b->seg_id > last_active_seg_id) b->seg_id = 0; // error?
  ------------------
  |  Branch (973:21): [True: 14.5k, False: 298k]
  ------------------
  974|   313k|            }
  975|   477k|            if (b->seg_id >= DAV1D_MAX_SEGMENTS) b->seg_id = 0; // error?
  ------------------
  |  |   43|   477k|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (975:17): [True: 1.58k, False: 475k]
  ------------------
  976|   477k|        }
  977|       |
  978|   492k|        seg = &f->frame_hdr->segmentation.seg_data.d[b->seg_id];
  979|       |
  980|   492k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   492k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 492k]
  |  |  ------------------
  |  |   35|   492k|        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|   492k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  981|      0|            printf("Post-segid[postskip;%d]: r=%d\n",
  982|      0|                   b->seg_id, ts->msac.rng);
  983|   492k|    }
  984|       |
  985|       |    // cdef index
  986|  15.5M|    if (!b->skip) {
  ------------------
  |  Branch (986:9): [True: 7.85M, False: 7.68M]
  ------------------
  987|  7.85M|        const int idx = f->seq_hdr->sb128 ? ((t->bx & 16) >> 4) +
  ------------------
  |  Branch (987:25): [True: 4.43M, False: 3.41M]
  ------------------
  988|  4.43M|                                           ((t->by & 16) >> 3) : 0;
  989|  7.85M|        if (t->cur_sb_cdef_idx_ptr[idx] == -1) {
  ------------------
  |  Branch (989:13): [True: 1.19M, False: 6.65M]
  ------------------
  990|  1.19M|            const int v = dav1d_msac_decode_bools(&ts->msac,
  991|  1.19M|                              f->frame_hdr->cdef.n_bits);
  992|  1.19M|            t->cur_sb_cdef_idx_ptr[idx] = v;
  993|  1.19M|            if (bw4 > 16) t->cur_sb_cdef_idx_ptr[idx + 1] = v;
  ------------------
  |  Branch (993:17): [True: 159k, False: 1.03M]
  ------------------
  994|  1.19M|            if (bh4 > 16) t->cur_sb_cdef_idx_ptr[idx + 2] = v;
  ------------------
  |  Branch (994:17): [True: 160k, False: 1.03M]
  ------------------
  995|  1.19M|            if (bw4 == 32 && bh4 == 32) t->cur_sb_cdef_idx_ptr[idx + 3] = v;
  ------------------
  |  Branch (995:17): [True: 159k, False: 1.03M]
  |  Branch (995:30): [True: 147k, False: 11.7k]
  ------------------
  996|       |
  997|  1.19M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.19M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.19M]
  |  |  ------------------
  |  |   35|  1.19M|        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.19M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  998|      0|                printf("Post-cdef_idx[%d]: r=%d\n",
  999|      0|                        *t->cur_sb_cdef_idx_ptr, ts->msac.rng);
 1000|  1.19M|        }
 1001|  7.85M|    }
 1002|       |
 1003|       |    // delta-q/lf
 1004|  15.5M|    if (!((t->bx | t->by) & (31 >> !f->seq_hdr->sb128))) {
  ------------------
  |  Branch (1004:9): [True: 5.87M, False: 9.66M]
  ------------------
 1005|  5.87M|        const int prev_qidx = ts->last_qidx;
 1006|  5.87M|        const int have_delta_q = f->frame_hdr->delta.q.present &&
  ------------------
  |  Branch (1006:34): [True: 1.11M, False: 4.75M]
  ------------------
 1007|  1.11M|            (bs != (f->seq_hdr->sb128 ? BS_128x128 : BS_64x64) || !b->skip);
  ------------------
  |  Branch (1007:14): [True: 469k, False: 649k]
  |  Branch (1007:21): [True: 155k, False: 963k]
  |  Branch (1007:67): [True: 29.4k, False: 619k]
  ------------------
 1008|       |
 1009|  5.87M|        uint32_t prev_delta_lf = ts->last_delta_lf.u32;
 1010|       |
 1011|  5.87M|        if (have_delta_q) {
  ------------------
  |  Branch (1011:13): [True: 499k, False: 5.37M]
  ------------------
 1012|   499k|            int delta_q = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|   499k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1013|   499k|                                                          ts->cdf.m.delta_q, 3);
 1014|   499k|            if (delta_q == 3) {
  ------------------
  |  Branch (1014:17): [True: 28.1k, False: 471k]
  ------------------
 1015|  28.1k|                const int n_bits = 1 + dav1d_msac_decode_bools(&ts->msac, 3);
 1016|  28.1k|                delta_q = dav1d_msac_decode_bools(&ts->msac, n_bits) +
 1017|  28.1k|                          1 + (1 << n_bits);
 1018|  28.1k|            }
 1019|   499k|            if (delta_q) {
  ------------------
  |  Branch (1019:17): [True: 47.9k, False: 451k]
  ------------------
 1020|  47.9k|                const int sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  47.9k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
 1021|  47.9k|                delta_q = apply_sign_bool(delta_q, sign);
 1022|  47.9k|                delta_q *= 1 << f->frame_hdr->delta.q.res_log2;
 1023|  47.9k|            }
 1024|   499k|            ts->last_qidx = iclip(ts->last_qidx + delta_q, 1, 255);
 1025|   499k|            if (have_delta_q && DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   499k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 499k]
  |  |  ------------------
  |  |   35|   499k|        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|   499k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1025:17): [True: 499k, False: 45]
  ------------------
 1026|      0|                printf("Post-delta_q[%d->%d]: r=%d\n",
 1027|      0|                       delta_q, ts->last_qidx, ts->msac.rng);
 1028|       |
 1029|   499k|            if (f->frame_hdr->delta.lf.present) {
  ------------------
  |  Branch (1029:17): [True: 78.2k, False: 421k]
  ------------------
 1030|  78.2k|                const int n_lfs = f->frame_hdr->delta.lf.multi ?
  ------------------
  |  Branch (1030:35): [True: 60.2k, False: 18.0k]
  ------------------
 1031|  60.2k|                    f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 ? 4 : 2 : 1;
  ------------------
  |  Branch (1031:21): [True: 49.0k, False: 11.1k]
  ------------------
 1032|       |
 1033|   314k|                for (int i = 0; i < n_lfs; i++) {
  ------------------
  |  Branch (1033:33): [True: 236k, False: 78.2k]
  ------------------
 1034|   236k|                    int delta_lf = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|   236k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1035|   236k|                        ts->cdf.m.delta_lf[i + f->frame_hdr->delta.lf.multi], 3);
 1036|   236k|                    if (delta_lf == 3) {
  ------------------
  |  Branch (1036:25): [True: 41.3k, False: 194k]
  ------------------
 1037|  41.3k|                        const int n_bits = 1 + dav1d_msac_decode_bools(&ts->msac, 3);
 1038|  41.3k|                        delta_lf = dav1d_msac_decode_bools(&ts->msac, n_bits) +
 1039|  41.3k|                                   1 + (1 << n_bits);
 1040|  41.3k|                    }
 1041|   236k|                    if (delta_lf) {
  ------------------
  |  Branch (1041:25): [True: 65.9k, False: 170k]
  ------------------
 1042|  65.9k|                        const int sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  65.9k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
 1043|  65.9k|                        delta_lf = apply_sign_bool(delta_lf, sign);
 1044|  65.9k|                        delta_lf *= 1 << f->frame_hdr->delta.lf.res_log2;
 1045|  65.9k|                    }
 1046|   236k|                    ts->last_delta_lf.i8[i] =
 1047|   236k|                        iclip(ts->last_delta_lf.i8[i] + delta_lf, -63, 63);
 1048|   236k|                    if (have_delta_q && DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   236k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 236k]
  |  |  ------------------
  |  |   35|   236k|        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|   236k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1048:25): [True: 236k, False: 47]
  ------------------
 1049|      0|                        printf("Post-delta_lf[%d:%d]: r=%d\n", i, delta_lf,
 1050|      0|                               ts->msac.rng);
 1051|   236k|                }
 1052|  78.2k|            }
 1053|   499k|        }
 1054|  5.87M|        if (ts->last_qidx == f->frame_hdr->quant.yac) {
  ------------------
  |  Branch (1054:13): [True: 5.75M, False: 122k]
  ------------------
 1055|       |            // assign frame-wide q values to this sb
 1056|  5.75M|            ts->dq = f->dq;
 1057|  5.75M|        } else if (ts->last_qidx != prev_qidx) {
  ------------------
  |  Branch (1057:20): [True: 20.1k, False: 102k]
  ------------------
 1058|       |            // find sb-specific quant parameters
 1059|  20.1k|            init_quant_tables(f->seq_hdr, f->frame_hdr, ts->last_qidx, ts->dqmem);
 1060|  20.1k|            ts->dq = ts->dqmem;
 1061|  20.1k|        }
 1062|  5.87M|        if (!ts->last_delta_lf.u32) {
  ------------------
  |  Branch (1062:13): [True: 5.81M, False: 60.1k]
  ------------------
 1063|       |            // assign frame-wide lf values to this sb
 1064|  5.81M|            ts->lflvl = f->lf.lvl;
 1065|  5.81M|        } else if (ts->last_delta_lf.u32 != prev_delta_lf) {
  ------------------
  |  Branch (1065:20): [True: 20.7k, False: 39.4k]
  ------------------
 1066|       |            // find sb-specific lf lvl parameters
 1067|  20.7k|            ts->lflvl = ts->lflvlmem;
 1068|  20.7k|            dav1d_calc_lf_values(ts->lflvlmem, f->frame_hdr, ts->last_delta_lf.i8);
 1069|  20.7k|        }
 1070|  5.87M|    }
 1071|       |
 1072|  15.5M|    if (b->skip_mode) {
  ------------------
  |  Branch (1072:9): [True: 25.0k, False: 15.5M]
  ------------------
 1073|  25.0k|        b->intra = 0;
 1074|  15.5M|    } else if (IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|  15.5M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 6.98M, False: 8.52M]
  |  |  ------------------
  ------------------
 1075|  6.98M|        if (seg && (seg->ref >= 0 || seg->globalmv)) {
  ------------------
  |  Branch (1075:13): [True: 5.00M, False: 1.98M]
  |  Branch (1075:21): [True: 275k, False: 4.72M]
  |  Branch (1075:38): [True: 4.44M, False: 286k]
  ------------------
 1076|  4.71M|            b->intra = !seg->ref;
 1077|  4.71M|        } else {
 1078|  2.27M|            const int ictx = get_intra_ctx(t->a, &t->l, by4, bx4,
 1079|  2.27M|                                           have_top, have_left);
 1080|  2.27M|            b->intra = !dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  2.27M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1081|  2.27M|                            ts->cdf.m.intra[ictx]);
 1082|  2.27M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  2.27M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 2.27M]
  |  |  ------------------
  |  |   35|  2.27M|        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|  2.27M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1083|      0|                printf("Post-intra[%d]: r=%d\n", b->intra, ts->msac.rng);
 1084|  2.27M|        }
 1085|  8.52M|    } else if (f->frame_hdr->allow_intrabc) {
  ------------------
  |  Branch (1085:16): [True: 7.39M, False: 1.13M]
  ------------------
 1086|  7.39M|        b->intra = !dav1d_msac_decode_bool_adapt(&ts->msac, ts->cdf.m.intrabc);
  ------------------
  |  |   52|  7.39M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1087|  7.39M|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  7.39M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 7.39M]
  |  |  ------------------
  |  |   35|  7.39M|        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|  7.39M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1088|      0|            printf("Post-intrabcflag[%d]: r=%d\n", b->intra, ts->msac.rng);
 1089|  7.39M|    } else {
 1090|  1.13M|        b->intra = 1;
 1091|  1.13M|    }
 1092|       |
 1093|       |    // intra/inter-specific stuff
 1094|  15.5M|    if (b->intra) {
  ------------------
  |  Branch (1094:9): [True: 7.93M, False: 7.60M]
  ------------------
 1095|  7.93M|        uint16_t *const ymode_cdf = IS_INTER_OR_SWITCH(f->frame_hdr) ?
  ------------------
  |  |   36|  7.93M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 328k, False: 7.61M]
  |  |  ------------------
  ------------------
 1096|   328k|            ts->cdf.m.y_mode[dav1d_ymode_size_context[bs]] :
 1097|  7.93M|            ts->cdf.kfym[dav1d_intra_mode_context[t->a->mode[bx4]]]
 1098|  7.61M|                        [dav1d_intra_mode_context[t->l.mode[by4]]];
 1099|  7.93M|        b->y_mode = dav1d_msac_decode_symbol_adapt16(&ts->msac, ymode_cdf,
  ------------------
  |  |   57|  7.93M|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1100|  7.93M|                                                     N_INTRA_PRED_MODES - 1);
 1101|  7.93M|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  7.93M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 7.93M]
  |  |  ------------------
  |  |   35|  7.93M|        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|  7.93M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1102|      0|            printf("Post-ymode[%d]: r=%d\n", b->y_mode, ts->msac.rng);
 1103|       |
 1104|       |        // angle delta
 1105|  7.93M|        if (b_dim[2] + b_dim[3] >= 2 && b->y_mode >= VERT_PRED &&
  ------------------
  |  Branch (1105:13): [True: 6.14M, False: 1.79M]
  |  Branch (1105:41): [True: 3.21M, False: 2.93M]
  ------------------
 1106|  3.21M|            b->y_mode <= VERT_LEFT_PRED)
  ------------------
  |  Branch (1106:13): [True: 1.77M, False: 1.43M]
  ------------------
 1107|  1.77M|        {
 1108|  1.77M|            uint16_t *const acdf = ts->cdf.m.angle_delta[b->y_mode - VERT_PRED];
 1109|  1.77M|            const int angle = dav1d_msac_decode_symbol_adapt8(&ts->msac, acdf, 6);
  ------------------
  |  |   48|  1.77M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1110|  1.77M|            b->y_angle = angle - 3;
 1111|  6.16M|        } else {
 1112|  6.16M|            b->y_angle = 0;
 1113|  6.16M|        }
 1114|       |
 1115|  7.93M|        if (has_chroma) {
  ------------------
  |  Branch (1115:13): [True: 6.69M, False: 1.24M]
  ------------------
 1116|  6.69M|            const int cfl_allowed = f->frame_hdr->segmentation.lossless[b->seg_id] ?
  ------------------
  |  Branch (1116:37): [True: 145k, False: 6.54M]
  ------------------
 1117|  6.54M|                cbw4 == 1 && cbh4 == 1 : !!(cfl_allowed_mask & (1 << bs));
  ------------------
  |  Branch (1117:17): [True: 99.2k, False: 46.0k]
  |  Branch (1117:30): [True: 95.4k, False: 3.72k]
  ------------------
 1118|  6.69M|            uint16_t *const uvmode_cdf = ts->cdf.m.uv_mode[cfl_allowed][b->y_mode];
 1119|  6.69M|            b->uv_mode = dav1d_msac_decode_symbol_adapt16(&ts->msac, uvmode_cdf,
  ------------------
  |  |   57|  6.69M|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1120|  6.69M|                             N_UV_INTRA_PRED_MODES - 1 - !cfl_allowed);
 1121|  6.69M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  6.69M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 6.69M]
  |  |  ------------------
  |  |   35|  6.69M|        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|  6.69M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1122|      0|                printf("Post-uvmode[%d]: r=%d\n", b->uv_mode, ts->msac.rng);
 1123|       |
 1124|  6.69M|            b->uv_angle = 0;
 1125|  6.69M|            if (b->uv_mode == CFL_PRED) {
  ------------------
  |  Branch (1125:17): [True: 1.26M, False: 5.42M]
  ------------------
 1126|  1.26M|                const int sign = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|  1.26M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1127|  1.26M|                                     ts->cdf.m.cfl_sign, 7) + 1;
 1128|  1.26M|                const int sign_u = sign * 0x56 >> 8, sign_v = sign - sign_u * 3;
 1129|  1.26M|                assert(sign_u == sign / 3);
  ------------------
  |  Branch (1129:17): [True: 1.27M, False: 18.4E]
  ------------------
 1130|  1.27M|                if (sign_u) {
  ------------------
  |  Branch (1130:21): [True: 1.16M, False: 101k]
  ------------------
 1131|  1.16M|                    const int ctx = (sign_u == 2) * 3 + sign_v;
 1132|  1.16M|                    const int alpha = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|  1.16M|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1133|  1.16M|                                          ts->cdf.m.cfl_alpha[ctx], 15) + 1;
 1134|  1.16M|                    b->cfl_alpha[0] = apply_sign_bool(alpha, sign_u & 1);
 1135|  1.16M|                } else {
 1136|   101k|                    b->cfl_alpha[0] = 0;
 1137|   101k|                }
 1138|  1.27M|                if (sign_v) {
  ------------------
  |  Branch (1138:21): [True: 934k, False: 336k]
  ------------------
 1139|   934k|                    const int ctx = (sign_v == 2) * 3 + sign_u;
 1140|   934k|                    const int alpha = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|   934k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1141|   934k|                                          ts->cdf.m.cfl_alpha[ctx], 15) + 1;
 1142|   934k|                    b->cfl_alpha[1] = apply_sign_bool(alpha, sign_v & 1);
 1143|   934k|                } else {
 1144|   336k|                    b->cfl_alpha[1] = 0;
 1145|   336k|                }
 1146|  1.27M|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.27M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.27M]
  |  |  ------------------
  |  |   35|  1.27M|        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.27M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1147|      0|                    printf("Post-uvalphas[%d/%d]: r=%d\n",
 1148|      0|                           b->cfl_alpha[0], b->cfl_alpha[1], ts->msac.rng);
 1149|  5.42M|            } else if (b_dim[2] + b_dim[3] >= 2 && b->uv_mode >= VERT_PRED &&
  ------------------
  |  Branch (1149:24): [True: 4.49M, False: 932k]
  |  Branch (1149:52): [True: 2.60M, False: 1.88M]
  ------------------
 1150|  2.60M|                       b->uv_mode <= VERT_LEFT_PRED)
  ------------------
  |  Branch (1150:24): [True: 1.36M, False: 1.24M]
  ------------------
 1151|  1.36M|            {
 1152|  1.36M|                uint16_t *const acdf = ts->cdf.m.angle_delta[b->uv_mode - VERT_PRED];
 1153|  1.36M|                const int angle = dav1d_msac_decode_symbol_adapt8(&ts->msac, acdf, 6);
  ------------------
  |  |   48|  1.36M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1154|  1.36M|                b->uv_angle = angle - 3;
 1155|  1.36M|            }
 1156|  6.69M|        }
 1157|       |
 1158|  7.94M|        b->pal_sz[0] = b->pal_sz[1] = 0;
 1159|  7.94M|        if (f->frame_hdr->allow_screen_content_tools &&
  ------------------
  |  Branch (1159:13): [True: 6.42M, False: 1.51M]
  ------------------
 1160|  6.42M|            imax(bw4, bh4) <= 16 && bw4 + bh4 >= 4)
  ------------------
  |  Branch (1160:13): [True: 6.17M, False: 257k]
  |  Branch (1160:37): [True: 4.89M, False: 1.27M]
  ------------------
 1161|  4.89M|        {
 1162|  4.89M|            const int sz_ctx = b_dim[2] + b_dim[3] - 2;
 1163|  4.89M|            if (b->y_mode == DC_PRED) {
  ------------------
  |  Branch (1163:17): [True: 2.37M, False: 2.52M]
  ------------------
 1164|  2.37M|                const int pal_ctx = (t->a->pal_sz[bx4] > 0) + (t->l.pal_sz[by4] > 0);
 1165|  2.37M|                const int use_y_pal = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  2.37M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1166|  2.37M|                                          ts->cdf.m.pal_y[sz_ctx][pal_ctx]);
 1167|  2.37M|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  2.37M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 2.37M]
  |  |  ------------------
  |  |   35|  2.37M|        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|  2.37M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1168|      0|                    printf("Post-y_pal[%d]: r=%d\n", use_y_pal, ts->msac.rng);
 1169|  2.37M|                if (use_y_pal)
  ------------------
  |  Branch (1169:21): [True: 229k, False: 2.14M]
  ------------------
 1170|   229k|                    f->bd_fn.read_pal_plane(t, b, 0, sz_ctx, bx4, by4);
 1171|  2.37M|            }
 1172|       |
 1173|  4.89M|            if (has_chroma && b->uv_mode == DC_PRED) {
  ------------------
  |  Branch (1173:17): [True: 4.41M, False: 474k]
  |  Branch (1173:31): [True: 1.48M, False: 2.93M]
  ------------------
 1174|  1.48M|                const int pal_ctx = b->pal_sz[0] > 0;
 1175|  1.48M|                const int use_uv_pal = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  1.48M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1176|  1.48M|                                           ts->cdf.m.pal_uv[pal_ctx]);
 1177|  1.48M|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.48M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.48M]
  |  |  ------------------
  |  |   35|  1.48M|        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.48M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1178|      0|                    printf("Post-uv_pal[%d]: r=%d\n", use_uv_pal, ts->msac.rng);
 1179|  1.48M|                if (use_uv_pal) // see aomedia bug 2183 for why we use luma coordinates
  ------------------
  |  Branch (1179:21): [True: 38.8k, False: 1.44M]
  ------------------
 1180|  38.8k|                    f->bd_fn.read_pal_uv(t, b, sz_ctx, bx4, by4);
 1181|  1.48M|            }
 1182|  4.89M|        }
 1183|       |
 1184|  7.94M|        if (b->y_mode == DC_PRED && !b->pal_sz[0] &&
  ------------------
  |  Branch (1184:13): [True: 3.59M, False: 4.34M]
  |  Branch (1184:37): [True: 3.36M, False: 225k]
  ------------------
 1185|  3.36M|            imax(b_dim[2], b_dim[3]) <= 3 && f->seq_hdr->filter_intra)
  ------------------
  |  Branch (1185:13): [True: 2.57M, False: 797k]
  |  Branch (1185:46): [True: 2.12M, False: 441k]
  ------------------
 1186|  2.12M|        {
 1187|  2.12M|            const int is_filter = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  2.12M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1188|  2.12M|                                      ts->cdf.m.use_filter_intra[bs]);
 1189|  2.12M|            if (is_filter) {
  ------------------
  |  Branch (1189:17): [True: 1.25M, False: 878k]
  ------------------
 1190|  1.25M|                b->y_mode = FILTER_PRED;
 1191|  1.25M|                b->y_angle = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|  1.25M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1192|  1.25M|                                 ts->cdf.m.filter_intra, 4);
 1193|  1.25M|            }
 1194|  2.12M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  2.12M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 2.12M]
  |  |  ------------------
  |  |   35|  2.12M|        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|  2.12M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1195|      0|                printf("Post-filterintramode[%d/%d]: r=%d\n",
 1196|      0|                       b->y_mode, b->y_angle, ts->msac.rng);
 1197|  2.12M|        }
 1198|       |
 1199|  7.94M|        if (b->pal_sz[0]) {
  ------------------
  |  Branch (1199:13): [True: 229k, False: 7.71M]
  ------------------
 1200|   229k|            uint8_t *pal_idx;
 1201|   229k|            if (t->frame_thread.pass) {
  ------------------
  |  Branch (1201:17): [True: 229k, False: 18.4E]
  ------------------
 1202|   229k|                const int p = t->frame_thread.pass & 1;
 1203|   229k|                assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  Branch (1203:17): [True: 229k, False: 18.4E]
  ------------------
 1204|   229k|                pal_idx = ts->frame_thread[p].pal_idx;
 1205|   229k|                ts->frame_thread[p].pal_idx += bw4 * bh4 * 8;
 1206|   229k|            } else
 1207|  18.4E|                pal_idx = t->scratch.pal_idx_y;
 1208|   229k|            read_pal_indices(t, pal_idx, b->pal_sz[0], 0, w4, h4, bw4, bh4);
 1209|   229k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   229k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 229k]
  |  |  ------------------
  |  |   35|   229k|        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|   229k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1210|      0|                printf("Post-y-pal-indices: r=%d\n", ts->msac.rng);
 1211|   229k|        }
 1212|       |
 1213|  7.94M|        if (has_chroma && b->pal_sz[1]) {
  ------------------
  |  Branch (1213:13): [True: 6.67M, False: 1.26M]
  |  Branch (1213:27): [True: 38.8k, False: 6.63M]
  ------------------
 1214|  38.8k|            uint8_t *pal_idx;
 1215|  38.8k|            if (t->frame_thread.pass) {
  ------------------
  |  Branch (1215:17): [True: 38.8k, False: 0]
  ------------------
 1216|  38.8k|                const int p = t->frame_thread.pass & 1;
 1217|  38.8k|                assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  Branch (1217:17): [True: 38.8k, False: 0]
  ------------------
 1218|  38.8k|                pal_idx = ts->frame_thread[p].pal_idx;
 1219|  38.8k|                ts->frame_thread[p].pal_idx += cbw4 * cbh4 * 8;
 1220|  38.8k|            } else
 1221|      0|                pal_idx = t->scratch.pal_idx_uv;
 1222|  38.8k|            read_pal_indices(t, pal_idx, b->pal_sz[1], 1, cw4, ch4, cbw4, cbh4);
 1223|  38.8k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  38.8k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 38.8k]
  |  |  ------------------
  |  |   35|  38.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|  38.8k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1224|      0|                printf("Post-uv-pal-indices: r=%d\n", ts->msac.rng);
 1225|  38.8k|        }
 1226|       |
 1227|  7.94M|        const TxfmInfo *t_dim;
 1228|  7.94M|        if (f->frame_hdr->segmentation.lossless[b->seg_id]) {
  ------------------
  |  Branch (1228:13): [True: 317k, False: 7.62M]
  ------------------
 1229|   317k|            b->tx = b->uvtx = (int) TX_4X4;
 1230|   317k|            t_dim = &dav1d_txfm_dimensions[TX_4X4];
 1231|  7.62M|        } else {
 1232|  7.62M|            b->tx = dav1d_max_txfm_size_for_bs[bs][0];
 1233|  7.62M|            b->uvtx = dav1d_max_txfm_size_for_bs[bs][f->cur.p.layout];
 1234|  7.62M|            t_dim = &dav1d_txfm_dimensions[b->tx];
 1235|  7.62M|            if (f->frame_hdr->txfm_mode == DAV1D_TX_SWITCHABLE && t_dim->max > TX_4X4) {
  ------------------
  |  Branch (1235:17): [True: 868k, False: 6.75M]
  |  Branch (1235:67): [True: 772k, False: 95.9k]
  ------------------
 1236|   772k|                const int tctx = get_tx_ctx(t->a, &t->l, t_dim, by4, bx4);
 1237|   772k|                uint16_t *const tx_cdf = ts->cdf.m.txsz[t_dim->max - 1][tctx];
 1238|   772k|                int depth = dav1d_msac_decode_symbol_adapt4(&ts->msac, tx_cdf,
  ------------------
  |  |   47|   772k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1239|   772k|                                imin(t_dim->max, 2));
 1240|       |
 1241|  1.19M|                while (depth--) {
  ------------------
  |  Branch (1241:24): [True: 421k, False: 772k]
  ------------------
 1242|   421k|                    b->tx = t_dim->sub;
 1243|   421k|                    t_dim = &dav1d_txfm_dimensions[b->tx];
 1244|   421k|                }
 1245|   772k|            }
 1246|  7.62M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  7.62M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 7.62M]
  |  |  ------------------
  |  |   35|  7.62M|        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|  7.62M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1247|      0|                printf("Post-tx[%d]: r=%d\n", b->tx, ts->msac.rng);
 1248|  7.62M|        }
 1249|       |
 1250|       |        // reconstruction
 1251|  7.94M|        if (t->frame_thread.pass == 1) {
  ------------------
  |  Branch (1251:13): [True: 7.91M, False: 24.2k]
  ------------------
 1252|  7.91M|            f->bd_fn.read_coef_blocks(t, bs, b);
 1253|  7.91M|        } else {
 1254|  24.2k|            f->bd_fn.recon_b_intra(t, bs, intra_edge_flags, b);
 1255|  24.2k|        }
 1256|       |
 1257|  7.94M|        if (f->frame_hdr->loopfilter.level_y[0] ||
  ------------------
  |  Branch (1257:13): [True: 1.37M, False: 6.56M]
  ------------------
 1258|  6.56M|            f->frame_hdr->loopfilter.level_y[1])
  ------------------
  |  Branch (1258:13): [True: 116k, False: 6.45M]
  ------------------
 1259|  1.33M|        {
 1260|  1.33M|            dav1d_create_lf_mask_intra(&t->c->lf_mask_dsp, t->lf_mask, f->lf.level,
 1261|  1.33M|                                       f->b4_stride,
 1262|  1.33M|                                       (const uint8_t (*)[8][2])
 1263|  1.33M|                                       &ts->lflvl[b->seg_id][0][0][0],
 1264|  1.33M|                                       t->bx, t->by, f->w4, f->h4, bs,
 1265|  1.33M|                                       b->tx, b->uvtx, f->cur.p.layout,
 1266|  1.33M|                                       &t->a->tx_lpf_y[bx4], &t->l.tx_lpf_y[by4],
 1267|  1.33M|                                       has_chroma ? &t->a->tx_lpf_uv[cbx4] : NULL,
  ------------------
  |  Branch (1267:40): [True: 981k, False: 356k]
  ------------------
 1268|  1.33M|                                       has_chroma ? &t->l.tx_lpf_uv[cby4] : NULL);
  ------------------
  |  Branch (1268:40): [True: 981k, False: 355k]
  ------------------
 1269|  1.33M|        }
 1270|       |        // update contexts
 1271|  7.94M|        const enum IntraPredMode y_mode_nofilt =
 1272|  7.94M|            b->y_mode == FILTER_PRED ? DC_PRED : b->y_mode;
  ------------------
  |  Branch (1272:13): [True: 1.24M, False: 6.69M]
  ------------------
 1273|  7.94M|        BlockContext *edge = t->a;
 1274|  23.5M|        for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (1274:36): [True: 15.5M, False: 8.01M]
  ------------------
 1275|  15.5M|            int t_lsz = ((uint8_t *) &t_dim->lw)[i]; // lw then lh
 1276|  15.5M|#define set_ctx(rep_macro) \
 1277|  15.5M|            rep_macro(edge->tx_intra, off, t_lsz); \
 1278|  15.5M|            rep_macro(edge->tx, off, t_lsz); \
 1279|  15.5M|            rep_macro(edge->mode, off, y_mode_nofilt); \
 1280|  15.5M|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
 1281|  15.5M|            rep_macro(edge->seg_pred, off, seg_pred); \
 1282|  15.5M|            rep_macro(edge->skip_mode, off, 0); \
 1283|  15.5M|            rep_macro(edge->intra, off, 1); \
 1284|  15.5M|            rep_macro(edge->skip, off, b->skip); \
 1285|       |            /* see aomedia bug 2183 for why we use luma coordinates here */ \
 1286|  15.5M|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
 1287|  15.5M|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
 1288|  15.5M|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
 1289|  15.5M|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
 1290|  15.5M|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
 1291|  15.5M|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
 1292|  15.5M|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
 1293|  15.5M|            }
 1294|  15.6M|            case_set(b_dim[2 + i]);
  ------------------
  |  |   70|  15.5M|    switch (var) { \
  |  |   71|  3.43M|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 1277|  3.43M|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  3.43M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  3.43M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1278|  3.43M|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  3.43M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  3.43M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1279|  3.43M|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  3.43M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  3.43M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1280|  3.43M|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  3.43M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  3.43M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1281|  3.43M|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  3.43M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  3.43M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1282|  3.43M|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  3.43M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  3.43M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1283|  3.43M|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  3.43M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  3.43M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1284|  3.43M|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  3.43M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  3.43M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1285|  3.43M|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1286|  3.43M|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  3.43M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  6.86M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (56:43): [True: 2.50M, False: 921k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1287|  3.43M|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  3.43M|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 160k, False: 3.27M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1288|   160k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   160k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   160k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1289|   160k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   160k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   160k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1290|   160k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   160k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   160k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1291|   160k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   160k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   160k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1292|   160k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   160k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   160k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1293|   160k|            }
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 3.43M, False: 12.1M]
  |  |  ------------------
  |  |   72|  4.75M|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 1277|  4.75M|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  4.75M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  4.75M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1278|  4.75M|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  4.75M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  4.75M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1279|  4.75M|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  4.75M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  4.75M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1280|  4.75M|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  4.75M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  4.75M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1281|  4.75M|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  4.75M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  4.75M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1282|  4.75M|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  4.75M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  4.75M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1283|  4.75M|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  4.75M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  4.75M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1284|  4.75M|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  4.75M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  4.75M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1285|  4.75M|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1286|  4.75M|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  4.75M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  9.50M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (58:45): [True: 4.44M, False: 302k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1287|  4.75M|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  4.75M|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 206k, False: 4.54M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1288|   206k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   206k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   206k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1289|   206k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   206k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   206k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1290|   206k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   206k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   206k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1291|   206k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   206k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   206k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1292|   206k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   206k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   206k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1293|   206k|            }
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 4.75M, False: 10.8M]
  |  |  ------------------
  |  |   73|  3.65M|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 1277|  3.65M|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  3.65M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  3.65M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1278|  3.65M|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  3.65M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  3.65M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1279|  3.65M|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  3.65M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  3.65M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1280|  3.65M|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  3.65M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  3.65M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1281|  3.65M|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  3.65M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  3.65M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1282|  3.65M|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  3.65M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  3.65M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1283|  3.65M|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  3.65M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  3.65M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1284|  3.65M|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  3.65M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  3.65M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1285|  3.65M|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1286|  3.65M|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  3.65M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  7.31M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:45): [True: 3.39M, False: 264k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1287|  3.65M|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  3.65M|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 166k, False: 3.49M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1288|   166k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   166k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   166k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1289|   166k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   166k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   166k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1290|   166k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   166k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   166k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1291|   166k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   166k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   166k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1292|   166k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   166k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   166k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1293|   166k|            }
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 3.65M, False: 11.8M]
  |  |  ------------------
  |  |   74|  2.27M|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 1277|  2.27M|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  2.27M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  2.27M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1278|  2.27M|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  2.27M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  2.27M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1279|  2.27M|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  2.27M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  2.27M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1280|  2.27M|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  2.27M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  2.27M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1281|  2.27M|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  2.27M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  2.27M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1282|  2.27M|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  2.27M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  2.27M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1283|  2.27M|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  2.27M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  2.27M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1284|  2.27M|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  2.27M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  2.27M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1285|  2.27M|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1286|  2.27M|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  2.27M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  4.55M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (62:45): [True: 2.16M, False: 114k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1287|  2.27M|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  2.27M|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 58.3k, False: 2.21M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1288|  58.3k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  58.3k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  58.3k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1289|  58.3k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  58.3k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  58.3k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1290|  58.3k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  58.3k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  58.3k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1291|  58.3k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  58.3k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  58.3k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1292|  58.3k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  58.3k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  58.3k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1293|  58.3k|            }
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 2.27M, False: 13.2M]
  |  |  ------------------
  |  |   75|  1.34M|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 1277|  1.34M|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.34M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.34M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.34M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.34M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1278|  1.34M|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.34M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.34M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.34M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.34M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1279|  1.34M|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.34M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.34M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.34M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.34M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1280|  1.34M|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.34M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.34M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.34M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.34M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1281|  1.34M|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.34M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.34M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.34M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.34M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1282|  1.34M|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.34M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.34M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.34M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.34M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1283|  1.34M|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.34M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.34M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.34M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.34M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1284|  1.34M|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.34M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.34M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.34M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.34M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1285|  1.34M|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1286|  1.34M|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  1.34M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.34M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.69M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:29): [True: 563k, False: 785k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   65|  1.34M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1287|  1.34M|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  1.34M|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 42.9k, False: 1.30M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1288|  42.9k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  42.9k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  42.9k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  42.9k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  42.9k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 42.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1289|  42.9k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  42.9k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  42.9k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  42.9k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  42.9k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 42.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1290|  42.9k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  42.9k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  42.9k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  42.9k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  42.9k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 42.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1291|  42.9k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  42.9k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  42.9k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  42.9k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  42.9k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 42.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1292|  42.9k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  42.9k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  42.9k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  42.9k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  42.9k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 42.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1293|  42.9k|            }
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 1.34M, False: 14.2M]
  |  |  ------------------
  |  |   76|   556k|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  | 1277|   556k|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   556k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   556k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   556k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   556k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 556k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1278|   556k|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   556k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   556k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   556k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   556k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 556k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1279|   556k|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   556k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   556k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   556k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   556k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 556k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1280|   556k|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   556k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   556k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   556k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   556k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 556k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1281|   556k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   556k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   556k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   556k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   556k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 556k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1282|   556k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   556k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   556k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   556k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   556k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 556k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1283|   556k|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   556k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   556k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   556k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   556k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 556k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1284|   556k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   556k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   556k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   556k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   556k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 556k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1285|   556k|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1286|   556k|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   556k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   556k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  1.11M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (67:29): [True: 463k, False: 92.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   68|   556k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 556k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1287|   556k|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   556k|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 23.5k, False: 532k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1288|  23.5k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  23.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  23.5k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  23.5k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  23.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 23.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1289|  23.5k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  23.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  23.5k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  23.5k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  23.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 23.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1290|  23.5k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  23.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  23.5k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  23.5k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  23.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 23.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1291|  23.5k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  23.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  23.5k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  23.5k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  23.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 23.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1292|  23.5k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  23.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  23.5k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  23.5k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  23.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 23.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1293|  23.5k|            }
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 556k, False: 14.9M]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 15.5M]
  |  |  ------------------
  |  |   78|  15.5M|    }
  ------------------
  |  Branch (1294:13): [Folded, False: 0]
  ------------------
 1295|  15.6M|#undef set_ctx
 1296|  15.6M|        }
 1297|  8.01M|        if (b->pal_sz[0])
  ------------------
  |  Branch (1297:13): [True: 228k, False: 7.78M]
  ------------------
 1298|   228k|            f->bd_fn.copy_pal_block_y(t, bx4, by4, bw4, bh4);
 1299|  8.01M|        if (has_chroma) {
  ------------------
  |  Branch (1299:13): [True: 6.60M, False: 1.40M]
  ------------------
 1300|  6.60M|            uint8_t uv_mode = b->uv_mode;
 1301|  6.60M|            dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], uv_mode);
 1302|  6.60M|            dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], uv_mode);
 1303|  6.60M|            if (b->pal_sz[1])
  ------------------
  |  Branch (1303:17): [True: 38.8k, False: 6.56M]
  ------------------
 1304|  38.8k|                f->bd_fn.copy_pal_block_uv(t, bx4, by4, bw4, bh4);
 1305|  6.60M|        }
 1306|  8.01M|        if (IS_INTER_OR_SWITCH(f->frame_hdr) || f->frame_hdr->allow_intrabc)
  ------------------
  |  |   36|  16.0M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 548k, False: 7.46M]
  |  |  ------------------
  ------------------
  |  Branch (1306:49): [True: 5.93M, False: 1.53M]
  ------------------
 1307|  6.27M|            splat_intraref(f->c, t, bs, bw4, bh4);
 1308|  8.01M|    } else if (IS_KEY_OR_INTRA(f->frame_hdr)) {
  ------------------
  |  |   43|  7.60M|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  7.60M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 1.40M, False: 6.19M]
  |  |  ------------------
  ------------------
 1309|       |        // intra block copy
 1310|  1.40M|        refmvs_candidate mvstack[8];
 1311|  1.40M|        int n_mvs, ctx;
 1312|  1.40M|        dav1d_refmvs_find(&t->rt, mvstack, &n_mvs, &ctx,
 1313|  1.40M|                          (union refmvs_refpair) { .ref = { 0, -1 }},
 1314|  1.40M|                          bs, intra_edge_flags, t->by, t->bx);
 1315|       |
 1316|  1.40M|        if (mvstack[0].mv.mv[0].n)
  ------------------
  |  Branch (1316:13): [True: 1.04M, False: 356k]
  ------------------
 1317|  1.04M|            b->mv[0] = mvstack[0].mv.mv[0];
 1318|   356k|        else if (mvstack[1].mv.mv[0].n)
  ------------------
  |  Branch (1318:18): [True: 0, False: 356k]
  ------------------
 1319|      0|            b->mv[0] = mvstack[1].mv.mv[0];
 1320|   356k|        else {
 1321|   373k|            if (t->by - (16 << f->seq_hdr->sb128) < ts->tiling.row_start) {
  ------------------
  |  Branch (1321:17): [True: 373k, False: 18.4E]
  ------------------
 1322|   373k|                b->mv[0].y = 0;
 1323|   373k|                b->mv[0].x = -(512 << f->seq_hdr->sb128) - 2048;
 1324|  18.4E|            } else {
 1325|  18.4E|                b->mv[0].y = -(512 << f->seq_hdr->sb128);
 1326|  18.4E|                b->mv[0].x = 0;
 1327|  18.4E|            }
 1328|   356k|        }
 1329|       |
 1330|  1.40M|        const union mv ref = b->mv[0];
 1331|  1.40M|        read_mv_residual(ts, &b->mv[0], -1);
 1332|       |
 1333|       |        // clip intrabc motion vector to decoded parts of current tile
 1334|  1.40M|        int border_left = ts->tiling.col_start * 4;
 1335|  1.40M|        int border_top  = ts->tiling.row_start * 4;
 1336|  1.40M|        if (has_chroma) {
  ------------------
  |  Branch (1336:13): [True: 1.32M, False: 76.3k]
  ------------------
 1337|  1.32M|            if (bw4 < 2 &&  ss_hor)
  ------------------
  |  Branch (1337:17): [True: 432k, False: 894k]
  |  Branch (1337:29): [True: 16.1k, False: 416k]
  ------------------
 1338|  16.1k|                border_left += 4;
 1339|  1.32M|            if (bh4 < 2 &&  ss_ver)
  ------------------
  |  Branch (1339:17): [True: 433k, False: 893k]
  |  Branch (1339:29): [True: 21.6k, False: 411k]
  ------------------
 1340|  21.6k|                border_top  += 4;
 1341|  1.32M|        }
 1342|  1.40M|        int src_left   = t->bx * 4 + (b->mv[0].x >> 3);
 1343|  1.40M|        int src_top    = t->by * 4 + (b->mv[0].y >> 3);
 1344|  1.40M|        int src_right  = src_left + bw4 * 4;
 1345|  1.40M|        int src_bottom = src_top  + bh4 * 4;
 1346|  1.40M|        const int border_right = ((ts->tiling.col_end + (bw4 - 1)) & ~(bw4 - 1)) * 4;
 1347|       |
 1348|       |        // check against left or right tile boundary and adjust if necessary
 1349|  1.40M|        if (src_left < border_left) {
  ------------------
  |  Branch (1349:13): [True: 229k, False: 1.17M]
  ------------------
 1350|   229k|            src_right += border_left - src_left;
 1351|   229k|            src_left  += border_left - src_left;
 1352|  1.17M|        } else if (src_right > border_right) {
  ------------------
  |  Branch (1352:20): [True: 318k, False: 855k]
  ------------------
 1353|   318k|            src_left  -= src_right - border_right;
 1354|   318k|            src_right -= src_right - border_right;
 1355|   318k|        }
 1356|       |        // check against top tile boundary and adjust if necessary
 1357|  1.40M|        if (src_top < border_top) {
  ------------------
  |  Branch (1357:13): [True: 801k, False: 602k]
  ------------------
 1358|   801k|            src_bottom += border_top - src_top;
 1359|   801k|            src_top    += border_top - src_top;
 1360|   801k|        }
 1361|       |
 1362|  1.40M|        const int sbx = (t->bx >> (4 + f->seq_hdr->sb128)) << (6 + f->seq_hdr->sb128);
 1363|  1.40M|        const int sby = (t->by >> (4 + f->seq_hdr->sb128)) << (6 + f->seq_hdr->sb128);
 1364|  1.40M|        const int sb_size = 1 << (6 + f->seq_hdr->sb128);
 1365|       |        // check for overlap with current superblock
 1366|  1.40M|        if (src_bottom > sby && src_right > sbx) {
  ------------------
  |  Branch (1366:13): [True: 1.40M, False: 18.4E]
  |  Branch (1366:33): [True: 331k, False: 1.07M]
  ------------------
 1367|   330k|            if (src_top - border_top >= src_bottom - sby) {
  ------------------
  |  Branch (1367:17): [True: 758, False: 330k]
  ------------------
 1368|       |                // if possible move src up into the previous suberblock row
 1369|    758|                src_top    -= src_bottom - sby;
 1370|    758|                src_bottom -= src_bottom - sby;
 1371|   330k|            } else if (src_left - border_left >= src_right - sbx) {
  ------------------
  |  Branch (1371:24): [True: 317k, False: 12.9k]
  ------------------
 1372|       |                // if possible move src left into the previous suberblock
 1373|   317k|                src_left  -= src_right - sbx;
 1374|   317k|                src_right -= src_right - sbx;
 1375|   317k|            }
 1376|   330k|        }
 1377|       |        // move src up if it is below current superblock row
 1378|  1.40M|        if (src_bottom > sby + sb_size) {
  ------------------
  |  Branch (1378:13): [True: 13.5k, False: 1.38M]
  ------------------
 1379|  13.5k|            src_top    -= src_bottom - (sby + sb_size);
 1380|  13.5k|            src_bottom -= src_bottom - (sby + sb_size);
 1381|  13.5k|        }
 1382|       |        // error out if mv still overlaps with the current superblock
 1383|  1.40M|        if (src_bottom > sby && src_right > sbx)
  ------------------
  |  Branch (1383:13): [True: 1.40M, False: 246]
  |  Branch (1383:33): [True: 12.7k, False: 1.39M]
  ------------------
 1384|  12.7k|            return -1;
 1385|       |
 1386|  1.39M|        b->mv[0].x = (src_left - t->bx * 4) * 8;
 1387|  1.39M|        b->mv[0].y = (src_top  - t->by * 4) * 8;
 1388|       |
 1389|  1.39M|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.39M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.39M]
  |  |  ------------------
  |  |   35|  1.39M|        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.39M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1390|      0|            printf("Post-dmv[%d/%d,ref=%d/%d|%d/%d]: r=%d\n",
 1391|      0|                   b->mv[0].y, b->mv[0].x, ref.y, ref.x,
 1392|      0|                   mvstack[0].mv.mv[0].y, mvstack[0].mv.mv[0].x, ts->msac.rng);
 1393|  1.39M|        read_vartx_tree(t, b, bs, bx4, by4);
 1394|       |
 1395|       |        // reconstruction
 1396|  1.39M|        if (t->frame_thread.pass == 1) {
  ------------------
  |  Branch (1396:13): [True: 1.39M, False: 18.4E]
  ------------------
 1397|  1.39M|            f->bd_fn.read_coef_blocks(t, bs, b);
 1398|  1.39M|            b->filter2d = FILTER_2D_BILINEAR;
 1399|  18.4E|        } else {
 1400|  18.4E|            if (f->bd_fn.recon_b_inter(t, bs, b)) return -1;
  ------------------
  |  Branch (1400:17): [True: 0, False: 18.4E]
  ------------------
 1401|  18.4E|        }
 1402|       |
 1403|  1.39M|        splat_intrabc_mv(f->c, t, bs, b, bw4, bh4);
 1404|  1.39M|        BlockContext *edge = t->a;
 1405|  4.19M|        for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (1405:36): [True: 2.80M, False: 1.39M]
  ------------------
 1406|  2.80M|#define set_ctx(rep_macro) \
 1407|  2.80M|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
 1408|  2.80M|            rep_macro(edge->mode, off, DC_PRED); \
 1409|  2.80M|            rep_macro(edge->pal_sz, off, 0); \
 1410|       |            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
 1411|  2.80M|            rep_macro(t->pal_sz_uv[i], off, 0); \
 1412|  2.80M|            rep_macro(edge->seg_pred, off, seg_pred); \
 1413|  2.80M|            rep_macro(edge->skip_mode, off, 0); \
 1414|  2.80M|            rep_macro(edge->intra, off, 0); \
 1415|  2.80M|            rep_macro(edge->skip, off, b->skip)
 1416|  2.80M|            case_set(b_dim[2 + i]);
  ------------------
  |  |   70|  2.80M|    switch (var) { \
  |  |   71|   988k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 1407|   988k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   988k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   988k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1408|   988k|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   988k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   988k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1409|   988k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   988k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   988k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1410|   988k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1411|   988k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   988k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   988k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1412|   988k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   988k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   988k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1413|   988k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   988k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   988k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1414|   988k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   988k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   988k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1415|   988k|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   988k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   988k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 988k, False: 1.82M]
  |  |  ------------------
  |  |   72|   486k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 1407|   486k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   486k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   486k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1408|   486k|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   486k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   486k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1409|   486k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   486k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   486k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1410|   486k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1411|   486k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   486k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   486k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1412|   486k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   486k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   486k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1413|   486k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   486k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   486k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1414|   486k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   486k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   486k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1415|   486k|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   486k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   486k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 486k, False: 2.32M]
  |  |  ------------------
  |  |   73|   519k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 1407|   519k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   519k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   519k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1408|   519k|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   519k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   519k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1409|   519k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   519k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   519k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1410|   519k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1411|   519k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   519k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   519k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1412|   519k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   519k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   519k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1413|   519k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   519k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   519k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1414|   519k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   519k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   519k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1415|   519k|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   519k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   519k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 519k, False: 2.28M]
  |  |  ------------------
  |  |   74|   297k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 1407|   297k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   297k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   297k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1408|   297k|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   297k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   297k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1409|   297k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   297k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   297k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1410|   297k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1411|   297k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   297k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   297k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1412|   297k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   297k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   297k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1413|   297k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   297k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   297k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1414|   297k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   297k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   297k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1415|   297k|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   297k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   297k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 297k, False: 2.51M]
  |  |  ------------------
  |  |   75|   452k|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 1407|   452k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   452k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   452k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   452k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   452k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 452k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1408|   452k|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   452k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   452k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   452k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   452k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 452k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1409|   452k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   452k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   452k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   452k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   452k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 452k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1410|   452k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1411|   452k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   452k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   452k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   452k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   452k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 452k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1412|   452k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   452k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   452k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   452k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   452k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 452k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1413|   452k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   452k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   452k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   452k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   452k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 452k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1414|   452k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   452k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   452k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   452k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   452k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 452k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1415|   452k|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   452k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   452k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   452k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   452k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 452k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 452k, False: 2.35M]
  |  |  ------------------
  |  |   76|  82.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  | 1407|  82.5k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  82.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  82.5k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  82.5k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  82.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 82.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1408|  82.5k|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  82.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  82.5k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  82.5k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  82.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 82.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1409|  82.5k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  82.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  82.5k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  82.5k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  82.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 82.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1410|  82.5k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1411|  82.5k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  82.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  82.5k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  82.5k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  82.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 82.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1412|  82.5k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  82.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  82.5k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  82.5k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  82.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 82.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1413|  82.5k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  82.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  82.5k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  82.5k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  82.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 82.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1414|  82.5k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  82.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  82.5k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  82.5k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  82.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 82.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1415|  82.5k|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  82.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  82.5k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  82.5k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  82.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 82.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 82.5k, False: 2.72M]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 2.80M]
  |  |  ------------------
  |  |   78|  2.80M|    }
  ------------------
  |  Branch (1416:13): [Folded, False: 0]
  ------------------
 1417|  2.80M|#undef set_ctx
 1418|  2.80M|        }
 1419|  1.39M|        if (has_chroma) {
  ------------------
  |  Branch (1419:13): [True: 1.31M, False: 73.6k]
  ------------------
 1420|  1.31M|            dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], DC_PRED);
 1421|  1.31M|            dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], DC_PRED);
 1422|  1.31M|        }
 1423|  6.19M|    } else {
 1424|       |        // inter-specific mode/mv coding
 1425|  6.19M|        int is_comp, has_subpel_filter;
 1426|       |
 1427|  6.19M|        if (b->skip_mode) {
  ------------------
  |  Branch (1427:13): [True: 25.0k, False: 6.17M]
  ------------------
 1428|  25.0k|            is_comp = 1;
 1429|  6.17M|        } else if ((!seg || (seg->ref == -1 && !seg->globalmv && !seg->skip)) &&
  ------------------
  |  Branch (1429:21): [True: 1.24M, False: 4.92M]
  |  Branch (1429:30): [True: 4.66M, False: 265k]
  |  Branch (1429:48): [True: 224k, False: 4.43M]
  |  Branch (1429:66): [True: 188k, False: 35.4k]
  ------------------
 1430|  1.92M|                   f->frame_hdr->switchable_comp_refs && imin(bw4, bh4) > 1)
  ------------------
  |  Branch (1430:20): [True: 1.04M, False: 874k]
  |  Branch (1430:58): [True: 779k, False: 270k]
  ------------------
 1431|   779k|        {
 1432|   779k|            const int ctx = get_comp_ctx(t->a, &t->l, by4, bx4,
 1433|   779k|                                         have_top, have_left);
 1434|   779k|            is_comp = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   779k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1435|   779k|                          ts->cdf.m.comp[ctx]);
 1436|   779k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   779k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 779k]
  |  |  ------------------
  |  |   35|   779k|        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|   779k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1437|      0|                printf("Post-compflag[%d]: r=%d\n", is_comp, ts->msac.rng);
 1438|  5.39M|        } else {
 1439|  5.39M|            is_comp = 0;
 1440|  5.39M|        }
 1441|       |
 1442|  6.19M|        if (b->skip_mode) {
  ------------------
  |  Branch (1442:13): [True: 25.0k, False: 6.17M]
  ------------------
 1443|  25.0k|            b->ref[0] = f->frame_hdr->skip_mode_refs[0];
 1444|  25.0k|            b->ref[1] = f->frame_hdr->skip_mode_refs[1];
 1445|  25.0k|            b->comp_type = COMP_INTER_AVG;
 1446|  25.0k|            b->inter_mode = NEARESTMV_NEARESTMV;
 1447|  25.0k|            b->drl_idx = NEAREST_DRL;
 1448|  25.0k|            has_subpel_filter = 0;
 1449|       |
 1450|  25.0k|            refmvs_candidate mvstack[8];
 1451|  25.0k|            int n_mvs, ctx;
 1452|  25.0k|            dav1d_refmvs_find(&t->rt, mvstack, &n_mvs, &ctx,
 1453|  25.0k|                              (union refmvs_refpair) { .ref = {
 1454|  25.0k|                                    b->ref[0] + 1, b->ref[1] + 1 }},
 1455|  25.0k|                              bs, intra_edge_flags, t->by, t->bx);
 1456|       |
 1457|  25.0k|            b->mv[0] = mvstack[0].mv.mv[0];
 1458|  25.0k|            b->mv[1] = mvstack[0].mv.mv[1];
 1459|  25.0k|            fix_mv_precision(f->frame_hdr, &b->mv[0]);
 1460|  25.0k|            fix_mv_precision(f->frame_hdr, &b->mv[1]);
 1461|  25.0k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  25.0k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 25.0k]
  |  |  ------------------
  |  |   35|  25.0k|        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|  25.0k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1462|      0|                printf("Post-skipmodeblock[mv=1:y=%d,x=%d,2:y=%d,x=%d,refs=%d+%d\n",
 1463|      0|                       b->mv[0].y, b->mv[0].x, b->mv[1].y, b->mv[1].x,
 1464|      0|                       b->ref[0], b->ref[1]);
 1465|  6.17M|        } else if (is_comp) {
  ------------------
  |  Branch (1465:20): [True: 313k, False: 5.85M]
  ------------------
 1466|   313k|            const int dir_ctx = get_comp_dir_ctx(t->a, &t->l, by4, bx4,
 1467|   313k|                                                 have_top, have_left);
 1468|   313k|            if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   313k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1468:17): [True: 231k, False: 82.2k]
  ------------------
 1469|   313k|                    ts->cdf.m.comp_dir[dir_ctx]))
 1470|   231k|            {
 1471|       |                // bidir - first reference (fw)
 1472|   231k|                const int ctx1 = av1_get_fwd_ref_ctx(t->a, &t->l, by4, bx4,
 1473|   231k|                                                     have_top, have_left);
 1474|   231k|                if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   231k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1474:21): [True: 71.2k, False: 159k]
  ------------------
 1475|   231k|                        ts->cdf.m.comp_fwd_ref[0][ctx1]))
 1476|  71.2k|                {
 1477|  71.2k|                    const int ctx2 = av1_get_fwd_ref_2_ctx(t->a, &t->l, by4, bx4,
 1478|  71.2k|                                                           have_top, have_left);
 1479|  71.2k|                    b->ref[0] = 2 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  71.2k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1480|  71.2k|                                        ts->cdf.m.comp_fwd_ref[2][ctx2]);
 1481|   159k|                } else {
 1482|   159k|                    const int ctx2 = av1_get_fwd_ref_1_ctx(t->a, &t->l, by4, bx4,
 1483|   159k|                                                           have_top, have_left);
 1484|   159k|                    b->ref[0] = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   159k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1485|   159k|                                    ts->cdf.m.comp_fwd_ref[1][ctx2]);
 1486|   159k|                }
 1487|       |
 1488|       |                // second reference (bw)
 1489|   231k|                const int ctx3 = av1_get_bwd_ref_ctx(t->a, &t->l, by4, bx4,
 1490|   231k|                                                     have_top, have_left);
 1491|   231k|                if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   231k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1491:21): [True: 139k, False: 91.6k]
  ------------------
 1492|   231k|                        ts->cdf.m.comp_bwd_ref[0][ctx3]))
 1493|   139k|                {
 1494|   139k|                    b->ref[1] = 6;
 1495|   139k|                } else {
 1496|  91.6k|                    const int ctx4 = av1_get_bwd_ref_1_ctx(t->a, &t->l, by4, bx4,
 1497|  91.6k|                                                           have_top, have_left);
 1498|  91.6k|                    b->ref[1] = 4 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  91.6k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1499|  91.6k|                                        ts->cdf.m.comp_bwd_ref[1][ctx4]);
 1500|  91.6k|                }
 1501|   231k|            } else {
 1502|       |                // unidir
 1503|  82.2k|                const int uctx_p = av1_get_uni_p_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  280|  82.2k|#define av1_get_uni_p_ctx av1_get_ref_ctx
  ------------------
 1504|  82.2k|                                                     have_top, have_left);
 1505|  82.2k|                if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  82.2k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1505:21): [True: 20.3k, False: 61.9k]
  ------------------
 1506|  82.2k|                        ts->cdf.m.comp_uni_ref[0][uctx_p]))
 1507|  20.3k|                {
 1508|  20.3k|                    b->ref[0] = 4;
 1509|  20.3k|                    b->ref[1] = 6;
 1510|  61.9k|                } else {
 1511|  61.9k|                    const int uctx_p1 = av1_get_uni_p1_ctx(t->a, &t->l, by4, bx4,
 1512|  61.9k|                                                           have_top, have_left);
 1513|  61.9k|                    b->ref[0] = 0;
 1514|  61.9k|                    b->ref[1] = 1 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  61.9k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1515|  61.9k|                                        ts->cdf.m.comp_uni_ref[1][uctx_p1]);
 1516|  61.9k|                    if (b->ref[1] == 2) {
  ------------------
  |  Branch (1516:25): [True: 40.5k, False: 21.4k]
  ------------------
 1517|  40.5k|                        const int uctx_p2 = av1_get_uni_p2_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  281|  40.5k|#define av1_get_uni_p2_ctx av1_get_fwd_ref_2_ctx
  ------------------
 1518|  40.5k|                                                               have_top, have_left);
 1519|  40.5k|                        b->ref[1] += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  40.5k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1520|  40.5k|                                         ts->cdf.m.comp_uni_ref[2][uctx_p2]);
 1521|  40.5k|                    }
 1522|  61.9k|                }
 1523|  82.2k|            }
 1524|   313k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   313k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 313k]
  |  |  ------------------
  |  |   35|   313k|        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|   313k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1525|      0|                printf("Post-refs[%d/%d]: r=%d\n",
 1526|      0|                       b->ref[0], b->ref[1], ts->msac.rng);
 1527|       |
 1528|   313k|            refmvs_candidate mvstack[8];
 1529|   313k|            int n_mvs, ctx;
 1530|   313k|            dav1d_refmvs_find(&t->rt, mvstack, &n_mvs, &ctx,
 1531|   313k|                              (union refmvs_refpair) { .ref = {
 1532|   313k|                                    b->ref[0] + 1, b->ref[1] + 1 }},
 1533|   313k|                              bs, intra_edge_flags, t->by, t->bx);
 1534|       |
 1535|   313k|            b->inter_mode = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|   313k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1536|   313k|                                ts->cdf.m.comp_inter_mode[ctx],
 1537|   313k|                                N_COMP_INTER_PRED_MODES - 1);
 1538|   313k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   313k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 313k]
  |  |  ------------------
  |  |   35|   313k|        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|   313k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1539|      0|                printf("Post-compintermode[%d,ctx=%d,n_mvs=%d]: r=%d\n",
 1540|      0|                       b->inter_mode, ctx, n_mvs, ts->msac.rng);
 1541|       |
 1542|   313k|            const uint8_t *const im = dav1d_comp_inter_pred_modes[b->inter_mode];
 1543|   313k|            b->drl_idx = NEAREST_DRL;
 1544|   313k|            if (b->inter_mode == NEWMV_NEWMV) {
  ------------------
  |  Branch (1544:17): [True: 63.0k, False: 250k]
  ------------------
 1545|  63.0k|                if (n_mvs > 1) { // NEARER, NEAR or NEARISH
  ------------------
  |  Branch (1545:21): [True: 63.0k, False: 18.4E]
  ------------------
 1546|  63.0k|                    const int drl_ctx_v1 = get_drl_context(mvstack, 0);
 1547|  63.0k|                    b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  63.0k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1548|  63.0k|                                      ts->cdf.m.drl_bit[drl_ctx_v1]);
 1549|  63.0k|                    if (b->drl_idx == NEARER_DRL && n_mvs > 2) {
  ------------------
  |  Branch (1549:25): [True: 39.0k, False: 24.0k]
  |  Branch (1549:53): [True: 7.90k, False: 31.1k]
  ------------------
 1550|  7.90k|                        const int drl_ctx_v2 = get_drl_context(mvstack, 1);
 1551|  7.90k|                        b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  7.90k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1552|  7.90k|                                          ts->cdf.m.drl_bit[drl_ctx_v2]);
 1553|  7.90k|                    }
 1554|  63.0k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  63.0k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 63.0k]
  |  |  ------------------
  |  |   35|  63.0k|        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|  63.0k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1555|      0|                        printf("Post-drlidx[%d,n_mvs=%d]: r=%d\n",
 1556|      0|                               b->drl_idx, n_mvs, ts->msac.rng);
 1557|  63.0k|                }
 1558|   250k|            } else if (im[0] == NEARMV || im[1] == NEARMV) {
  ------------------
  |  Branch (1558:24): [True: 58.0k, False: 192k]
  |  Branch (1558:43): [True: 9.50k, False: 182k]
  ------------------
 1559|  70.8k|                b->drl_idx = NEARER_DRL;
 1560|  70.8k|                if (n_mvs > 2) { // NEAR or NEARISH
  ------------------
  |  Branch (1560:21): [True: 12.8k, False: 58.0k]
  ------------------
 1561|  12.8k|                    const int drl_ctx_v2 = get_drl_context(mvstack, 1);
 1562|  12.8k|                    b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  12.8k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1563|  12.8k|                                      ts->cdf.m.drl_bit[drl_ctx_v2]);
 1564|  12.8k|                    if (b->drl_idx == NEAR_DRL && n_mvs > 3) {
  ------------------
  |  Branch (1564:25): [True: 5.23k, False: 7.58k]
  |  Branch (1564:51): [True: 3.29k, False: 1.94k]
  ------------------
 1565|  3.29k|                        const int drl_ctx_v3 = get_drl_context(mvstack, 2);
 1566|  3.29k|                        b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  3.29k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1567|  3.29k|                                          ts->cdf.m.drl_bit[drl_ctx_v3]);
 1568|  3.29k|                    }
 1569|  12.8k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  12.8k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 12.8k]
  |  |  ------------------
  |  |   35|  12.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|  12.8k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1570|      0|                        printf("Post-drlidx[%d,n_mvs=%d]: r=%d\n",
 1571|      0|                               b->drl_idx, n_mvs, ts->msac.rng);
 1572|  12.8k|                }
 1573|  70.8k|            }
 1574|   313k|            assert(b->drl_idx >= NEAREST_DRL && b->drl_idx <= NEARISH_DRL);
  ------------------
  |  Branch (1574:13): [True: 313k, False: 18.4E]
  |  Branch (1574:13): [True: 313k, False: 18.4E]
  ------------------
 1575|       |
 1576|   313k|#define assign_comp_mv(idx) \
 1577|   313k|            switch (im[idx]) { \
 1578|   313k|            case NEARMV: \
 1579|   313k|            case NEARESTMV: \
 1580|   313k|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
 1581|   313k|                fix_mv_precision(f->frame_hdr, &b->mv[idx]); \
 1582|   313k|                break; \
 1583|   313k|            case GLOBALMV: \
 1584|   313k|                has_subpel_filter |= \
 1585|   313k|                    f->frame_hdr->gmv[b->ref[idx]].type == DAV1D_WM_TYPE_TRANSLATION; \
 1586|   313k|                b->mv[idx] = get_gmv_2d(&f->frame_hdr->gmv[b->ref[idx]], \
 1587|   313k|                                        t->bx, t->by, bw4, bh4, f->frame_hdr); \
 1588|   313k|                break; \
 1589|   313k|            case NEWMV: \
 1590|   313k|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
 1591|   313k|                const int mv_prec = f->frame_hdr->hp - f->frame_hdr->force_integer_mv; \
 1592|   313k|                read_mv_residual(ts, &b->mv[idx], mv_prec); \
 1593|   313k|                break; \
 1594|   313k|            }
 1595|   313k|            has_subpel_filter = imin(bw4, bh4) == 1 ||
  ------------------
  |  Branch (1595:33): [True: 122, False: 313k]
  ------------------
 1596|   313k|                                b->inter_mode != GLOBALMV_GLOBALMV;
  ------------------
  |  Branch (1596:33): [True: 279k, False: 33.6k]
  ------------------
 1597|   314k|            assign_comp_mv(0);
  ------------------
  |  | 1577|   313k|            switch (im[idx]) { \
  |  |  ------------------
  |  |  |  Branch (1577:21): [True: 317k, False: 18.4E]
  |  |  ------------------
  |  | 1578|  61.1k|            case NEARMV: \
  |  |  ------------------
  |  |  |  Branch (1578:13): [True: 61.1k, False: 252k]
  |  |  ------------------
  |  | 1579|   192k|            case NEARESTMV: \
  |  |  ------------------
  |  |  |  Branch (1579:13): [True: 131k, False: 181k]
  |  |  ------------------
  |  | 1580|   192k|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
  |  | 1581|   192k|                fix_mv_precision(f->frame_hdr, &b->mv[idx]); \
  |  | 1582|   192k|                break; \
  |  | 1583|  61.1k|            case GLOBALMV: \
  |  |  ------------------
  |  |  |  Branch (1583:13): [True: 33.6k, False: 280k]
  |  |  ------------------
  |  | 1584|  33.6k|                has_subpel_filter |= \
  |  | 1585|  33.6k|                    f->frame_hdr->gmv[b->ref[idx]].type == DAV1D_WM_TYPE_TRANSLATION; \
  |  | 1586|  33.6k|                b->mv[idx] = get_gmv_2d(&f->frame_hdr->gmv[b->ref[idx]], \
  |  | 1587|  33.6k|                                        t->bx, t->by, bw4, bh4, f->frame_hdr); \
  |  | 1588|  33.6k|                break; \
  |  | 1589|  90.9k|            case NEWMV: \
  |  |  ------------------
  |  |  |  Branch (1589:13): [True: 90.9k, False: 222k]
  |  |  ------------------
  |  | 1590|  90.9k|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
  |  | 1591|  90.9k|                const int mv_prec = f->frame_hdr->hp - f->frame_hdr->force_integer_mv; \
  |  | 1592|  90.9k|                read_mv_residual(ts, &b->mv[idx], mv_prec); \
  |  | 1593|  90.9k|                break; \
  |  | 1594|   313k|            }
  ------------------
 1598|   314k|            assign_comp_mv(1);
  ------------------
  |  | 1577|   314k|            switch (im[idx]) { \
  |  |  ------------------
  |  |  |  Branch (1577:21): [True: 317k, False: 18.4E]
  |  |  ------------------
  |  | 1578|  60.0k|            case NEARMV: \
  |  |  ------------------
  |  |  |  Branch (1578:13): [True: 60.0k, False: 254k]
  |  |  ------------------
  |  | 1579|   184k|            case NEARESTMV: \
  |  |  ------------------
  |  |  |  Branch (1579:13): [True: 124k, False: 190k]
  |  |  ------------------
  |  | 1580|   184k|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
  |  | 1581|   184k|                fix_mv_precision(f->frame_hdr, &b->mv[idx]); \
  |  | 1582|   184k|                break; \
  |  | 1583|  60.0k|            case GLOBALMV: \
  |  |  ------------------
  |  |  |  Branch (1583:13): [True: 33.6k, False: 280k]
  |  |  ------------------
  |  | 1584|  33.6k|                has_subpel_filter |= \
  |  | 1585|  33.6k|                    f->frame_hdr->gmv[b->ref[idx]].type == DAV1D_WM_TYPE_TRANSLATION; \
  |  | 1586|  33.6k|                b->mv[idx] = get_gmv_2d(&f->frame_hdr->gmv[b->ref[idx]], \
  |  | 1587|  33.6k|                                        t->bx, t->by, bw4, bh4, f->frame_hdr); \
  |  | 1588|  33.6k|                break; \
  |  | 1589|   100k|            case NEWMV: \
  |  |  ------------------
  |  |  |  Branch (1589:13): [True: 100k, False: 214k]
  |  |  ------------------
  |  | 1590|   100k|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
  |  | 1591|   100k|                const int mv_prec = f->frame_hdr->hp - f->frame_hdr->force_integer_mv; \
  |  | 1592|   100k|                read_mv_residual(ts, &b->mv[idx], mv_prec); \
  |  | 1593|   100k|                break; \
  |  | 1594|   314k|            }
  ------------------
 1599|   314k|#undef assign_comp_mv
 1600|   314k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   314k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 314k]
  |  |  ------------------
  |  |   35|   314k|        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|   314k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1601|      0|                printf("Post-residual_mv[1:y=%d,x=%d,2:y=%d,x=%d]: r=%d\n",
 1602|      0|                       b->mv[0].y, b->mv[0].x, b->mv[1].y, b->mv[1].x,
 1603|      0|                       ts->msac.rng);
 1604|       |
 1605|       |            // jnt_comp vs. seg vs. wedge
 1606|   314k|            int is_segwedge = 0;
 1607|   314k|            if (f->seq_hdr->masked_compound) {
  ------------------
  |  Branch (1607:17): [True: 273k, False: 41.2k]
  ------------------
 1608|   273k|                const int mask_ctx = get_mask_comp_ctx(t->a, &t->l, by4, bx4);
 1609|       |
 1610|   273k|                is_segwedge = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   273k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1611|   273k|                                  ts->cdf.m.mask_comp[mask_ctx]);
 1612|   273k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   273k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 273k]
  |  |  ------------------
  |  |   35|   273k|        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|   273k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1613|      0|                    printf("Post-segwedge_vs_jntavg[%d,ctx=%d]: r=%d\n",
 1614|      0|                           is_segwedge, mask_ctx, ts->msac.rng);
 1615|   273k|            }
 1616|       |
 1617|   314k|            if (!is_segwedge) {
  ------------------
  |  Branch (1617:17): [True: 262k, False: 52.0k]
  ------------------
 1618|   262k|                if (f->seq_hdr->jnt_comp) {
  ------------------
  |  Branch (1618:21): [True: 229k, False: 32.4k]
  ------------------
 1619|   229k|                    const int jnt_ctx =
 1620|   229k|                        get_jnt_comp_ctx(f->seq_hdr->order_hint_n_bits,
 1621|   229k|                                         f->cur.frame_hdr->frame_offset,
 1622|   229k|                                         f->refp[b->ref[0]].p.frame_hdr->frame_offset,
 1623|   229k|                                         f->refp[b->ref[1]].p.frame_hdr->frame_offset,
 1624|   229k|                                         t->a, &t->l, by4, bx4);
 1625|   229k|                    b->comp_type = COMP_INTER_WEIGHTED_AVG +
 1626|   229k|                                   dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   229k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1627|   229k|                                       ts->cdf.m.jnt_comp[jnt_ctx]);
 1628|   229k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   229k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 229k]
  |  |  ------------------
  |  |   35|   229k|        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|   229k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1629|      0|                        printf("Post-jnt_comp[%d,ctx=%d[ac:%d,ar:%d,lc:%d,lr:%d]]: r=%d\n",
 1630|      0|                               b->comp_type == COMP_INTER_AVG,
 1631|      0|                               jnt_ctx, t->a->comp_type[bx4], t->a->ref[0][bx4],
 1632|      0|                               t->l.comp_type[by4], t->l.ref[0][by4],
 1633|      0|                               ts->msac.rng);
 1634|   229k|                } else {
 1635|  32.4k|                    b->comp_type = COMP_INTER_AVG;
 1636|  32.4k|                }
 1637|   262k|            } else {
 1638|  52.0k|                if (wedge_allowed_mask & (1 << bs)) {
  ------------------
  |  Branch (1638:21): [True: 38.6k, False: 13.3k]
  ------------------
 1639|  38.6k|                    const int ctx = dav1d_wedge_ctx_lut[bs];
 1640|  38.6k|                    b->comp_type = COMP_INTER_WEDGE -
 1641|  38.6k|                                   dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  38.6k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1642|  38.6k|                                       ts->cdf.m.wedge_comp[ctx]);
 1643|  38.6k|                    if (b->comp_type == COMP_INTER_WEDGE)
  ------------------
  |  Branch (1643:25): [True: 19.3k, False: 19.3k]
  ------------------
 1644|  19.3k|                        b->wedge_idx = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|  19.3k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1645|  38.6k|                                           ts->cdf.m.wedge_idx[ctx], 15);
 1646|  38.6k|                } else {
 1647|  13.3k|                    b->comp_type = COMP_INTER_SEG;
 1648|  13.3k|                }
 1649|  52.0k|                b->mask_sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  52.0k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
 1650|  52.0k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  52.0k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 52.0k]
  |  |  ------------------
  |  |   35|  52.0k|        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|  52.0k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1651|      0|                    printf("Post-seg/wedge[%d,wedge_idx=%d,sign=%d]: r=%d\n",
 1652|      0|                           b->comp_type == COMP_INTER_WEDGE,
 1653|      0|                           b->wedge_idx, b->mask_sign, ts->msac.rng);
 1654|  52.0k|            }
 1655|  5.85M|        } else {
 1656|  5.85M|            b->comp_type = COMP_INTER_NONE;
 1657|       |
 1658|       |            // ref
 1659|  5.85M|            if (seg && seg->ref > 0) {
  ------------------
  |  Branch (1659:17): [True: 4.86M, False: 994k]
  |  Branch (1659:24): [True: 265k, False: 4.59M]
  ------------------
 1660|   265k|                b->ref[0] = seg->ref - 1;
 1661|  5.59M|            } else if (seg && (seg->globalmv || seg->skip)) {
  ------------------
  |  Branch (1661:24): [True: 4.59M, False: 993k]
  |  Branch (1661:32): [True: 4.43M, False: 163k]
  |  Branch (1661:49): [True: 35.5k, False: 127k]
  ------------------
 1662|  4.47M|                b->ref[0] = 0;
 1663|  4.47M|            } else {
 1664|  1.12M|                const int ctx1 = av1_get_ref_ctx(t->a, &t->l, by4, bx4,
 1665|  1.12M|                                                 have_top, have_left);
 1666|  1.12M|                if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  1.12M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1666:21): [True: 451k, False: 669k]
  ------------------
 1667|  1.12M|                                                 ts->cdf.m.ref[0][ctx1]))
 1668|   451k|                {
 1669|   451k|                    const int ctx2 = av1_get_ref_2_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  275|   451k|#define av1_get_ref_2_ctx av1_get_bwd_ref_ctx
  ------------------
 1670|   451k|                                                       have_top, have_left);
 1671|   451k|                    if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   451k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1671:25): [True: 343k, False: 108k]
  ------------------
 1672|   451k|                                                     ts->cdf.m.ref[1][ctx2]))
 1673|   343k|                    {
 1674|   343k|                        b->ref[0] = 6;
 1675|   343k|                    } else {
 1676|   108k|                        const int ctx3 = av1_get_ref_6_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  279|   108k|#define av1_get_ref_6_ctx av1_get_bwd_ref_1_ctx
  ------------------
 1677|   108k|                                                           have_top, have_left);
 1678|   108k|                        b->ref[0] = 4 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   108k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1679|   108k|                                            ts->cdf.m.ref[5][ctx3]);
 1680|   108k|                    }
 1681|   669k|                } else {
 1682|   669k|                    const int ctx2 = av1_get_ref_3_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  276|   669k|#define av1_get_ref_3_ctx av1_get_fwd_ref_ctx
  ------------------
 1683|   669k|                                                       have_top, have_left);
 1684|   669k|                    if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   669k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1684:25): [True: 101k, False: 567k]
  ------------------
 1685|   669k|                                                     ts->cdf.m.ref[2][ctx2]))
 1686|   101k|                    {
 1687|   101k|                        const int ctx3 = av1_get_ref_5_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  278|   101k|#define av1_get_ref_5_ctx av1_get_fwd_ref_2_ctx
  ------------------
 1688|   101k|                                                           have_top, have_left);
 1689|   101k|                        b->ref[0] = 2 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   101k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1690|   101k|                                            ts->cdf.m.ref[4][ctx3]);
 1691|   567k|                    } else {
 1692|   567k|                        const int ctx3 = av1_get_ref_4_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  277|   567k|#define av1_get_ref_4_ctx av1_get_fwd_ref_1_ctx
  ------------------
 1693|   567k|                                                           have_top, have_left);
 1694|   567k|                        b->ref[0] = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   567k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1695|   567k|                                        ts->cdf.m.ref[3][ctx3]);
 1696|   567k|                    }
 1697|   669k|                }
 1698|  1.12M|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.12M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.12M]
  |  |  ------------------
  |  |   35|  1.12M|        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.12M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1699|      0|                    printf("Post-ref[%d]: r=%d\n", b->ref[0], ts->msac.rng);
 1700|  1.12M|            }
 1701|  5.85M|            b->ref[1] = -1;
 1702|       |
 1703|  5.85M|            refmvs_candidate mvstack[8];
 1704|  5.85M|            int n_mvs, ctx;
 1705|  5.85M|            dav1d_refmvs_find(&t->rt, mvstack, &n_mvs, &ctx,
 1706|  5.85M|                              (union refmvs_refpair) { .ref = { b->ref[0] + 1, -1 }},
 1707|  5.85M|                              bs, intra_edge_flags, t->by, t->bx);
 1708|       |
 1709|       |            // mode parsing and mv derivation from ref_mvs
 1710|  5.85M|            if ((seg && (seg->skip || seg->globalmv)) ||
  ------------------
  |  Branch (1710:18): [True: 4.85M, False: 1.00M]
  |  Branch (1710:26): [True: 4.51M, False: 338k]
  |  Branch (1710:39): [True: 204k, False: 134k]
  ------------------
 1711|  1.62M|                dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  1.62M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1711:17): [True: 1.11M, False: 511k]
  ------------------
 1712|  1.62M|                                             ts->cdf.m.newmv_mode[ctx & 7]))
 1713|  5.84M|            {
 1714|  5.84M|                if ((seg && (seg->skip || seg->globalmv)) ||
  ------------------
  |  Branch (1714:22): [True: 4.80M, False: 1.04M]
  |  Branch (1714:30): [True: 4.51M, False: 292k]
  |  Branch (1714:43): [True: 204k, False: 88.1k]
  ------------------
 1715|  1.12M|                    !dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  1.12M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1715:21): [True: 48.7k, False: 1.07M]
  ------------------
 1716|  1.12M|                         ts->cdf.m.globalmv_mode[(ctx >> 3) & 1]))
 1717|  4.76M|                {
 1718|  4.76M|                    b->inter_mode = GLOBALMV;
 1719|  4.76M|                    b->mv[0] = get_gmv_2d(&f->frame_hdr->gmv[b->ref[0]],
 1720|  4.76M|                                          t->bx, t->by, bw4, bh4, f->frame_hdr);
 1721|  4.76M|                    has_subpel_filter = imin(bw4, bh4) == 1 ||
  ------------------
  |  Branch (1721:41): [True: 177k, False: 4.58M]
  ------------------
 1722|  4.58M|                        f->frame_hdr->gmv[b->ref[0]].type == DAV1D_WM_TYPE_TRANSLATION;
  ------------------
  |  Branch (1722:25): [True: 54.2k, False: 4.53M]
  ------------------
 1723|  4.76M|                } else {
 1724|  1.07M|                    has_subpel_filter = 1;
 1725|  1.07M|                    if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  1.07M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1725:25): [True: 461k, False: 616k]
  ------------------
 1726|  1.07M|                            ts->cdf.m.refmv_mode[(ctx >> 4) & 15]))
 1727|   461k|                    { // NEAREST, NEARER, NEAR or NEARISH
 1728|   461k|                        b->inter_mode = NEARMV;
 1729|   461k|                        b->drl_idx = NEARER_DRL;
 1730|   461k|                        if (n_mvs > 2) { // NEARER, NEAR or NEARISH
  ------------------
  |  Branch (1730:29): [True: 225k, False: 235k]
  ------------------
 1731|   225k|                            const int drl_ctx_v2 = get_drl_context(mvstack, 1);
 1732|   225k|                            b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   225k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1733|   225k|                                              ts->cdf.m.drl_bit[drl_ctx_v2]);
 1734|   225k|                            if (b->drl_idx == NEAR_DRL && n_mvs > 3) { // NEAR or NEARISH
  ------------------
  |  Branch (1734:33): [True: 109k, False: 116k]
  |  Branch (1734:59): [True: 66.0k, False: 43.1k]
  ------------------
 1735|  66.0k|                                const int drl_ctx_v3 =
 1736|  66.0k|                                    get_drl_context(mvstack, 2);
 1737|  66.0k|                                b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  66.0k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1738|  66.0k|                                                  ts->cdf.m.drl_bit[drl_ctx_v3]);
 1739|  66.0k|                            }
 1740|   225k|                        }
 1741|   616k|                    } else {
 1742|   616k|                        b->inter_mode = NEARESTMV;
 1743|   616k|                        b->drl_idx = NEAREST_DRL;
 1744|   616k|                    }
 1745|  1.07M|                    assert(b->drl_idx >= NEAREST_DRL && b->drl_idx <= NEARISH_DRL);
  ------------------
  |  Branch (1745:21): [True: 1.08M, False: 18.4E]
  |  Branch (1745:21): [True: 1.08M, False: 18.4E]
  ------------------
 1746|  1.08M|                    b->mv[0] = mvstack[b->drl_idx].mv.mv[0];
 1747|  1.08M|                    if (b->drl_idx < NEAR_DRL)
  ------------------
  |  Branch (1747:25): [True: 976k, False: 103k]
  ------------------
 1748|   976k|                        fix_mv_precision(f->frame_hdr, &b->mv[0]);
 1749|  1.08M|                }
 1750|       |
 1751|  5.84M|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  5.84M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 5.84M]
  |  |  ------------------
  |  |   35|  5.84M|        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.84M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1752|      0|                    printf("Post-intermode[%d,drl=%d,mv=y:%d,x:%d,n_mvs=%d]: r=%d\n",
 1753|      0|                           b->inter_mode, b->drl_idx, b->mv[0].y, b->mv[0].x, n_mvs,
 1754|      0|                           ts->msac.rng);
 1755|  5.84M|            } else {
 1756|  13.9k|                has_subpel_filter = 1;
 1757|  13.9k|                b->inter_mode = NEWMV;
 1758|  13.9k|                b->drl_idx = NEAREST_DRL;
 1759|   421k|                if (n_mvs > 1) { // NEARER, NEAR or NEARISH
  ------------------
  |  Branch (1759:21): [True: 421k, False: 18.4E]
  ------------------
 1760|   421k|                    const int drl_ctx_v1 = get_drl_context(mvstack, 0);
 1761|   421k|                    b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   421k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1762|   421k|                                      ts->cdf.m.drl_bit[drl_ctx_v1]);
 1763|   421k|                    if (b->drl_idx == NEARER_DRL && n_mvs > 2) { // NEAR or NEARISH
  ------------------
  |  Branch (1763:25): [True: 189k, False: 231k]
  |  Branch (1763:53): [True: 134k, False: 55.3k]
  ------------------
 1764|   134k|                        const int drl_ctx_v2 = get_drl_context(mvstack, 1);
 1765|   134k|                        b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   134k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1766|   134k|                                          ts->cdf.m.drl_bit[drl_ctx_v2]);
 1767|   134k|                    }
 1768|   421k|                }
 1769|  13.9k|                assert(b->drl_idx >= NEAREST_DRL && b->drl_idx <= NEARISH_DRL);
  ------------------
  |  Branch (1769:17): [True: 511k, False: 18.4E]
  |  Branch (1769:17): [True: 511k, False: 18.4E]
  ------------------
 1770|   511k|                if (n_mvs > 1) {
  ------------------
  |  Branch (1770:21): [True: 421k, False: 90.0k]
  ------------------
 1771|   421k|                    b->mv[0] = mvstack[b->drl_idx].mv.mv[0];
 1772|   421k|                } else {
 1773|  90.0k|                    assert(!b->drl_idx);
  ------------------
  |  Branch (1773:21): [True: 90.6k, False: 18.4E]
  ------------------
 1774|  90.6k|                    b->mv[0] = mvstack[0].mv.mv[0];
 1775|  90.6k|                    fix_mv_precision(f->frame_hdr, &b->mv[0]);
 1776|  90.6k|                }
 1777|   512k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   512k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 512k]
  |  |  ------------------
  |  |   35|   512k|        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|   512k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1778|      0|                    printf("Post-intermode[%d,drl=%d]: r=%d\n",
 1779|      0|                           b->inter_mode, b->drl_idx, ts->msac.rng);
 1780|   512k|                const int mv_prec = f->frame_hdr->hp - f->frame_hdr->force_integer_mv;
 1781|   512k|                read_mv_residual(ts, &b->mv[0], mv_prec);
 1782|   512k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   512k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 512k]
  |  |  ------------------
  |  |   35|   512k|        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|   512k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1783|      0|                    printf("Post-residualmv[mv=y:%d,x:%d]: r=%d\n",
 1784|      0|                           b->mv[0].y, b->mv[0].x, ts->msac.rng);
 1785|   512k|            }
 1786|       |
 1787|       |            // interintra flags
 1788|  6.36M|            const int ii_sz_grp = dav1d_ymode_size_context[bs];
 1789|  6.36M|            if (f->seq_hdr->inter_intra &&
  ------------------
  |  Branch (1789:17): [True: 5.92M, False: 433k]
  ------------------
 1790|  5.92M|                interintra_allowed_mask & (1 << bs) &&
  ------------------
  |  Branch (1790:17): [True: 1.01M, False: 4.90M]
  ------------------
 1791|  1.01M|                dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  1.01M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1791:17): [True: 189k, False: 828k]
  ------------------
 1792|  1.01M|                                             ts->cdf.m.interintra[ii_sz_grp]))
 1793|   189k|            {
 1794|   189k|                b->interintra_mode = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|   189k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1795|   189k|                                         ts->cdf.m.interintra_mode[ii_sz_grp],
 1796|   189k|                                         N_INTER_INTRA_PRED_MODES - 1);
 1797|   189k|                const int wedge_ctx = dav1d_wedge_ctx_lut[bs];
 1798|   189k|                b->interintra_type = INTER_INTRA_BLEND +
 1799|   189k|                                     dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   189k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1800|   189k|                                         ts->cdf.m.interintra_wedge[wedge_ctx]);
 1801|   189k|                if (b->interintra_type == INTER_INTRA_WEDGE)
  ------------------
  |  Branch (1801:21): [True: 46.3k, False: 143k]
  ------------------
 1802|  46.3k|                    b->wedge_idx = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|  46.3k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1803|   189k|                                       ts->cdf.m.wedge_idx[wedge_ctx], 15);
 1804|  6.17M|            } else {
 1805|  6.17M|                b->interintra_type = INTER_INTRA_NONE;
 1806|  6.17M|            }
 1807|  6.36M|            if (DEBUG_BLOCK_INFO && f->seq_hdr->inter_intra &&
  ------------------
  |  |   34|  6.36M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 6.36M]
  |  |  ------------------
  |  |   35|  6.36M|        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|  6.36M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1807:37): [True: 0, False: 0]
  ------------------
 1808|      0|                interintra_allowed_mask & (1 << bs))
  ------------------
  |  Branch (1808:17): [True: 0, False: 0]
  ------------------
 1809|      0|            {
 1810|      0|                printf("Post-interintra[t=%d,m=%d,w=%d]: r=%d\n",
 1811|      0|                       b->interintra_type, b->interintra_mode,
 1812|      0|                       b->wedge_idx, ts->msac.rng);
 1813|      0|            }
 1814|       |
 1815|       |            // motion variation
 1816|  6.36M|            if (f->frame_hdr->switchable_motion_mode &&
  ------------------
  |  Branch (1816:17): [True: 6.09M, False: 269k]
  ------------------
 1817|  6.09M|                b->interintra_type == INTER_INTRA_NONE && imin(bw4, bh4) >= 2 &&
  ------------------
  |  Branch (1817:17): [True: 5.91M, False: 179k]
  |  Branch (1817:59): [True: 5.29M, False: 615k]
  ------------------
 1818|       |                // is not warped global motion
 1819|  5.29M|                !(!f->frame_hdr->force_integer_mv && b->inter_mode == GLOBALMV &&
  ------------------
  |  Branch (1819:19): [True: 5.12M, False: 169k]
  |  Branch (1819:54): [True: 4.19M, False: 928k]
  ------------------
 1820|  4.19M|                  f->frame_hdr->gmv[b->ref[0]].type > DAV1D_WM_TYPE_TRANSLATION) &&
  ------------------
  |  Branch (1820:19): [True: 1.10M, False: 3.08M]
  ------------------
 1821|       |                // has overlappable neighbours
 1822|  4.19M|                ((have_left && findoddzero(&t->l.intra[by4 + 1], h4 >> 1)) ||
  ------------------
  |  Branch (1822:19): [True: 1.26M, False: 2.93M]
  |  Branch (1822:32): [True: 1.21M, False: 52.5k]
  ------------------
 1823|  2.98M|                 (have_top && findoddzero(&t->a->intra[bx4 + 1], w4 >> 1))))
  ------------------
  |  Branch (1823:19): [True: 2.96M, False: 21.0k]
  |  Branch (1823:31): [True: 2.95M, False: 14.6k]
  ------------------
 1824|  4.16M|            {
 1825|       |                // reaching here means the block allows obmc - check warp by
 1826|       |                // finding matching-ref blocks in top/left edges
 1827|  4.16M|                uint64_t mask[2] = { 0, 0 };
 1828|  4.16M|                find_matching_ref(t, intra_edge_flags, bw4, bh4, w4, h4,
 1829|  4.16M|                                  have_left, have_top, b->ref[0], mask);
 1830|  4.16M|                const int allow_warp = !f->svc[b->ref[0]][0].scale &&
  ------------------
  |  Branch (1830:40): [True: 3.80M, False: 357k]
  ------------------
 1831|  3.80M|                    !f->frame_hdr->force_integer_mv &&
  ------------------
  |  Branch (1831:21): [True: 3.75M, False: 53.6k]
  ------------------
 1832|  3.75M|                    f->frame_hdr->warp_motion && (mask[0] | mask[1]);
  ------------------
  |  Branch (1832:21): [True: 858k, False: 2.89M]
  |  Branch (1832:50): [True: 804k, False: 53.1k]
  ------------------
 1833|       |
 1834|  4.16M|                b->motion_mode = allow_warp ?
  ------------------
  |  Branch (1834:34): [True: 803k, False: 3.35M]
  ------------------
 1835|   803k|                    dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|   803k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1836|   803k|                        ts->cdf.m.motion_mode[bs], 2) :
 1837|  4.16M|                    dav1d_msac_decode_bool_adapt(&ts->msac, ts->cdf.m.obmc[bs]);
  ------------------
  |  |   52|  3.35M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1838|  4.16M|                if (b->motion_mode == MM_WARP) {
  ------------------
  |  Branch (1838:21): [True: 206k, False: 3.95M]
  ------------------
 1839|   206k|                    has_subpel_filter = 0;
 1840|   206k|                    derive_warpmv(t, bw4, bh4, mask, b->mv[0], &t->warpmv);
 1841|   206k|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
 1842|   206k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   206k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 206k]
  |  |  ------------------
  |  |   35|   206k|        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|   206k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1843|      0|                        printf("[ %c%x %c%x %c%x\n  %c%x %c%x %c%x ]\n"
 1844|      0|                               "alpha=%c%x, beta=%c%x, gamma=%c%x, delta=%c%x, "
 1845|      0|                               "mv=y:%d,x:%d\n",
 1846|      0|                               signabs(t->warpmv.matrix[0]),
  ------------------
  |  | 1841|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1841:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1847|      0|                               signabs(t->warpmv.matrix[1]),
  ------------------
  |  | 1841|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1841:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1848|      0|                               signabs(t->warpmv.matrix[2]),
  ------------------
  |  | 1841|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1841:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1849|      0|                               signabs(t->warpmv.matrix[3]),
  ------------------
  |  | 1841|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1841:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1850|      0|                               signabs(t->warpmv.matrix[4]),
  ------------------
  |  | 1841|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1841:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1851|      0|                               signabs(t->warpmv.matrix[5]),
  ------------------
  |  | 1841|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1841:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1852|      0|                               signabs(t->warpmv.u.p.alpha),
  ------------------
  |  | 1841|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1841:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1853|      0|                               signabs(t->warpmv.u.p.beta),
  ------------------
  |  | 1841|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1841:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1854|      0|                               signabs(t->warpmv.u.p.gamma),
  ------------------
  |  | 1841|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1841:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1855|      0|                               signabs(t->warpmv.u.p.delta),
  ------------------
  |  | 1841|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  |  |  ------------------
  |  |  |  Branch (1841:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1856|      0|                               b->mv[0].y, b->mv[0].x);
 1857|   206k|#undef signabs
 1858|   206k|                    if (t->frame_thread.pass) {
  ------------------
  |  Branch (1858:25): [True: 205k, False: 688]
  ------------------
 1859|   205k|                        if (t->warpmv.type == DAV1D_WM_TYPE_AFFINE) {
  ------------------
  |  Branch (1859:29): [True: 193k, False: 11.7k]
  ------------------
 1860|   193k|                            b->matrix[0] = t->warpmv.matrix[2] - 0x10000;
 1861|   193k|                            b->matrix[1] = t->warpmv.matrix[3];
 1862|   193k|                            b->matrix[2] = t->warpmv.matrix[4];
 1863|   193k|                            b->matrix[3] = t->warpmv.matrix[5] - 0x10000;
 1864|   193k|                        } else {
 1865|  11.7k|                            b->matrix[0] = INT16_MIN;
 1866|  11.7k|                        }
 1867|   205k|                    }
 1868|   206k|                }
 1869|       |
 1870|  4.16M|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  4.16M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 4.16M]
  |  |  ------------------
  |  |   35|  4.16M|        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|  4.16M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1871|      0|                    printf("Post-motionmode[%d]: r=%d [mask: 0x%" PRIx64 "/0x%"
 1872|      0|                           PRIx64 "]\n", b->motion_mode, ts->msac.rng, mask[0],
 1873|      0|                            mask[1]);
 1874|  4.16M|            } else {
 1875|  2.19M|                b->motion_mode = MM_TRANSLATION;
 1876|  2.19M|            }
 1877|  6.36M|        }
 1878|       |
 1879|       |        // subpel filter
 1880|  6.69M|        enum Dav1dFilterMode filter[2];
 1881|  6.69M|        if (f->frame_hdr->subpel_filter_mode == DAV1D_FILTER_SWITCHABLE) {
  ------------------
  |  Branch (1881:13): [True: 2.60M, False: 4.09M]
  ------------------
 1882|  2.60M|            if (has_subpel_filter) {
  ------------------
  |  Branch (1882:17): [True: 1.09M, False: 1.50M]
  ------------------
 1883|  1.09M|                const int comp = b->comp_type != COMP_INTER_NONE;
 1884|  1.09M|                const int ctx1 = get_filter_ctx(t->a, &t->l, comp, 0, b->ref[0],
 1885|  1.09M|                                                by4, bx4);
 1886|  1.09M|                filter[0] = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|  1.09M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1887|  1.09M|                               ts->cdf.m.filter[0][ctx1],
 1888|  1.09M|                               DAV1D_N_SWITCHABLE_FILTERS - 1);
 1889|  1.09M|                if (f->seq_hdr->dual_filter) {
  ------------------
  |  Branch (1889:21): [True: 787k, False: 311k]
  ------------------
 1890|   787k|                    const int ctx2 = get_filter_ctx(t->a, &t->l, comp, 1,
 1891|   787k|                                                    b->ref[0], by4, bx4);
 1892|   787k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   787k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 787k]
  |  |  ------------------
  |  |   35|   787k|        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|   787k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1893|      0|                        printf("Post-subpel_filter1[%d,ctx=%d]: r=%d\n",
 1894|      0|                               filter[0], ctx1, ts->msac.rng);
 1895|   787k|                    filter[1] = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|   787k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1896|   787k|                                    ts->cdf.m.filter[1][ctx2],
 1897|   787k|                                    DAV1D_N_SWITCHABLE_FILTERS - 1);
 1898|   787k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   787k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 787k]
  |  |  ------------------
  |  |   35|   787k|        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|   787k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1899|      0|                        printf("Post-subpel_filter2[%d,ctx=%d]: r=%d\n",
 1900|      0|                               filter[1], ctx2, ts->msac.rng);
 1901|   787k|                } else {
 1902|   311k|                    filter[1] = filter[0];
 1903|   311k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   311k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 311k]
  |  |  ------------------
  |  |   35|   311k|        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|   311k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1904|      0|                        printf("Post-subpel_filter[%d,ctx=%d]: r=%d\n",
 1905|      0|                               filter[0], ctx1, ts->msac.rng);
 1906|   311k|                }
 1907|  1.50M|            } else {
 1908|  1.50M|                filter[0] = filter[1] = DAV1D_FILTER_8TAP_REGULAR;
 1909|  1.50M|            }
 1910|  4.09M|        } else {
 1911|  4.09M|            filter[0] = filter[1] = f->frame_hdr->subpel_filter_mode;
 1912|  4.09M|        }
 1913|  6.69M|        b->filter2d = dav1d_filter_2d[filter[1]][filter[0]];
 1914|       |
 1915|  6.69M|        read_vartx_tree(t, b, bs, bx4, by4);
 1916|       |
 1917|       |        // reconstruction
 1918|  6.69M|        if (t->frame_thread.pass == 1) {
  ------------------
  |  Branch (1918:13): [True: 6.68M, False: 15.4k]
  ------------------
 1919|  6.68M|            f->bd_fn.read_coef_blocks(t, bs, b);
 1920|  6.68M|        } else {
 1921|  15.4k|            if (f->bd_fn.recon_b_inter(t, bs, b)) return -1;
  ------------------
  |  Branch (1921:17): [True: 0, False: 15.4k]
  ------------------
 1922|  15.4k|        }
 1923|       |
 1924|  6.69M|        if (f->frame_hdr->loopfilter.level_y[0] ||
  ------------------
  |  Branch (1924:13): [True: 5.95M, False: 742k]
  ------------------
 1925|   742k|            f->frame_hdr->loopfilter.level_y[1])
  ------------------
  |  Branch (1925:13): [True: 136k, False: 605k]
  ------------------
 1926|  6.04M|        {
 1927|  6.04M|            const int is_globalmv =
 1928|  6.04M|                b->inter_mode == (is_comp ? GLOBALMV_GLOBALMV : GLOBALMV);
  ------------------
  |  Branch (1928:35): [True: 283k, False: 5.76M]
  ------------------
 1929|  6.04M|            const uint8_t (*const lf_lvls)[8][2] = (const uint8_t (*)[8][2])
 1930|  6.04M|                &ts->lflvl[b->seg_id][0][b->ref[0] + 1][!is_globalmv];
 1931|  6.04M|            const uint16_t tx_split[2] = { b->tx_split0, b->tx_split1 };
 1932|  6.04M|            enum RectTxfmSize ytx = b->max_ytx, uvtx = b->uvtx;
 1933|  6.04M|            if (f->frame_hdr->segmentation.lossless[b->seg_id]) {
  ------------------
  |  Branch (1933:17): [True: 33.3k, False: 6.01M]
  ------------------
 1934|  33.3k|                ytx  = (enum RectTxfmSize) TX_4X4;
 1935|  33.3k|                uvtx = (enum RectTxfmSize) TX_4X4;
 1936|  33.3k|            }
 1937|  6.04M|            dav1d_create_lf_mask_inter(t, f->lf.level, f->b4_stride, lf_lvls, f->w4,
 1938|  6.04M|                                       f->h4, b->skip, bs, ytx, tx_split, uvtx,
 1939|  6.04M|                                       f->cur.p.layout, &t->a->tx_lpf_y[bx4],
 1940|  6.04M|                                       &t->l.tx_lpf_y[by4],
 1941|  6.04M|                                       has_chroma ? &t->a->tx_lpf_uv[cbx4] : NULL,
  ------------------
  |  Branch (1941:40): [True: 1.10M, False: 4.93M]
  ------------------
 1942|  6.04M|                                       has_chroma ? &t->l.tx_lpf_uv[cby4] : NULL);
  ------------------
  |  Branch (1942:40): [True: 1.10M, False: 4.94M]
  ------------------
 1943|  6.04M|        }
 1944|       |
 1945|       |        // context updates
 1946|  6.69M|        if (is_comp)
  ------------------
  |  Branch (1946:13): [True: 340k, False: 6.35M]
  ------------------
 1947|   340k|            splat_tworef_mv(f->c, t, bs, b, bw4, bh4);
 1948|  6.35M|        else
 1949|  6.35M|            splat_oneref_mv(f->c, t, bs, b, bw4, bh4);
 1950|  6.69M|        BlockContext *edge = t->a;
 1951|  20.1M|        for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (1951:36): [True: 13.5M, False: 6.69M]
  ------------------
 1952|  13.5M|#define set_ctx(rep_macro) \
 1953|  13.5M|            rep_macro(edge->seg_pred, off, seg_pred); \
 1954|  13.5M|            rep_macro(edge->skip_mode, off, b->skip_mode); \
 1955|  13.5M|            rep_macro(edge->intra, off, 0); \
 1956|  13.5M|            rep_macro(edge->skip, off, b->skip); \
 1957|  13.5M|            rep_macro(edge->pal_sz, off, 0); \
 1958|       |            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
 1959|  13.5M|            rep_macro(t->pal_sz_uv[i], off, 0); \
 1960|  13.5M|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
 1961|  13.5M|            rep_macro(edge->comp_type, off, b->comp_type); \
 1962|  13.5M|            rep_macro(edge->filter[0], off, filter[0]); \
 1963|  13.5M|            rep_macro(edge->filter[1], off, filter[1]); \
 1964|  13.5M|            rep_macro(edge->mode, off, b->inter_mode); \
 1965|  13.5M|            rep_macro(edge->ref[0], off, b->ref[0]); \
 1966|  13.5M|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
 1967|  13.5M|            case_set(b_dim[2 + i]);
  ------------------
  |  |   70|  13.5M|    switch (var) { \
  |  |   71|   930k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 1953|   930k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   930k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   930k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1954|   930k|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   930k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   930k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1955|   930k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   930k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   930k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1956|   930k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   930k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   930k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1957|   930k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   930k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   930k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1958|   930k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1959|   930k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   930k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   930k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1960|   930k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   930k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   930k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1961|   930k|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   930k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   930k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1962|   930k|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   930k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   930k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1963|   930k|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   930k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   930k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1964|   930k|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   930k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   930k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1965|   930k|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   930k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   930k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1966|   930k|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   930k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   930k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 930k, False: 12.5M]
  |  |  ------------------
  |  |   72|  1.73M|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 1953|  1.73M|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.73M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.73M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1954|  1.73M|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.73M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.73M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1955|  1.73M|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.73M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.73M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1956|  1.73M|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.73M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.73M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1957|  1.73M|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.73M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.73M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1958|  1.73M|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1959|  1.73M|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.73M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.73M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1960|  1.73M|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.73M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.73M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1961|  1.73M|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.73M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.73M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1962|  1.73M|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.73M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.73M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1963|  1.73M|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.73M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.73M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1964|  1.73M|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.73M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.73M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1965|  1.73M|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.73M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.73M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1966|  1.73M|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.73M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.73M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 1.73M, False: 11.7M]
  |  |  ------------------
  |  |   73|  1.35M|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 1953|  1.35M|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.35M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.35M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1954|  1.35M|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.35M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.35M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1955|  1.35M|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.35M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.35M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1956|  1.35M|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.35M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.35M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1957|  1.35M|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.35M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.35M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1958|  1.35M|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1959|  1.35M|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.35M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.35M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1960|  1.35M|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.35M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.35M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1961|  1.35M|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.35M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.35M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1962|  1.35M|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.35M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.35M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1963|  1.35M|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.35M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.35M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1964|  1.35M|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.35M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.35M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1965|  1.35M|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.35M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.35M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1966|  1.35M|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.35M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.35M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 1.35M, False: 12.1M]
  |  |  ------------------
  |  |   74|   504k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 1953|   504k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   504k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   504k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1954|   504k|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   504k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   504k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1955|   504k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   504k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   504k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1956|   504k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   504k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   504k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1957|   504k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   504k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   504k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1958|   504k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1959|   504k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   504k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   504k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1960|   504k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   504k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   504k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1961|   504k|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   504k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   504k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1962|   504k|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   504k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   504k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1963|   504k|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   504k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   504k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1964|   504k|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   504k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   504k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1965|   504k|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   504k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   504k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1966|   504k|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   504k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   504k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 504k, False: 12.9M]
  |  |  ------------------
  |  |   75|  2.66M|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 1953|  2.66M|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.66M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.66M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.66M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.66M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.66M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1954|  2.66M|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.66M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.66M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.66M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.66M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.66M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1955|  2.66M|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.66M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.66M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.66M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.66M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.66M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1956|  2.66M|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.66M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.66M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.66M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.66M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.66M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1957|  2.66M|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.66M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.66M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.66M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.66M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.66M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1958|  2.66M|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1959|  2.66M|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.66M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.66M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.66M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.66M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.66M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1960|  2.66M|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.66M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.66M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.66M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.66M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.66M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1961|  2.66M|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.66M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.66M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.66M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.66M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.66M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1962|  2.66M|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.66M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.66M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.66M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.66M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.66M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1963|  2.66M|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.66M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.66M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.66M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.66M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.66M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1964|  2.66M|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.66M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.66M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.66M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.66M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.66M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1965|  2.66M|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.66M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.66M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.66M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.66M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.66M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1966|  2.66M|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.66M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.66M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.66M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.66M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.66M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 2.66M, False: 10.8M]
  |  |  ------------------
  |  |   76|  6.32M|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  | 1953|  6.32M|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.32M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.32M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.32M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.32M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.32M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1954|  6.32M|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.32M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.32M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.32M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.32M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.32M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1955|  6.32M|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.32M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.32M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.32M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.32M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.32M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1956|  6.32M|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.32M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.32M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.32M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.32M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.32M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1957|  6.32M|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.32M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.32M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.32M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.32M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.32M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1958|  6.32M|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1959|  6.32M|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.32M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.32M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.32M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.32M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.32M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1960|  6.32M|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.32M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.32M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.32M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.32M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.32M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1961|  6.32M|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.32M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.32M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.32M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.32M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.32M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1962|  6.32M|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.32M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.32M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.32M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.32M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.32M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1963|  6.32M|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.32M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.32M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.32M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.32M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.32M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1964|  6.32M|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.32M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.32M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.32M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.32M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.32M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1965|  6.32M|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.32M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.32M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.32M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.32M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.32M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1966|  6.32M|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  6.32M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  6.32M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  6.32M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  6.32M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 6.32M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 6.32M, False: 7.17M]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 13.5M]
  |  |  ------------------
  |  |   78|  13.5M|    }
  ------------------
  |  Branch (1967:13): [Folded, False: 0]
  ------------------
 1968|  13.4M|#undef set_ctx
 1969|  13.4M|        }
 1970|  6.69M|        if (has_chroma) {
  ------------------
  |  Branch (1970:13): [True: 1.52M, False: 5.16M]
  ------------------
 1971|  1.52M|            dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], DC_PRED);
 1972|  1.52M|            dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], DC_PRED);
 1973|  1.52M|        }
 1974|  6.69M|    }
 1975|       |
 1976|       |    // update contexts
 1977|  16.0M|    if (f->frame_hdr->segmentation.enabled &&
  ------------------
  |  Branch (1977:9): [True: 6.26M, False: 9.83M]
  ------------------
 1978|  6.26M|        f->frame_hdr->segmentation.update_map)
  ------------------
  |  Branch (1978:9): [True: 5.07M, False: 1.19M]
  ------------------
 1979|  5.07M|    {
 1980|  5.07M|        uint8_t *seg_ptr = &f->cur_segmap[t->by * f->b4_stride + t->bx];
 1981|  5.07M|#define set_ctx(rep_macro) \
 1982|  5.07M|        for (int y = 0; y < bh4; y++) { \
 1983|  5.07M|            rep_macro(seg_ptr, 0, b->seg_id); \
 1984|  5.07M|            seg_ptr += f->b4_stride; \
 1985|  5.07M|        }
 1986|  5.07M|        case_set(b_dim[2]);
  ------------------
  |  |   70|  5.07M|    switch (var) { \
  |  |   71|   218k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 1982|   655k|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:25): [True: 437k, False: 218k]
  |  |  |  |  ------------------
  |  |  |  | 1983|   437k|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   437k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   437k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1984|   437k|            seg_ptr += f->b4_stride; \
  |  |  |  | 1985|   437k|        }
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 218k, False: 4.85M]
  |  |  ------------------
  |  |   72|   362k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 1982|  1.33M|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:25): [True: 974k, False: 362k]
  |  |  |  |  ------------------
  |  |  |  | 1983|   974k|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   974k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   974k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1984|   974k|            seg_ptr += f->b4_stride; \
  |  |  |  | 1985|   974k|        }
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 362k, False: 4.70M]
  |  |  ------------------
  |  |   73|   440k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 1982|  2.18M|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:25): [True: 1.74M, False: 440k]
  |  |  |  |  ------------------
  |  |  |  | 1983|  1.74M|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.74M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.74M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1984|  1.74M|            seg_ptr += f->b4_stride; \
  |  |  |  | 1985|  1.74M|        }
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 440k, False: 4.63M]
  |  |  ------------------
  |  |   74|   182k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 1982|  1.19M|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:25): [True: 1.01M, False: 182k]
  |  |  |  |  ------------------
  |  |  |  | 1983|  1.01M|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  1.01M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  1.01M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1984|  1.01M|            seg_ptr += f->b4_stride; \
  |  |  |  | 1985|  1.01M|        }
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 182k, False: 4.88M]
  |  |  ------------------
  |  |   75|   716k|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 1982|  11.9M|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:25): [True: 11.2M, False: 716k]
  |  |  |  |  ------------------
  |  |  |  | 1983|  11.2M|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  11.2M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  11.2M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  11.2M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  11.2M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 11.2M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1984|  11.2M|            seg_ptr += f->b4_stride; \
  |  |  |  | 1985|  11.2M|        }
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 716k, False: 4.35M]
  |  |  ------------------
  |  |   76|  3.16M|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  | 1982|   103M|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:25): [True: 100M, False: 3.16M]
  |  |  |  |  ------------------
  |  |  |  | 1983|   100M|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   100M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   100M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   100M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   100M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 100M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1984|   100M|            seg_ptr += f->b4_stride; \
  |  |  |  | 1985|   100M|        }
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 3.16M, False: 1.90M]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 5.07M]
  |  |  ------------------
  |  |   78|  5.07M|    }
  ------------------
  |  Branch (1986:9): [Folded, False: 0]
  ------------------
 1987|  5.05M|#undef set_ctx
 1988|  5.05M|    }
 1989|  16.0M|    if (!b->skip) {
  ------------------
  |  Branch (1989:9): [True: 7.97M, False: 8.10M]
  ------------------
 1990|  7.97M|        uint16_t (*noskip_mask)[2] = &t->lf_mask->noskip_mask[by4 >> 1];
 1991|  7.97M|        const unsigned mask = (~0U >> (32 - bw4)) << (bx4 & 15);
 1992|  7.97M|        const int bx_idx = (bx4 & 16) >> 4;
 1993|  25.0M|        for (int y = 0; y < bh4; y += 2, noskip_mask++) {
  ------------------
  |  Branch (1993:25): [True: 17.0M, False: 7.97M]
  ------------------
 1994|  17.0M|            (*noskip_mask)[bx_idx] |= mask;
 1995|  17.0M|            if (bw4 == 32) // this should be mask >> 16, but it's 0xffffffff anyway
  ------------------
  |  Branch (1995:17): [True: 2.45M, False: 14.5M]
  ------------------
 1996|  2.45M|                (*noskip_mask)[1] |= mask;
 1997|  17.0M|        }
 1998|  7.97M|    }
 1999|       |
 2000|  16.1M|    if (t->frame_thread.pass == 1 && !b->intra && IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|  8.10M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 6.71M, False: 1.39M]
  |  |  ------------------
  ------------------
  |  Branch (2000:9): [True: 16.1M, False: 18.4E]
  |  Branch (2000:38): [True: 8.11M, False: 7.99M]
  ------------------
 2001|  6.71M|        const int sby = (t->by - ts->tiling.row_start) >> f->sb_shift;
 2002|  6.71M|        int (*const lowest_px)[2] = ts->lowest_pixel[sby];
 2003|       |
 2004|       |        // keep track of motion vectors for each reference
 2005|  6.71M|        if (b->comp_type == COMP_INTER_NONE) {
  ------------------
  |  Branch (2005:13): [True: 6.37M, False: 334k]
  ------------------
 2006|       |            // y
 2007|  6.37M|            if (imin(bw4, bh4) > 1 &&
  ------------------
  |  Branch (2007:17): [True: 5.73M, False: 647k]
  ------------------
 2008|  5.73M|                ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (2008:19): [True: 4.61M, False: 1.11M]
  |  Branch (2008:48): [True: 1.08M, False: 3.53M]
  ------------------
 2009|  4.65M|                 (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (2009:19): [True: 205k, False: 4.44M]
  |  Branch (2009:48): [True: 193k, False: 11.7k]
  ------------------
 2010|  1.27M|            {
 2011|  1.27M|                affine_lowest_px_luma(t, &lowest_px[b->ref[0]][0], b_dim,
 2012|  1.27M|                                      b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (2012:39): [True: 193k, False: 1.08M]
  ------------------
 2013|  1.27M|                                      &f->frame_hdr->gmv[b->ref[0]]);
 2014|  5.10M|            } else {
 2015|  5.10M|                mc_lowest_px(&lowest_px[b->ref[0]][0], t->by, bh4, b->mv[0].y,
 2016|  5.10M|                             0, &f->svc[b->ref[0]][1]);
 2017|  5.10M|                if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (2017:21): [True: 553k, False: 4.54M]
  ------------------
 2018|   553k|                    obmc_lowest_px(t, lowest_px, 0, b_dim, bx4, by4, w4, h4);
 2019|   553k|                }
 2020|  5.10M|            }
 2021|       |
 2022|       |            // uv
 2023|  6.37M|            if (has_chroma) {
  ------------------
  |  Branch (2023:17): [True: 1.38M, False: 4.99M]
  ------------------
 2024|       |                // sub8x8 derivation
 2025|  1.38M|                int is_sub8x8 = bw4 == ss_hor || bh4 == ss_ver;
  ------------------
  |  Branch (2025:33): [True: 81.3k, False: 1.30M]
  |  Branch (2025:50): [True: 44.5k, False: 1.26M]
  ------------------
 2026|  1.38M|                refmvs_block *const *r;
 2027|  1.38M|                if (is_sub8x8) {
  ------------------
  |  Branch (2027:21): [True: 129k, False: 1.25M]
  ------------------
 2028|   129k|                    assert(ss_hor == 1);
  ------------------
  |  Branch (2028:21): [True: 129k, False: 0]
  ------------------
 2029|   129k|                    r = &t->rt.r[(t->by & 31) + 5];
 2030|   129k|                    if (bw4 == 1) is_sub8x8 &= r[0][t->bx - 1].ref.ref[0] > 0;
  ------------------
  |  Branch (2030:25): [True: 83.8k, False: 45.3k]
  ------------------
 2031|   129k|                    if (bh4 == ss_ver) is_sub8x8 &= r[-1][t->bx].ref.ref[0] > 0;
  ------------------
  |  Branch (2031:25): [True: 92.9k, False: 36.2k]
  ------------------
 2032|   129k|                    if (bw4 == 1 && bh4 == ss_ver)
  ------------------
  |  Branch (2032:25): [True: 83.8k, False: 45.3k]
  |  Branch (2032:37): [True: 47.5k, False: 36.3k]
  ------------------
 2033|  47.5k|                        is_sub8x8 &= r[-1][t->bx - 1].ref.ref[0] > 0;
 2034|   129k|                }
 2035|       |
 2036|       |                // chroma prediction
 2037|  1.38M|                if (is_sub8x8) {
  ------------------
  |  Branch (2037:21): [True: 115k, False: 1.27M]
  ------------------
 2038|   115k|                    assert(ss_hor == 1);
  ------------------
  |  Branch (2038:21): [True: 115k, False: 2]
  ------------------
 2039|   115k|                    if (bw4 == 1 && bh4 == ss_ver) {
  ------------------
  |  Branch (2039:25): [True: 72.9k, False: 42.1k]
  |  Branch (2039:37): [True: 40.7k, False: 32.1k]
  ------------------
 2040|  40.7k|                        const refmvs_block *const rr = &r[-1][t->bx - 1];
 2041|  40.7k|                        mc_lowest_px(&lowest_px[rr->ref.ref[0] - 1][1],
 2042|  40.7k|                                     t->by - 1, bh4, rr->mv.mv[0].y, ss_ver,
 2043|  40.7k|                                     &f->svc[rr->ref.ref[0] - 1][1]);
 2044|  40.7k|                    }
 2045|   115k|                    if (bw4 == 1) {
  ------------------
  |  Branch (2045:25): [True: 72.8k, False: 42.2k]
  ------------------
 2046|  72.8k|                        const refmvs_block *const rr = &r[0][t->bx - 1];
 2047|  72.8k|                        mc_lowest_px(&lowest_px[rr->ref.ref[0] - 1][1],
 2048|  72.8k|                                     t->by, bh4, rr->mv.mv[0].y, ss_ver,
 2049|  72.8k|                                     &f->svc[rr->ref.ref[0] - 1][1]);
 2050|  72.8k|                    }
 2051|   115k|                    if (bh4 == ss_ver) {
  ------------------
  |  Branch (2051:25): [True: 83.0k, False: 32.0k]
  ------------------
 2052|  83.0k|                        const refmvs_block *const rr = &r[-1][t->bx];
 2053|  83.0k|                        mc_lowest_px(&lowest_px[rr->ref.ref[0] - 1][1],
 2054|  83.0k|                                     t->by - 1, bh4, rr->mv.mv[0].y, ss_ver,
 2055|  83.0k|                                     &f->svc[rr->ref.ref[0] - 1][1]);
 2056|  83.0k|                    }
 2057|   115k|                    mc_lowest_px(&lowest_px[b->ref[0]][1], t->by, bh4,
 2058|   115k|                                 b->mv[0].y, ss_ver, &f->svc[b->ref[0]][1]);
 2059|  1.27M|                } else {
 2060|  1.27M|                    if (imin(cbw4, cbh4) > 1 &&
  ------------------
  |  Branch (2060:25): [True: 692k, False: 581k]
  ------------------
 2061|   692k|                        ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (2061:27): [True: 162k, False: 530k]
  |  Branch (2061:56): [True: 25.6k, False: 136k]
  ------------------
 2062|   667k|                         (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (2062:27): [True: 103k, False: 563k]
  |  Branch (2062:56): [True: 100k, False: 2.60k]
  ------------------
 2063|   126k|                    {
 2064|   126k|                        affine_lowest_px_chroma(t, &lowest_px[b->ref[0]][1], b_dim,
 2065|   126k|                                                b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (2065:49): [True: 100k, False: 25.6k]
  ------------------
 2066|   126k|                                                &f->frame_hdr->gmv[b->ref[0]]);
 2067|  1.14M|                    } else {
 2068|  1.14M|                        mc_lowest_px(&lowest_px[b->ref[0]][1],
 2069|  1.14M|                                     t->by & ~ss_ver, bh4 << (bh4 == ss_ver),
 2070|  1.14M|                                     b->mv[0].y, ss_ver, &f->svc[b->ref[0]][1]);
 2071|  1.14M|                        if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (2071:29): [True: 428k, False: 718k]
  ------------------
 2072|   428k|                            obmc_lowest_px(t, lowest_px, 1, b_dim, bx4, by4, w4, h4);
 2073|   428k|                        }
 2074|  1.14M|                    }
 2075|  1.27M|                }
 2076|  1.38M|            }
 2077|  6.37M|        } else {
 2078|       |            // y
 2079|  1.01M|            for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (2079:29): [True: 677k, False: 334k]
  ------------------
 2080|   677k|                if (b->inter_mode == GLOBALMV_GLOBALMV && f->gmv_warp_allowed[b->ref[i]]) {
  ------------------
  |  Branch (2080:21): [True: 67.3k, False: 609k]
  |  Branch (2080:59): [True: 2.99k, False: 64.3k]
  ------------------
 2081|  2.99k|                    affine_lowest_px_luma(t, &lowest_px[b->ref[i]][0], b_dim,
 2082|  2.99k|                                          &f->frame_hdr->gmv[b->ref[i]]);
 2083|   674k|                } else {
 2084|   674k|                    mc_lowest_px(&lowest_px[b->ref[i]][0], t->by, bh4,
 2085|   674k|                                 b->mv[i].y, 0, &f->svc[b->ref[i]][1]);
 2086|   674k|                }
 2087|   677k|            }
 2088|       |
 2089|       |            // uv
 2090|   334k|            if (has_chroma) for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (2090:17): [True: 107k, False: 227k]
  |  Branch (2090:45): [True: 214k, False: 107k]
  ------------------
 2091|   214k|                if (b->inter_mode == GLOBALMV_GLOBALMV &&
  ------------------
  |  Branch (2091:21): [True: 12.7k, False: 201k]
  ------------------
 2092|  12.7k|                    imin(cbw4, cbh4) > 1 && f->gmv_warp_allowed[b->ref[i]])
  ------------------
  |  Branch (2092:21): [True: 8.60k, False: 4.17k]
  |  Branch (2092:45): [True: 748, False: 7.85k]
  ------------------
 2093|    748|                {
 2094|    748|                    affine_lowest_px_chroma(t, &lowest_px[b->ref[i]][1], b_dim,
 2095|    748|                                            &f->frame_hdr->gmv[b->ref[i]]);
 2096|   213k|                } else {
 2097|   213k|                    mc_lowest_px(&lowest_px[b->ref[i]][1], t->by, bh4,
 2098|   213k|                                 b->mv[i].y, ss_ver, &f->svc[b->ref[i]][1]);
 2099|   213k|                }
 2100|   214k|            }
 2101|   334k|        }
 2102|  6.71M|    }
 2103|       |
 2104|  16.0M|    return 0;
 2105|  16.0M|}
decode.c:get_prev_frame_segid:
  536|  1.02M|{
  537|  1.02M|    assert(f->frame_hdr->primary_ref_frame != DAV1D_PRIMARY_REF_NONE);
  ------------------
  |  Branch (537:5): [True: 1.02M, False: 18.4E]
  ------------------
  538|       |
  539|  1.02M|    unsigned seg_id = 8;
  540|  1.02M|    ref_seg_map += by * stride + bx;
  541|  1.11M|    do {
  542|  16.0M|        for (int x = 0; x < w4; x++)
  ------------------
  |  Branch (542:25): [True: 14.9M, False: 1.11M]
  ------------------
  543|  14.9M|            seg_id = imin(seg_id, ref_seg_map[x]);
  544|  1.11M|        ref_seg_map += stride;
  545|  1.11M|    } while (--h4 > 0 && seg_id);
  ------------------
  |  Branch (545:14): [True: 1.08M, False: 29.0k]
  |  Branch (545:26): [True: 96.3k, False: 993k]
  ------------------
  546|  1.02M|    assert(seg_id < 8);
  ------------------
  |  Branch (546:5): [True: 1.01M, False: 5.84k]
  ------------------
  547|       |
  548|  1.01M|    return seg_id;
  549|  1.02M|}
decode.c:neg_deinterleave:
  168|  4.67M|static int neg_deinterleave(int diff, int ref, int max) {
  169|  4.67M|    if (!ref) return diff;
  ------------------
  |  Branch (169:9): [True: 4.22M, False: 449k]
  ------------------
  170|   449k|    if (ref >= (max - 1)) return max - diff - 1;
  ------------------
  |  Branch (170:9): [True: 91.4k, False: 357k]
  ------------------
  171|   357k|    if (2 * ref < max) {
  ------------------
  |  Branch (171:9): [True: 240k, False: 117k]
  ------------------
  172|   240k|        if (diff <= 2 * ref) {
  ------------------
  |  Branch (172:13): [True: 191k, False: 48.5k]
  ------------------
  173|   191k|            if (diff & 1)
  ------------------
  |  Branch (173:17): [True: 28.8k, False: 162k]
  ------------------
  174|  28.8k|                return ref + ((diff + 1) >> 1);
  175|   162k|            else
  176|   162k|                return ref - (diff >> 1);
  177|   191k|        }
  178|  48.5k|        return diff;
  179|   240k|    } else {
  180|   117k|        if (diff <= 2 * (max - ref - 1)) {
  ------------------
  |  Branch (180:13): [True: 109k, False: 8.02k]
  ------------------
  181|   109k|            if (diff & 1)
  ------------------
  |  Branch (181:17): [True: 21.5k, False: 87.9k]
  ------------------
  182|  21.5k|                return ref + ((diff + 1) >> 1);
  183|  87.9k|            else
  184|  87.9k|                return ref - (diff >> 1);
  185|   109k|        }
  186|  8.02k|        return max - (diff + 1);
  187|   117k|    }
  188|   357k|}
decode.c:read_pal_indices:
  381|   268k|{
  382|   268k|    Dav1dTileState *const ts = t->ts;
  383|   268k|    const ptrdiff_t stride = bw4 * 4;
  384|   268k|    assert(pal_idx);
  ------------------
  |  Branch (384:5): [True: 268k, False: 43]
  ------------------
  385|   268k|    uint8_t *const pal_tmp = t->scratch.pal_idx_uv;
  386|   268k|    pal_tmp[0] = dav1d_msac_decode_uniform(&ts->msac, pal_sz);
  387|   268k|    uint16_t (*const color_map_cdf)[8] =
  388|   268k|        ts->cdf.m.color_map[pl][pal_sz - 2];
  389|       |
  390|   268k|    if (pal_sz == 2) {
  ------------------
  |  Branch (390:9): [True: 47.1k, False: 221k]
  ------------------
  391|       |        // Binary palette: ctx 1 is unreachable (needs 3 distinct neighbours),
  392|       |        // and resolve always toggles the single priority value. Use a bool
  393|       |        // decode instead of a symbol decode. ctx formula collapses to:
  394|       |        // border -> 0, interior -> 2 + same_t_l + (same_t_l & same_t_tl)
  395|  1.17M|        for (int i = 1; i < 4 * (w4 + h4) - 1; i++) {
  ------------------
  |  Branch (395:25): [True: 1.12M, False: 47.1k]
  ------------------
  396|  1.12M|            const int first = imin(i, w4 * 4 - 1);
  397|  1.12M|            const int last = imax(0, i - h4 * 4 + 1);
  398|  1.12M|            int have_top = i > first;
  399|  1.12M|            const uint8_t *pal_row = pal_tmp + first + (i - first) * stride;
  400|  9.50M|            for (int j = first; j >= last; have_top = 1, j--, pal_row += stride - 1) {
  ------------------
  |  Branch (400:33): [True: 8.38M, False: 1.12M]
  ------------------
  401|  8.38M|                const int have_left = j > 0;
  402|  8.38M|                int ctx, p0;
  403|  8.38M|                if (!have_left) {
  ------------------
  |  Branch (403:21): [True: 487k, False: 7.89M]
  ------------------
  404|   487k|                    ctx = 0;
  405|   487k|                    p0 = pal_row[-stride];
  406|  7.89M|                } else if (!have_top) {
  ------------------
  |  Branch (406:28): [True: 642k, False: 7.25M]
  ------------------
  407|   642k|                    ctx = 0;
  408|   642k|                    p0 = pal_row[-1];
  409|  7.25M|                } else {
  410|  7.25M|                    const int l = pal_row[-1], tp = pal_row[-stride];
  411|  7.25M|                    const int tl = pal_row[-(stride + 1)];
  412|  7.25M|                    const int same_t_l = tp == l;
  413|  7.25M|                    const int same_t_tl = tp == tl;
  414|  7.25M|                    ctx = 2 + same_t_l + (same_t_l & same_t_tl);
  415|  7.25M|                    p0 = same_t_l ? tp : tl;
  ------------------
  |  Branch (415:26): [True: 5.76M, False: 1.48M]
  ------------------
  416|  7.25M|                }
  417|  8.38M|                const int bit = dav1d_msac_decode_bool_adapt(
  ------------------
  |  |   52|  8.38M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  418|  8.38M|                    &ts->msac, color_map_cdf[ctx]);
  419|  8.38M|                pal_tmp[(i - j) * stride + j] = bit ^ p0;
  420|  8.38M|            }
  421|  1.12M|        }
  422|  47.1k|        t->c->pal_dsp.pal_idx_finish(pal_idx, pal_tmp, bw4 * 4, bh4 * 4,
  423|  47.1k|                                     w4 * 4, h4 * 4);
  424|  47.1k|        return;
  425|  47.1k|    }
  426|       |
  427|   221k|    unsigned (*const symbol_adapt)(MsacContext *, uint16_t *, size_t) =
  428|   221k|        pal_sz <= 4 ? dav1d_msac_decode_symbol_adapt4 : dav1d_msac_decode_symbol_adapt8;
  ------------------
  |  |   47|   102k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
                      pal_sz <= 4 ? dav1d_msac_decode_symbol_adapt4 : dav1d_msac_decode_symbol_adapt8;
  ------------------
  |  |   48|   118k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  |  Branch (428:9): [True: 102k, False: 118k]
  ------------------
  429|       |
  430|  5.71M|    for (int i = 1; i < 4 * (w4 + h4) - 1; i++) {
  ------------------
  |  Branch (430:21): [True: 5.49M, False: 221k]
  ------------------
  431|       |        // top/left-to-bottom/right diagonals ("wave-front")
  432|  5.49M|        const int first = imin(i, w4 * 4 - 1);
  433|  5.49M|        const int last = imax(0, i - h4 * 4 + 1);
  434|  5.49M|        int have_top = i > first;
  435|  5.49M|        const uint8_t *pal_row = pal_tmp + first + (i - first) * stride;
  436|  57.1M|        for (int j = first; j >= last; have_top = 1, j--, pal_row += stride - 1) {
  ------------------
  |  Branch (436:29): [True: 51.6M, False: 5.49M]
  ------------------
  437|  51.6M|            const int have_left = j > 0;
  438|  51.6M|            uint8_t p[3];
  439|  51.6M|            unsigned mask;
  440|  51.6M|            int ctx, prio_count;
  441|  51.6M|            if (!have_left) {
  ------------------
  |  Branch (441:17): [True: 2.40M, False: 49.2M]
  ------------------
  442|  2.40M|                ctx = 0; prio_count = 1;
  443|  2.40M|                p[0] = pal_row[-stride];
  444|  2.40M|                mask = 1u << p[0];
  445|  49.2M|            } else if (!have_top) {
  ------------------
  |  Branch (445:24): [True: 3.24M, False: 45.9M]
  ------------------
  446|  3.24M|                ctx = 0; prio_count = 1;
  447|  3.24M|                p[0] = pal_row[-1];
  448|  3.24M|                mask = 1u << p[0];
  449|  45.9M|            } else {
  450|  45.9M|                const int l = pal_row[-1], tp = pal_row[-stride];
  451|  45.9M|                const int tl = pal_row[-(stride + 1)];
  452|  45.9M|                const int same_t_l = tp == l;
  453|  45.9M|                const int same_t_tl = tp == tl;
  454|  45.9M|                const int same_l_tl = l == tl;
  455|  45.9M|                if (same_t_l & same_t_tl) {
  ------------------
  |  Branch (455:21): [True: 18.5M, False: 27.4M]
  ------------------
  456|  18.5M|                    ctx = 4; prio_count = 1;
  457|  18.5M|                    p[0] = tp; mask = 1u << tp;
  458|  27.4M|                } else if (same_t_l) {
  ------------------
  |  Branch (458:28): [True: 5.26M, False: 22.2M]
  ------------------
  459|  5.26M|                    ctx = 3; prio_count = 2;
  460|  5.26M|                    p[0] = tp; p[1] = tl;
  461|  5.26M|                    mask = (1u << tp) | (1u << tl);
  462|  22.2M|                } else if (same_t_tl | same_l_tl) {
  ------------------
  |  Branch (462:28): [True: 17.8M, False: 4.39M]
  ------------------
  463|  17.8M|                    ctx = 2; prio_count = 2;
  464|  17.8M|                    p[0] = tl; p[1] = same_t_tl ? l : tp;
  ------------------
  |  Branch (464:39): [True: 9.03M, False: 8.77M]
  ------------------
  465|  17.8M|                    mask = (1u << tl) | (1u << p[1]);
  466|  17.8M|                } else {
  467|  4.39M|                    ctx = 1; prio_count = 3;
  468|  4.39M|                    p[0] = imin(tp, l); p[1] = imax(tp, l); p[2] = tl;
  469|  4.39M|                    mask = (1u << tp) | (1u << l) | (1u << tl);
  470|  4.39M|                }
  471|  45.9M|            }
  472|  51.6M|            const int color_idx = symbol_adapt(&ts->msac, color_map_cdf[ctx], pal_sz - 1);
  473|  51.6M|            pal_tmp[(i - j) * stride + j] =
  474|  51.6M|                resolve_pal_color(color_idx, p, prio_count, mask);
  475|  51.6M|        }
  476|  5.49M|    }
  477|       |
  478|   221k|    t->c->pal_dsp.pal_idx_finish(pal_idx, pal_tmp, bw4 * 4, bh4 * 4,
  479|   221k|                                 w4 * 4, h4 * 4);
  480|   221k|}
decode.c:resolve_pal_color:
  351|  51.5M|{
  352|  51.5M|    if (color_idx < prio_count)
  ------------------
  |  Branch (352:9): [True: 39.2M, False: 12.3M]
  ------------------
  353|  39.2M|        return p[color_idx];
  354|  12.3M|    unsigned rank = color_idx - prio_count + (mask & 1);
  355|  12.3M|    rank += ((mask >> 1) & 1) & (rank > 0);
  356|       |    // Unset-bit positions minus their ranks, packed in 2-bit fields.
  357|       |    // Mask bits 0 and 1 are cleared and compensated in rank.
  358|       |    // At most three priority colors keep each offset within 0..3.
  359|  12.3M|    static const uint8_t free_offsets2[] = {
  360|  12.3M|        0x00, 0x00, 0x50, 0x15, 0x40, 0x15, 0xa0, 0x0a, 0x00, 0x15, 0x90, 0x0a,
  361|  12.3M|        0x80, 0x0a, 0xf0, 0x03, 0x00, 0x14, 0x50, 0x0a, 0x40, 0x0a, 0xe0, 0x03,
  362|  12.3M|        0x00, 0x0a, 0xd0, 0x03, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x10, 0x50, 0x09,
  363|  12.3M|        0x40, 0x09, 0xa0, 0x03, 0x00, 0x09, 0x90, 0x03, 0x80, 0x03, 0x00, 0x00,
  364|  12.3M|        0x00, 0x08, 0x50, 0x03, 0x40, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
  365|  12.3M|        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x05, 0x40, 0x05, 0xa0, 0x02,
  366|  12.3M|        0x00, 0x05, 0x90, 0x02, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x50, 0x02,
  367|  12.3M|        0x40, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  368|  12.3M|        0x00, 0x00, 0x50, 0x01, 0x40, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
  369|  12.3M|        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  370|  12.3M|    };
  371|  12.3M|    const unsigned byte_idx = 2 * (mask >> 2) + (rank >> 2);
  372|  12.3M|    assert(byte_idx < sizeof(free_offsets2));
  ------------------
  |  Branch (372:5): [True: 14.3M, False: 18.4E]
  ------------------
  373|  14.3M|    return rank + ((free_offsets2[byte_idx] >> (2 * (rank & 3))) & 3);
  374|  12.3M|}
decode.c:splat_intraref:
  603|  6.27M|{
  604|  6.27M|    const refmvs_block ALIGN(tmpl, 16) = (refmvs_block) {
  605|  6.27M|        .ref.ref = { 0, -1 },
  606|  6.27M|        .mv.mv[0].n = INVALID_MV,
  ------------------
  |  |   40|  6.27M|#define INVALID_MV 0x80008000
  ------------------
  607|  6.27M|        .bs = bs,
  608|  6.27M|        .mf = 0,
  609|  6.27M|    };
  610|  6.27M|    c->refmvs_dsp.splat_mv(&t->rt.r[(t->by & 31) + 5], &tmpl, t->bx, bw4, bh4);
  611|  6.27M|}
decode.c:read_mv_residual:
  108|  2.11M|{
  109|  2.11M|    MsacContext *const msac = &ts->msac;
  110|  2.11M|    const enum MVJoint mv_joint =
  111|  2.11M|        dav1d_msac_decode_symbol_adapt4(msac, ts->cdf.mv.joint, N_MV_JOINTS - 1);
  ------------------
  |  |   47|  2.11M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
  112|  2.11M|    if (mv_joint & MV_JOINT_V)
  ------------------
  |  Branch (112:9): [True: 1.68M, False: 437k]
  ------------------
  113|  1.68M|        ref_mv->y += read_mv_component_diff(msac, &ts->cdf.mv.comp[0], mv_prec);
  114|  2.11M|    if (mv_joint & MV_JOINT_H)
  ------------------
  |  Branch (114:9): [True: 1.60M, False: 512k]
  ------------------
  115|  1.60M|        ref_mv->x += read_mv_component_diff(msac, &ts->cdf.mv.comp[1], mv_prec);
  116|  2.11M|}
decode.c:read_mv_component_diff:
   79|  3.26M|{
   80|  3.26M|    const int sign = dav1d_msac_decode_bool_adapt(msac, mv_comp->sign);
  ------------------
  |  |   52|  3.26M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   81|  3.26M|    const int cl = dav1d_msac_decode_symbol_adapt16(msac, mv_comp->classes, 10);
  ------------------
  |  |   57|  3.26M|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
   82|  3.26M|    int up, fp = 3, hp = 1;
   83|       |
   84|  3.26M|    if (!cl) {
  ------------------
  |  Branch (84:9): [True: 1.50M, False: 1.75M]
  ------------------
   85|  1.50M|        up = dav1d_msac_decode_bool_adapt(msac, mv_comp->class0);
  ------------------
  |  |   52|  1.50M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   86|  1.50M|        if (mv_prec >= 0) {  // !force_integer_mv
  ------------------
  |  Branch (86:13): [True: 716k, False: 787k]
  ------------------
   87|   716k|            fp = dav1d_msac_decode_symbol_adapt4(msac, mv_comp->class0_fp[up], 3);
  ------------------
  |  |   47|   716k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
   88|   716k|            if (mv_prec > 0) // allow_high_precision_mv
  ------------------
  |  Branch (88:17): [True: 389k, False: 326k]
  ------------------
   89|   389k|                hp = dav1d_msac_decode_bool_adapt(msac, mv_comp->class0_hp);
  ------------------
  |  |   52|   389k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   90|   716k|        }
   91|  1.75M|    } else {
   92|  1.75M|        up = 1 << cl;
   93|  17.5M|        for (int n = 0; n < cl; n++)
  ------------------
  |  Branch (93:25): [True: 15.7M, False: 1.75M]
  ------------------
   94|  15.7M|            up |= dav1d_msac_decode_bool_adapt(msac, mv_comp->classN[n]) << n;
  ------------------
  |  |   52|  15.7M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   95|  1.75M|        if (mv_prec >= 0) {  // !force_integer_mv
  ------------------
  |  Branch (95:13): [True: 237k, False: 1.51M]
  ------------------
   96|   237k|            fp = dav1d_msac_decode_symbol_adapt4(msac, mv_comp->classN_fp, 3);
  ------------------
  |  |   47|   237k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
   97|   237k|            if (mv_prec > 0) // allow_high_precision_mv
  ------------------
  |  Branch (97:17): [True: 116k, False: 121k]
  ------------------
   98|   116k|                hp = dav1d_msac_decode_bool_adapt(msac, mv_comp->classN_hp);
  ------------------
  |  |   52|   116k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   99|   237k|        }
  100|  1.75M|    }
  101|       |
  102|  3.26M|    const int diff = ((up << 3) | (fp << 1) | hp) + 1;
  103|  3.26M|    return apply_sign_bool(diff, sign);
  104|  3.26M|}
decode.c:read_vartx_tree:
  485|  8.09M|{
  486|  8.09M|    const Dav1dFrameContext *const f = t->f;
  487|  8.09M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  488|  8.09M|    const int bw4 = b_dim[0], bh4 = b_dim[1];
  489|       |
  490|       |    // var-tx tree coding
  491|  8.09M|    uint16_t tx_split[2] = { 0 };
  492|  8.09M|    b->max_ytx = dav1d_max_txfm_size_for_bs[bs][0];
  493|  8.09M|    if (!b->skip && (f->frame_hdr->segmentation.lossless[b->seg_id] ||
  ------------------
  |  Branch (493:9): [True: 1.85M, False: 6.23M]
  |  Branch (493:22): [True: 20.5k, False: 1.83M]
  ------------------
  494|  1.83M|                     b->max_ytx == TX_4X4))
  ------------------
  |  Branch (494:22): [True: 169k, False: 1.66M]
  ------------------
  495|   192k|    {
  496|   192k|        b->max_ytx = b->uvtx = TX_4X4;
  497|   192k|        if (f->frame_hdr->txfm_mode == DAV1D_TX_SWITCHABLE) {
  ------------------
  |  Branch (497:13): [True: 26.7k, False: 165k]
  ------------------
  498|  26.7k|            dav1d_memset_pow2[b_dim[2]](&t->a->tx[bx4], TX_4X4);
  499|  26.7k|            dav1d_memset_pow2[b_dim[3]](&t->l.tx[by4], TX_4X4);
  500|  26.7k|        }
  501|  7.89M|    } else if (f->frame_hdr->txfm_mode != DAV1D_TX_SWITCHABLE || b->skip) {
  ------------------
  |  Branch (501:16): [True: 6.59M, False: 1.30M]
  |  Branch (501:66): [True: 816k, False: 487k]
  ------------------
  502|  7.41M|        if (f->frame_hdr->txfm_mode == DAV1D_TX_SWITCHABLE) {
  ------------------
  |  Branch (502:13): [True: 818k, False: 6.59M]
  ------------------
  503|   818k|            dav1d_memset_pow2[b_dim[2]](&t->a->tx[bx4], b_dim[2 + 0]);
  504|   818k|            dav1d_memset_pow2[b_dim[3]](&t->l.tx[by4], b_dim[2 + 1]);
  505|   818k|        }
  506|  7.41M|        b->uvtx = dav1d_max_txfm_size_for_bs[bs][f->cur.p.layout];
  507|  7.41M|    } else {
  508|   480k|        assert(bw4 <= 16 || bh4 <= 16 || b->max_ytx == TX_64X64);
  ------------------
  |  Branch (508:9): [True: 475k, False: 4.48k]
  |  Branch (508:9): [True: 524, False: 3.95k]
  |  Branch (508:9): [True: 3.95k, False: 0]
  ------------------
  509|   487k|        int y, x, y_off, x_off;
  510|   487k|        const TxfmInfo *const ytx = &dav1d_txfm_dimensions[b->max_ytx];
  511|   980k|        for (y = 0, y_off = 0; y < bh4; y += ytx->h, y_off++) {
  ------------------
  |  Branch (511:32): [True: 492k, False: 487k]
  ------------------
  512|   994k|            for (x = 0, x_off = 0; x < bw4; x += ytx->w, x_off++) {
  ------------------
  |  Branch (512:36): [True: 501k, False: 492k]
  ------------------
  513|   501k|                read_tx_tree(t, b->max_ytx, 0, tx_split, x_off, y_off);
  514|       |                // contexts are updated inside read_tx_tree()
  515|   501k|                t->bx += ytx->w;
  516|   501k|            }
  517|   492k|            t->bx -= x;
  518|   492k|            t->by += ytx->h;
  519|   492k|        }
  520|   487k|        t->by -= y;
  521|   487k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   487k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 487k]
  |  |  ------------------
  |  |   35|   487k|        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|   487k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  522|      0|            printf("Post-vartxtree[%x/%x]: r=%d\n",
  523|      0|                   tx_split[0], tx_split[1], t->ts->msac.rng);
  524|   487k|        b->uvtx = dav1d_max_txfm_size_for_bs[bs][f->cur.p.layout];
  525|   487k|    }
  526|  8.09M|    assert(!(tx_split[0] & ~0x33));
  ------------------
  |  Branch (526:5): [True: 8.08M, False: 11.0k]
  ------------------
  527|  8.08M|    b->tx_split0 = (uint8_t)tx_split[0];
  528|  8.08M|    b->tx_split1 = tx_split[1];
  529|  8.08M|}
decode.c:read_tx_tree:
  122|   951k|{
  123|   951k|    const Dav1dFrameContext *const f = t->f;
  124|   951k|    const int bx4 = t->bx & 31, by4 = t->by & 31;
  125|   951k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[from];
  126|   951k|    const int txw = t_dim->lw, txh = t_dim->lh;
  127|   951k|    int is_split;
  128|       |
  129|   951k|    if (depth < 2 && from > (int) TX_4X4) {
  ------------------
  |  Branch (129:9): [True: 803k, False: 147k]
  |  Branch (129:22): [True: 803k, False: 18.4E]
  ------------------
  130|   803k|        const int cat = 2 * (TX_64X64 - t_dim->max) - depth;
  131|   803k|        const int a = t->a->tx[bx4] < txw;
  132|   803k|        const int l = t->l.tx[by4] < txh;
  133|       |
  134|   803k|        is_split = dav1d_msac_decode_bool_adapt(&t->ts->msac,
  ------------------
  |  |   52|   803k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  135|   803k|                       t->ts->cdf.m.txpart[cat][a + l]);
  136|   803k|        if (is_split)
  ------------------
  |  Branch (136:13): [True: 210k, False: 593k]
  ------------------
  137|   210k|            masks[depth] |= 1 << (y_off * 4 + x_off);
  138|   803k|    } else {
  139|   147k|        is_split = 0;
  140|   147k|    }
  141|       |
  142|   951k|    if (is_split && t_dim->max > TX_8X8) {
  ------------------
  |  Branch (142:9): [True: 210k, False: 741k]
  |  Branch (142:21): [True: 158k, False: 51.7k]
  ------------------
  143|   158k|        const enum RectTxfmSize sub = t_dim->sub;
  144|   158k|        const TxfmInfo *const sub_t_dim = &dav1d_txfm_dimensions[sub];
  145|   158k|        const int txsw = sub_t_dim->w, txsh = sub_t_dim->h;
  146|       |
  147|   158k|        read_tx_tree(t, sub, depth + 1, masks, x_off * 2 + 0, y_off * 2 + 0);
  148|   158k|        t->bx += txsw;
  149|   158k|        if (txw >= txh && t->bx < f->bw)
  ------------------
  |  Branch (149:13): [True: 124k, False: 34.1k]
  |  Branch (149:27): [True: 123k, False: 969]
  ------------------
  150|   123k|            read_tx_tree(t, sub, depth + 1, masks, x_off * 2 + 1, y_off * 2 + 0);
  151|   158k|        t->bx -= txsw;
  152|   158k|        t->by += txsh;
  153|   158k|        if (txh >= txw && t->by < f->bh) {
  ------------------
  |  Branch (153:13): [True: 103k, False: 55.1k]
  |  Branch (153:27): [True: 102k, False: 1.05k]
  ------------------
  154|   102k|            read_tx_tree(t, sub, depth + 1, masks, x_off * 2 + 0, y_off * 2 + 1);
  155|   102k|            t->bx += txsw;
  156|   102k|            if (txw >= txh && t->bx < f->bw)
  ------------------
  |  Branch (156:17): [True: 68.4k, False: 34.1k]
  |  Branch (156:31): [True: 67.5k, False: 913]
  ------------------
  157|  67.5k|                read_tx_tree(t, sub, depth + 1, masks,
  158|  67.5k|                             x_off * 2 + 1, y_off * 2 + 1);
  159|   102k|            t->bx -= txsw;
  160|   102k|        }
  161|   158k|        t->by -= txsh;
  162|   792k|    } else {
  163|   792k|        dav1d_memset_pow2[t_dim->lw](&t->a->tx[bx4], is_split ? TX_4X4 : txw);
  ------------------
  |  Branch (163:54): [True: 51.9k, False: 741k]
  ------------------
  164|   792k|        dav1d_memset_pow2[t_dim->lh](&t->l.tx[by4], is_split ? TX_4X4 : txh);
  ------------------
  |  Branch (164:53): [True: 51.8k, False: 741k]
  ------------------
  165|   792k|    }
  166|   951k|}
decode.c:splat_intrabc_mv:
  572|  1.38M|{
  573|  1.38M|    const refmvs_block ALIGN(tmpl, 16) = (refmvs_block) {
  574|  1.38M|        .ref.ref = { 0, -1 },
  575|  1.38M|        .mv.mv[0] = b->mv[0],
  576|  1.38M|        .bs = bs,
  577|  1.38M|        .mf = 0,
  578|  1.38M|    };
  579|  1.38M|    c->refmvs_dsp.splat_mv(&t->rt.r[(t->by & 31) + 5], &tmpl, t->bx, bw4, bh4);
  580|  1.38M|}
decode.c:findoddzero:
  338|  4.22M|static inline int findoddzero(const uint8_t *buf, int len) {
  339|  4.41M|    for (int n = 0; n < len; n++)
  ------------------
  |  Branch (339:21): [True: 4.34M, False: 66.2k]
  ------------------
  340|  4.34M|        if (!buf[n * 2]) return 1;
  ------------------
  |  Branch (340:13): [True: 4.16M, False: 186k]
  ------------------
  341|  66.2k|    return 0;
  342|  4.22M|}
decode.c:find_matching_ref:
  196|  4.16M|{
  197|  4.16M|    /*const*/ refmvs_block *const *r = &t->rt.r[(t->by & 31) + 5];
  198|  4.16M|    int count = 0;
  199|  4.16M|    int have_topleft = have_top && have_left;
  ------------------
  |  Branch (199:24): [True: 4.05M, False: 110k]
  |  Branch (199:36): [True: 1.13M, False: 2.91M]
  ------------------
  200|  4.16M|    int have_topright = imax(bw4, bh4) < 32 &&
  ------------------
  |  Branch (200:25): [True: 1.97M, False: 2.18M]
  ------------------
  201|  1.97M|                        have_top && t->bx + bw4 < t->ts->tiling.col_end &&
  ------------------
  |  Branch (201:25): [True: 1.88M, False: 88.4k]
  |  Branch (201:37): [True: 1.09M, False: 785k]
  ------------------
  202|  1.09M|                        (intra_edge_flags & EDGE_I444_TOP_HAS_RIGHT);
  ------------------
  |  Branch (202:25): [True: 729k, False: 369k]
  ------------------
  203|       |
  204|  4.16M|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  205|  4.16M|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  206|       |
  207|  4.16M|    if (have_top) {
  ------------------
  |  Branch (207:9): [True: 4.04M, False: 112k]
  ------------------
  208|  4.04M|        const refmvs_block *r2 = &r[-1][t->bx];
  209|  4.04M|        if (matches(r2)) {
  ------------------
  |  |  205|  4.04M|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (205:22): [True: 3.88M, False: 160k]
  |  |  |  Branch (205:53): [True: 3.78M, False: 100k]
  |  |  ------------------
  ------------------
  210|  3.78M|            masks[0] |= 1;
  211|  3.78M|            count = 1;
  212|  3.78M|        }
  213|  4.04M|        int aw4 = bs(r2)[0];
  ------------------
  |  |  204|  4.04M|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  214|  4.04M|        if (aw4 >= bw4) {
  ------------------
  |  Branch (214:13): [True: 3.89M, False: 150k]
  ------------------
  215|  3.89M|            const int off = t->bx & (aw4 - 1);
  216|  3.89M|            if (off) have_topleft = 0;
  ------------------
  |  Branch (216:17): [True: 135k, False: 3.76M]
  ------------------
  217|  3.89M|            if (aw4 - off > bw4) have_topright = 0;
  ------------------
  |  Branch (217:17): [True: 138k, False: 3.76M]
  ------------------
  218|  3.89M|        } else {
  219|   150k|            unsigned mask = 1 << aw4;
  220|   356k|            for (int x = aw4; x < w4; x += aw4) {
  ------------------
  |  Branch (220:31): [True: 206k, False: 149k]
  ------------------
  221|   206k|                r2 += aw4;
  222|   206k|                if (matches(r2)) {
  ------------------
  |  |  205|   206k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (205:22): [True: 155k, False: 51.0k]
  |  |  |  Branch (205:53): [True: 140k, False: 15.0k]
  |  |  ------------------
  ------------------
  223|   140k|                    masks[0] |= mask;
  224|   140k|                    if (++count >= 8) return;
  ------------------
  |  Branch (224:25): [True: 417, False: 140k]
  ------------------
  225|   140k|                }
  226|   206k|                aw4 = bs(r2)[0];
  ------------------
  |  |  204|   206k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  227|   206k|                mask <<= aw4;
  228|   206k|            }
  229|   150k|        }
  230|  4.04M|    }
  231|  4.16M|    if (have_left) {
  ------------------
  |  Branch (231:9): [True: 1.24M, False: 2.91M]
  ------------------
  232|  1.24M|        /*const*/ refmvs_block *const *r2 = r;
  233|  1.24M|        if (matches(&r2[0][t->bx - 1])) {
  ------------------
  |  |  205|  1.24M|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (205:22): [True: 1.07M, False: 168k]
  |  |  |  Branch (205:53): [True: 966k, False: 106k]
  |  |  ------------------
  ------------------
  234|   966k|            masks[1] |= 1;
  235|   966k|            if (++count >= 8) return;
  ------------------
  |  Branch (235:17): [True: 264, False: 965k]
  ------------------
  236|   966k|        }
  237|  1.24M|        int lh4 = bs(&r2[0][t->bx - 1])[1];
  ------------------
  |  |  204|  1.24M|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  238|  1.24M|        if (lh4 >= bh4) {
  ------------------
  |  Branch (238:13): [True: 1.07M, False: 165k]
  ------------------
  239|  1.07M|            if (t->by & (lh4 - 1)) have_topleft = 0;
  ------------------
  |  Branch (239:17): [True: 170k, False: 905k]
  ------------------
  240|  1.07M|        } else {
  241|   165k|            unsigned mask = 1 << lh4;
  242|   397k|            for (int y = lh4; y < h4; y += lh4) {
  ------------------
  |  Branch (242:31): [True: 233k, False: 163k]
  ------------------
  243|   233k|                r2 += lh4;
  244|   233k|                if (matches(&r2[0][t->bx - 1])) {
  ------------------
  |  |  205|   233k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (205:22): [True: 176k, False: 57.4k]
  |  |  |  Branch (205:53): [True: 160k, False: 15.5k]
  |  |  ------------------
  ------------------
  245|   160k|                    masks[1] |= mask;
  246|   160k|                    if (++count >= 8) return;
  ------------------
  |  Branch (246:25): [True: 1.61k, False: 159k]
  ------------------
  247|   160k|                }
  248|   232k|                lh4 = bs(&r2[0][t->bx - 1])[1];
  ------------------
  |  |  204|   232k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  249|   232k|                mask <<= lh4;
  250|   232k|            }
  251|   165k|        }
  252|  1.24M|    }
  253|  4.15M|    if (have_topleft && matches(&r[-1][t->bx - 1])) {
  ------------------
  |  |  205|   830k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (205:22): [True: 693k, False: 136k]
  |  |  |  Branch (205:53): [True: 621k, False: 71.9k]
  |  |  ------------------
  ------------------
  |  Branch (253:9): [True: 830k, False: 3.32M]
  ------------------
  254|   621k|        masks[1] |= 1ULL << 32;
  255|   621k|        if (++count >= 8) return;
  ------------------
  |  Branch (255:13): [True: 1.18k, False: 620k]
  ------------------
  256|   621k|    }
  257|  4.15M|    if (have_topright && matches(&r[-1][t->bx + bw4])) {
  ------------------
  |  |  205|   593k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (205:22): [True: 495k, False: 98.4k]
  |  |  |  Branch (205:53): [True: 448k, False: 46.9k]
  |  |  ------------------
  ------------------
  |  Branch (257:9): [True: 593k, False: 3.56M]
  ------------------
  258|   448k|        masks[0] |= 1ULL << 32;
  259|   448k|    }
  260|  4.15M|#undef matches
  261|  4.15M|}
decode.c:derive_warpmv:
  267|   205k|{
  268|   205k|    int pts[8][2 /* in, out */][2 /* x, y */], np = 0;
  269|   205k|    /*const*/ refmvs_block *const *r = &t->rt.r[(t->by & 31) + 5];
  270|       |
  271|   205k|#define add_sample(dx, dy, sx, sy, rp) do { \
  272|   205k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  273|   205k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  274|   205k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  275|   205k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  276|   205k|    np++; \
  277|   205k|} while (0)
  278|       |
  279|       |    // use masks[] to find the projectable motion vectors in the edges
  280|   205k|    if ((unsigned) masks[0] == 1 && !(masks[1] >> 32)) {
  ------------------
  |  Branch (280:9): [True: 143k, False: 62.3k]
  |  Branch (280:37): [True: 63.5k, False: 80.0k]
  ------------------
  281|  63.5k|        const int off = t->bx & (bs(&r[-1][t->bx])[0] - 1);
  ------------------
  |  |  204|  63.5k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  282|  63.5k|        add_sample(-off, 0, 1, -1, &r[-1][t->bx]);
  ------------------
  |  |  271|  63.5k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  272|  63.5k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  63.5k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  273|  63.5k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  63.5k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  63.5k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  275|  63.5k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  276|  63.5k|    np++; \
  |  |  277|  63.5k|} while (0)
  |  |  ------------------
  |  |  |  Branch (277:10): [Folded, False: 63.5k]
  |  |  ------------------
  ------------------
  283|   274k|    } else for (unsigned off = 0, xmask = (uint32_t) masks[0]; np < 8 && xmask;) { // top
  ------------------
  |  Branch (283:64): [True: 274k, False: 234]
  |  Branch (283:74): [True: 132k, False: 142k]
  ------------------
  284|   132k|        const int tz = ctz(xmask);
  285|   132k|        off += tz;
  286|   132k|        xmask >>= tz;
  287|   132k|        add_sample(off, 0, 1, -1, &r[-1][t->bx + off]);
  ------------------
  |  |  271|   132k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  272|   132k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  204|   132k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  273|   132k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  204|   132k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|   132k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  275|   132k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  276|   132k|    np++; \
  |  |  277|   132k|} while (0)
  |  |  ------------------
  |  |  |  Branch (277:10): [Folded, False: 132k]
  |  |  ------------------
  ------------------
  288|   132k|        xmask &= ~1;
  289|   132k|    }
  290|   205k|    if (np < 8 && masks[1] == 1) {
  ------------------
  |  Branch (290:9): [True: 205k, False: 284]
  |  Branch (290:19): [True: 64.1k, False: 141k]
  ------------------
  291|  64.1k|        const int off = t->by & (bs(&r[0][t->bx - 1])[1] - 1);
  ------------------
  |  |  204|  64.1k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  292|  64.1k|        add_sample(0, -off, -1, 1, &r[-off][t->bx - 1]);
  ------------------
  |  |  271|  64.1k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  272|  64.1k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  64.1k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  273|  64.1k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  64.1k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  64.1k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  275|  64.1k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  276|  64.1k|    np++; \
  |  |  277|  64.1k|} while (0)
  |  |  ------------------
  |  |  |  Branch (277:10): [Folded, False: 64.1k]
  |  |  ------------------
  ------------------
  293|   275k|    } else for (unsigned off = 0, ymask = (uint32_t) masks[1]; np < 8 && ymask;) { // left
  ------------------
  |  Branch (293:64): [True: 274k, False: 651]
  |  Branch (293:74): [True: 133k, False: 141k]
  ------------------
  294|   133k|        const int tz = ctz(ymask);
  295|   133k|        off += tz;
  296|   133k|        ymask >>= tz;
  297|   133k|        add_sample(0, off, -1, 1, &r[off][t->bx - 1]);
  ------------------
  |  |  271|   133k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  272|   133k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  204|   133k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  273|   133k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  204|   133k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|   133k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  275|   133k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  276|   133k|    np++; \
  |  |  277|   133k|} while (0)
  |  |  ------------------
  |  |  |  Branch (277:10): [Folded, False: 133k]
  |  |  ------------------
  ------------------
  298|   133k|        ymask &= ~1;
  299|   133k|    }
  300|   205k|    if (np < 8 && masks[1] >> 32) // top/left
  ------------------
  |  Branch (300:9): [True: 205k, False: 823]
  |  Branch (300:19): [True: 107k, False: 97.4k]
  ------------------
  301|   107k|        add_sample(0, 0, -1, -1, &r[-1][t->bx - 1]);
  ------------------
  |  |  271|   107k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  272|   107k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  204|   107k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  273|   107k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  204|   107k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|   107k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  275|   107k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  276|   107k|    np++; \
  |  |  277|   107k|} while (0)
  |  |  ------------------
  |  |  |  Branch (277:10): [Folded, False: 107k]
  |  |  ------------------
  ------------------
  302|   205k|    if (np < 8 && masks[0] >> 32) // top/right
  ------------------
  |  Branch (302:9): [True: 204k, False: 1.09k]
  |  Branch (302:19): [True: 71.9k, False: 132k]
  ------------------
  303|  71.9k|        add_sample(bw4, 0, 1, -1, &r[-1][t->bx + bw4]);
  ------------------
  |  |  271|  71.9k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  272|  71.9k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  71.9k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  273|  71.9k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  71.9k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  71.9k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  275|  71.9k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  276|  71.9k|    np++; \
  |  |  277|  71.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (277:10): [Folded, False: 71.9k]
  |  |  ------------------
  ------------------
  304|   205k|    assert(np > 0 && np <= 8);
  ------------------
  |  Branch (304:5): [True: 205k, False: 243]
  |  Branch (304:5): [True: 205k, False: 0]
  ------------------
  305|   205k|#undef bs
  306|       |
  307|       |    // select according to motion vector difference against a threshold
  308|   205k|    int mvd[8], ret = 0;
  309|   205k|    const int thresh = 4 * iclip(imax(bw4, bh4), 4, 28);
  310|   778k|    for (int i = 0; i < np; i++) {
  ------------------
  |  Branch (310:21): [True: 572k, False: 205k]
  ------------------
  311|   572k|        mvd[i] = abs(pts[i][1][0] - pts[i][0][0] - mv.x) +
  312|   572k|                 abs(pts[i][1][1] - pts[i][0][1] - mv.y);
  313|   572k|        if (mvd[i] > thresh)
  ------------------
  |  Branch (313:13): [True: 127k, False: 444k]
  ------------------
  314|   127k|            mvd[i] = -1;
  315|   444k|        else
  316|   444k|            ret++;
  317|   572k|    }
  318|   205k|    if (!ret) {
  ------------------
  |  Branch (318:9): [True: 29.8k, False: 175k]
  ------------------
  319|  29.8k|        ret = 1;
  320|   199k|    } else for (int i = 0, j = np - 1, k = 0; k < np - ret; k++, i++, j--) {
  ------------------
  |  Branch (320:47): [True: 55.3k, False: 144k]
  ------------------
  321|   100k|        while (mvd[i] != -1) i++;
  ------------------
  |  Branch (321:16): [True: 45.6k, False: 55.3k]
  ------------------
  322|  99.5k|        while (mvd[j] == -1) j--;
  ------------------
  |  Branch (322:16): [True: 44.2k, False: 55.3k]
  ------------------
  323|  55.3k|        assert(i != j);
  ------------------
  |  Branch (323:9): [True: 55.3k, False: 0]
  ------------------
  324|  55.3k|        if (i > j) break;
  ------------------
  |  Branch (324:13): [True: 31.5k, False: 23.7k]
  ------------------
  325|       |        // replace the discarded samples;
  326|  23.7k|        mvd[i] = mvd[j];
  327|  23.7k|        memcpy(pts[i], pts[j], sizeof(*pts));
  328|  23.7k|    }
  329|       |
  330|   205k|    if (!dav1d_find_affine_int(pts, ret, bw4, bh4, mv, wmp, t->bx, t->by) &&
  ------------------
  |  Branch (330:9): [True: 199k, False: 6.54k]
  ------------------
  331|   199k|        !dav1d_get_shear_params(wmp))
  ------------------
  |  Branch (331:9): [True: 193k, False: 5.58k]
  ------------------
  332|   193k|    {
  333|   193k|        wmp->type = DAV1D_WM_TYPE_AFFINE;
  334|   193k|    } else
  335|  12.1k|        wmp->type = DAV1D_WM_TYPE_IDENTITY;
  336|   205k|}
decode.c:splat_tworef_mv:
  587|   340k|{
  588|   340k|    assert(bw4 >= 2 && bh4 >= 2);
  ------------------
  |  Branch (588:5): [True: 340k, False: 18.4E]
  |  Branch (588:5): [True: 340k, False: 18.4E]
  ------------------
  589|   340k|    const enum CompInterPredMode mode = b->inter_mode;
  590|   340k|    const refmvs_block ALIGN(tmpl, 16) = (refmvs_block) {
  591|   340k|        .ref.ref = { b->ref[0] + 1, b->ref[1] + 1 },
  592|   340k|        .mv.mv = { b->mv[0], b->mv[1] },
  593|   340k|        .bs = bs,
  594|   340k|        .mf = (mode == GLOBALMV_GLOBALMV) | !!((1 << mode) & (0xbc)) * 2,
  595|   340k|    };
  596|   340k|    c->refmvs_dsp.splat_mv(&t->rt.r[(t->by & 31) + 5], &tmpl, t->bx, bw4, bh4);
  597|   340k|}
decode.c:splat_oneref_mv:
  556|  6.37M|{
  557|  6.37M|    const enum InterPredMode mode = b->inter_mode;
  558|  6.37M|    const refmvs_block ALIGN(tmpl, 16) = (refmvs_block) {
  559|  6.37M|        .ref.ref = { b->ref[0] + 1, b->interintra_type ? 0 : -1 },
  ------------------
  |  Branch (559:37): [True: 185k, False: 6.19M]
  ------------------
  560|  6.37M|        .mv.mv[0] = b->mv[0],
  561|  6.37M|        .bs = bs,
  562|  6.37M|        .mf = (mode == GLOBALMV && imin(bw4, bh4) >= 2) | ((mode == NEWMV) * 2),
  ------------------
  |  Branch (562:16): [True: 4.80M, False: 1.57M]
  |  Branch (562:36): [True: 4.62M, False: 181k]
  ------------------
  563|  6.37M|    };
  564|  6.37M|    c->refmvs_dsp.splat_mv(&t->rt.r[(t->by & 31) + 5], &tmpl, t->bx, bw4, bh4);
  565|  6.37M|}
decode.c:affine_lowest_px_luma:
  656|  1.30M|{
  657|  1.30M|    affine_lowest_px(t, dst, b_dim, wmp, 0, 0);
  658|  1.30M|}
decode.c:affine_lowest_px:
  634|  1.40M|{
  635|  1.40M|    const int h_mul = 4 >> ss_hor, v_mul = 4 >> ss_ver;
  636|  1.40M|    assert(!((b_dim[0] * h_mul) & 7) && !((b_dim[1] * v_mul) & 7));
  ------------------
  |  Branch (636:5): [True: 1.40M, False: 18.4E]
  |  Branch (636:5): [True: 1.40M, False: 18.4E]
  ------------------
  637|  1.40M|    const int32_t *const mat = wmp->matrix;
  638|  1.40M|    const int y = b_dim[1] * v_mul - 8; // lowest y
  639|       |
  640|  1.40M|    const int src_y = t->by * 4 + ((y + 4) << ss_ver);
  641|  1.40M|    const int64_t mat5_y = (int64_t) mat[5] * src_y + mat[1];
  642|       |    // check left- and right-most blocks
  643|  4.08M|    for (int x = 0; x < b_dim[0] * h_mul; x += imax(8, b_dim[0] * h_mul - 8)) {
  ------------------
  |  Branch (643:21): [True: 2.68M, False: 1.40M]
  ------------------
  644|       |        // calculate transformation relative to center of 8x8 block in
  645|       |        // luma pixel units
  646|  2.68M|        const int src_x = t->bx * 4 + ((x + 4) << ss_hor);
  647|  2.68M|        const int64_t mvy = ((int64_t) mat[4] * src_x + mat5_y) >> ss_ver;
  648|  2.68M|        const int dy = (int) (mvy >> 16) - 4;
  649|  2.68M|        *dst = imax(*dst, dy + 4 + 8);
  650|  2.68M|    }
  651|  1.40M|}
decode.c:mc_lowest_px:
  616|  9.08M|{
  617|  9.08M|    const int v_mul = 4 >> ss_ver;
  618|  9.08M|    if (!smp->scale) {
  ------------------
  |  Branch (618:9): [True: 7.28M, False: 1.80M]
  ------------------
  619|  7.28M|        const int my = mvy >> (3 + ss_ver), dy = mvy & (15 >> !ss_ver);
  620|  7.28M|        *dst = imax(*dst, (by4 + bh4) * v_mul + my + 4 * !!dy);
  621|  7.28M|    } else {
  622|  1.80M|        int y = (by4 * v_mul << 4) + mvy * (1 << !ss_ver);
  623|  1.80M|        const int64_t tmp = (int64_t)(y) * smp->scale + (smp->scale - 0x4000) * 8;
  624|  1.80M|        y = apply_sign64((int)((llabs(tmp) + 128) >> 8), tmp) + 32;
  625|  1.80M|        const int bottom = ((y + (bh4 * v_mul - 1) * smp->step) >> 10) + 1 + 4;
  626|  1.80M|        *dst = imax(*dst, bottom);
  627|  1.80M|    }
  628|  9.08M|}
decode.c:obmc_lowest_px:
  676|   979k|{
  677|   979k|    assert(!(t->bx & 1) && !(t->by & 1));
  ------------------
  |  Branch (677:5): [True: 979k, False: 18.4E]
  |  Branch (677:5): [True: 979k, False: 18.4E]
  ------------------
  678|   979k|    const Dav1dFrameContext *const f = t->f;
  679|   979k|    /*const*/ refmvs_block **r = &t->rt.r[(t->by & 31) + 5];
  680|   979k|    const int ss_ver = is_chroma && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (680:24): [True: 429k, False: 550k]
  |  Branch (680:37): [True: 308k, False: 120k]
  ------------------
  681|   979k|    const int ss_hor = is_chroma && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (681:24): [True: 429k, False: 549k]
  |  Branch (681:37): [True: 308k, False: 120k]
  ------------------
  682|   979k|    const int h_mul = 4 >> ss_hor, v_mul = 4 >> ss_ver;
  683|       |
  684|   979k|    if (t->by > t->ts->tiling.row_start &&
  ------------------
  |  Branch (684:9): [True: 890k, False: 88.9k]
  ------------------
  685|   890k|        (!is_chroma || b_dim[0] * h_mul + b_dim[1] * v_mul >= 16))
  ------------------
  |  Branch (685:10): [True: 496k, False: 393k]
  |  Branch (685:24): [True: 158k, False: 235k]
  ------------------
  686|   658k|    {
  687|  1.38M|        for (int i = 0, x = 0; x < w4 && i < imin(b_dim[2], 4); ) {
  ------------------
  |  Branch (687:32): [True: 729k, False: 656k]
  |  Branch (687:42): [True: 727k, False: 2.45k]
  ------------------
  688|       |            // only odd blocks are considered for overlap handling, hence +1
  689|   727k|            const refmvs_block *const a_r = &r[-1][t->bx + x + 1];
  690|   727k|            const uint8_t *const a_b_dim = dav1d_block_dimensions[a_r->bs];
  691|       |
  692|   727k|            if (a_r->ref.ref[0] > 0) {
  ------------------
  |  Branch (692:17): [True: 701k, False: 25.7k]
  ------------------
  693|   701k|                const int oh4 = imin(b_dim[1], 16) >> 1;
  694|   701k|                mc_lowest_px(&dst[a_r->ref.ref[0] - 1][is_chroma], t->by,
  695|   701k|                             (oh4 * 3 + 3) >> 2, a_r->mv.mv[0].y, ss_ver,
  696|   701k|                             &f->svc[a_r->ref.ref[0] - 1][1]);
  697|   701k|                i++;
  698|   701k|            }
  699|   727k|            x += imax(a_b_dim[0], 2);
  700|   727k|        }
  701|   658k|    }
  702|       |
  703|   979k|    if (t->bx > t->ts->tiling.col_start)
  ------------------
  |  Branch (703:9): [True: 960k, False: 18.8k]
  ------------------
  704|  2.00M|        for (int i = 0, y = 0; y < h4 && i < imin(b_dim[3], 4); ) {
  ------------------
  |  Branch (704:32): [True: 1.04M, False: 956k]
  |  Branch (704:42): [True: 1.04M, False: 3.74k]
  ------------------
  705|       |            // only odd blocks are considered for overlap handling, hence +1
  706|  1.04M|            const refmvs_block *const l_r = &r[y + 1][t->bx - 1];
  707|  1.04M|            const uint8_t *const l_b_dim = dav1d_block_dimensions[l_r->bs];
  708|       |
  709|  1.04M|            if (l_r->ref.ref[0] > 0) {
  ------------------
  |  Branch (709:17): [True: 1.01M, False: 34.0k]
  ------------------
  710|  1.01M|                const int oh4 = iclip(l_b_dim[1], 2, b_dim[1]);
  711|  1.01M|                mc_lowest_px(&dst[l_r->ref.ref[0] - 1][is_chroma],
  712|  1.01M|                             t->by + y, oh4, l_r->mv.mv[0].y, ss_ver,
  713|  1.01M|                             &f->svc[l_r->ref.ref[0] - 1][1]);
  714|  1.01M|                i++;
  715|  1.01M|            }
  716|  1.04M|            y += imax(l_b_dim[1], 2);
  717|  1.04M|        }
  718|   979k|}
decode.c:affine_lowest_px_chroma:
  663|   126k|{
  664|   126k|    const Dav1dFrameContext *const f = t->f;
  665|   126k|    assert(f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400);
  ------------------
  |  Branch (665:5): [True: 126k, False: 0]
  ------------------
  666|   126k|    if (f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I444)
  ------------------
  |  Branch (666:9): [True: 28.5k, False: 98.3k]
  ------------------
  667|  28.5k|        affine_lowest_px_luma(t, dst, b_dim, wmp);
  668|  98.3k|    else
  669|  98.3k|        affine_lowest_px(t, dst, b_dim, wmp, f->cur.p.layout & DAV1D_PIXEL_LAYOUT_I420, 1);
  670|   126k|}
decode.c:read_restoration_info:
 2557|   323k|{
 2558|   323k|    const Dav1dFrameContext *const f = t->f;
 2559|   323k|    Dav1dTileState *const ts = t->ts;
 2560|   323k|    const Av1RestorationUnit *const lr_ref = ts->lr_ref[p];
 2561|       |
 2562|   323k|    if (frame_type == DAV1D_RESTORATION_SWITCHABLE) {
  ------------------
  |  Branch (2562:9): [True: 113k, False: 210k]
  ------------------
 2563|   113k|        const int filter = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|   113k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 2564|   113k|                               ts->cdf.m.restore_switchable, 2);
 2565|   113k|        lr->type = filter + !!filter; /* NONE/WIENER/SGRPROJ */
 2566|   210k|    } else {
 2567|   210k|        const unsigned type =
 2568|   210k|            dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   210k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 2569|   210k|                frame_type == DAV1D_RESTORATION_WIENER ?
  ------------------
  |  Branch (2569:17): [True: 106k, False: 104k]
  ------------------
 2570|   106k|                ts->cdf.m.restore_wiener : ts->cdf.m.restore_sgrproj);
 2571|   210k|        lr->type = type ? frame_type : DAV1D_RESTORATION_NONE;
  ------------------
  |  Branch (2571:20): [True: 58.2k, False: 151k]
  ------------------
 2572|   210k|    }
 2573|       |
 2574|   323k|    if (lr->type == DAV1D_RESTORATION_WIENER) {
  ------------------
  |  Branch (2574:9): [True: 40.7k, False: 282k]
  ------------------
 2575|  40.7k|        lr->filter_v[0] = p ? 0 :
  ------------------
  |  Branch (2575:27): [True: 23.0k, False: 17.6k]
  ------------------
 2576|  40.7k|            dav1d_msac_decode_subexp(&ts->msac,
 2577|  17.6k|                lr_ref->filter_v[0] + 5, 16, 1) - 5;
 2578|  40.7k|        lr->filter_v[1] =
 2579|  40.7k|            dav1d_msac_decode_subexp(&ts->msac,
 2580|  40.7k|                lr_ref->filter_v[1] + 23, 32, 2) - 23;
 2581|  40.7k|        lr->filter_v[2] =
 2582|  40.7k|            dav1d_msac_decode_subexp(&ts->msac,
 2583|  40.7k|                lr_ref->filter_v[2] + 17, 64, 3) - 17;
 2584|       |
 2585|  40.7k|        lr->filter_h[0] = p ? 0 :
  ------------------
  |  Branch (2585:27): [True: 23.1k, False: 17.6k]
  ------------------
 2586|  40.7k|            dav1d_msac_decode_subexp(&ts->msac,
 2587|  17.6k|                lr_ref->filter_h[0] + 5, 16, 1) - 5;
 2588|  40.7k|        lr->filter_h[1] =
 2589|  40.7k|            dav1d_msac_decode_subexp(&ts->msac,
 2590|  40.7k|                lr_ref->filter_h[1] + 23, 32, 2) - 23;
 2591|  40.7k|        lr->filter_h[2] =
 2592|  40.7k|            dav1d_msac_decode_subexp(&ts->msac,
 2593|  40.7k|                lr_ref->filter_h[2] + 17, 64, 3) - 17;
 2594|  40.7k|        memcpy(lr->sgr_weights, lr_ref->sgr_weights, sizeof(lr->sgr_weights));
 2595|  40.7k|        ts->lr_ref[p] = lr;
 2596|  40.7k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  40.7k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 40.7k]
  |  |  ------------------
  |  |   35|  40.7k|        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|  40.7k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2597|      0|            printf("Post-lr_wiener[pl=%d,v[%d,%d,%d],h[%d,%d,%d]]: r=%d\n",
 2598|      0|                   p, lr->filter_v[0], lr->filter_v[1],
 2599|      0|                   lr->filter_v[2], lr->filter_h[0],
 2600|      0|                   lr->filter_h[1], lr->filter_h[2], ts->msac.rng);
 2601|   282k|    } else if (lr->type == DAV1D_RESTORATION_SGRPROJ) {
  ------------------
  |  Branch (2601:16): [True: 50.0k, False: 232k]
  ------------------
 2602|  50.0k|        const unsigned idx = dav1d_msac_decode_bools(&ts->msac, 4);
 2603|  50.0k|        const uint16_t *const sgr_params = dav1d_sgr_params[idx];
 2604|  50.0k|        lr->type += idx;
 2605|  50.0k|        lr->sgr_weights[0] = sgr_params[0] ? dav1d_msac_decode_subexp(&ts->msac,
  ------------------
  |  Branch (2605:30): [True: 40.3k, False: 9.72k]
  ------------------
 2606|  40.3k|            lr_ref->sgr_weights[0] + 96, 128, 4) - 96 : 0;
 2607|  50.0k|        lr->sgr_weights[1] = sgr_params[1] ? dav1d_msac_decode_subexp(&ts->msac,
  ------------------
  |  Branch (2607:30): [True: 28.4k, False: 21.5k]
  ------------------
 2608|  28.4k|            lr_ref->sgr_weights[1] + 32, 128, 4) - 32 : 95;
 2609|  50.0k|        memcpy(lr->filter_v, lr_ref->filter_v, sizeof(lr->filter_v));
 2610|  50.0k|        memcpy(lr->filter_h, lr_ref->filter_h, sizeof(lr->filter_h));
 2611|  50.0k|        ts->lr_ref[p] = lr;
 2612|  50.0k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  50.0k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 50.0k]
  |  |  ------------------
  |  |   35|  50.0k|        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|  50.0k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2613|      0|            printf("Post-lr_sgrproj[pl=%d,idx=%d,w[%d,%d]]: r=%d\n",
 2614|      0|                   p, idx, lr->sgr_weights[0],
 2615|      0|                   lr->sgr_weights[1], ts->msac.rng);
 2616|  50.0k|    }
 2617|   323k|}
decode.c:init_quant_tables:
   57|   235k|{
   58|   723k|    for (int i = 0; i < (frame_hdr->segmentation.enabled ? 8 : 1); i++) {
  ------------------
  |  Branch (58:21): [True: 487k, False: 235k]
  |  Branch (58:26): [True: 325k, False: 397k]
  ------------------
   59|   487k|        const int yac = frame_hdr->segmentation.enabled ?
  ------------------
  |  Branch (59:25): [True: 289k, False: 198k]
  ------------------
   60|   289k|            iclip_u8(qidx + frame_hdr->segmentation.seg_data.d[i].delta_q) : qidx;
   61|   487k|        const int ydc = iclip_u8(yac + frame_hdr->quant.ydc_delta);
   62|   487k|        const int uac = iclip_u8(yac + frame_hdr->quant.uac_delta);
   63|   487k|        const int udc = iclip_u8(yac + frame_hdr->quant.udc_delta);
   64|   487k|        const int vac = iclip_u8(yac + frame_hdr->quant.vac_delta);
   65|   487k|        const int vdc = iclip_u8(yac + frame_hdr->quant.vdc_delta);
   66|       |
   67|   487k|        dq[i][0][0] = dav1d_dq_tbl[seq_hdr->hbd][ydc][0];
   68|   487k|        dq[i][0][1] = dav1d_dq_tbl[seq_hdr->hbd][yac][1];
   69|   487k|        dq[i][1][0] = dav1d_dq_tbl[seq_hdr->hbd][udc][0];
   70|   487k|        dq[i][1][1] = dav1d_dq_tbl[seq_hdr->hbd][uac][1];
   71|   487k|        dq[i][2][0] = dav1d_dq_tbl[seq_hdr->hbd][vdc][0];
   72|   487k|        dq[i][2][1] = dav1d_dq_tbl[seq_hdr->hbd][vac][1];
   73|   487k|    }
   74|   235k|}
decode.c:setup_tile:
 2473|   183k|{
 2474|   183k|    const int col_sb_start = f->frame_hdr->tiling.col_start_sb[tile_col];
 2475|   183k|    const int col_sb128_start = col_sb_start >> !f->seq_hdr->sb128;
 2476|   183k|    const int col_sb_end = f->frame_hdr->tiling.col_start_sb[tile_col + 1];
 2477|   183k|    const int row_sb_start = f->frame_hdr->tiling.row_start_sb[tile_row];
 2478|   183k|    const int row_sb_end = f->frame_hdr->tiling.row_start_sb[tile_row + 1];
 2479|   183k|    const int sb_shift = f->sb_shift;
 2480|       |
 2481|   183k|    const uint8_t *const size_mul = ss_size_mul[f->cur.p.layout];
 2482|   551k|    for (int p = 0; p < 2; p++) {
  ------------------
  |  Branch (2482:21): [True: 367k, False: 183k]
  ------------------
 2483|   367k|        ts->frame_thread[p].pal_idx = f->frame_thread.pal_idx ?
  ------------------
  |  Branch (2483:39): [True: 284k, False: 83.3k]
  ------------------
 2484|   284k|            &f->frame_thread.pal_idx[(size_t)tile_start_off * size_mul[1] / 8] :
 2485|   367k|            NULL;
 2486|   367k|        ts->frame_thread[p].cbi = f->frame_thread.cbi ?
  ------------------
  |  Branch (2486:35): [True: 367k, False: 29]
  ------------------
 2487|   367k|            &f->frame_thread.cbi[(size_t)tile_start_off * size_mul[0] / 64] :
 2488|   367k|            NULL;
 2489|   367k|        ts->frame_thread[p].cf = f->frame_thread.cf ?
  ------------------
  |  Branch (2489:34): [True: 367k, False: 31]
  ------------------
 2490|   367k|            (uint8_t*)f->frame_thread.cf +
 2491|   367k|                (((size_t)tile_start_off * size_mul[0]) >> !f->seq_hdr->hbd) :
 2492|   367k|            NULL;
 2493|   367k|    }
 2494|       |
 2495|   183k|    dav1d_cdf_thread_copy(&ts->cdf, &f->in_cdf);
 2496|   183k|    ts->last_qidx = f->frame_hdr->quant.yac;
 2497|   183k|    ts->last_delta_lf.u32 = 0;
 2498|       |
 2499|   183k|    dav1d_msac_init(&ts->msac, data, sz, f->frame_hdr->disable_cdf_update);
 2500|       |
 2501|   183k|    ts->tiling.row = tile_row;
 2502|   183k|    ts->tiling.col = tile_col;
 2503|   183k|    ts->tiling.col_start = col_sb_start << sb_shift;
 2504|   183k|    ts->tiling.col_end = imin(col_sb_end << sb_shift, f->bw);
 2505|   183k|    ts->tiling.row_start = row_sb_start << sb_shift;
 2506|   183k|    ts->tiling.row_end = imin(row_sb_end << sb_shift, f->bh);
 2507|       |
 2508|       |    // Reference Restoration Unit (used for exp coding)
 2509|   183k|    int sb_idx, unit_idx;
 2510|   183k|    if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (2510:9): [True: 19.9k, False: 163k]
  ------------------
 2511|       |        // vertical components only
 2512|  19.9k|        sb_idx = (ts->tiling.row_start >> 5) * f->sr_sb128w;
 2513|  19.9k|        unit_idx = (ts->tiling.row_start & 16) >> 3;
 2514|   163k|    } else {
 2515|   163k|        sb_idx = (ts->tiling.row_start >> 5) * f->sb128w + col_sb128_start;
 2516|   163k|        unit_idx = ((ts->tiling.row_start & 16) >> 3) +
 2517|   163k|                   ((ts->tiling.col_start & 16) >> 4);
 2518|   163k|    }
 2519|   735k|    for (int p = 0; p < 3; p++) {
  ------------------
  |  Branch (2519:21): [True: 551k, False: 183k]
  ------------------
 2520|   551k|        if (!((f->lf.restore_planes >> p) & 1U))
  ------------------
  |  Branch (2520:13): [True: 504k, False: 46.5k]
  ------------------
 2521|   504k|            continue;
 2522|       |
 2523|  46.5k|        if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (2523:13): [True: 15.4k, False: 31.1k]
  ------------------
 2524|  15.4k|            const int ss_hor = p && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (2524:32): [True: 10.0k, False: 5.36k]
  |  Branch (2524:37): [True: 8.19k, False: 1.87k]
  ------------------
 2525|  15.4k|            const int d = f->frame_hdr->super_res.width_scale_denominator;
 2526|  15.4k|            const int unit_size_log2 = f->frame_hdr->restoration.unit_size[!!p];
 2527|  15.4k|            const int rnd = (8 << unit_size_log2) - 1, shift = unit_size_log2 + 3;
 2528|  15.4k|            const int x = ((4 * ts->tiling.col_start * d >> ss_hor) + rnd) >> shift;
 2529|  15.4k|            const int px_x = x << (unit_size_log2 + ss_hor);
 2530|  15.4k|            const int u_idx = unit_idx + ((px_x & 64) >> 6);
 2531|  15.4k|            const int sb128x = px_x >> 7;
 2532|  15.4k|            if (sb128x >= f->sr_sb128w) continue;
  ------------------
  |  Branch (2532:17): [True: 163, False: 15.2k]
  ------------------
 2533|  15.2k|            ts->lr_ref[p] = &f->lf.lr_mask[sb_idx + sb128x].lr[p][u_idx];
 2534|  31.1k|        } else {
 2535|  31.1k|            ts->lr_ref[p] = &f->lf.lr_mask[sb_idx].lr[p][unit_idx];
 2536|  31.1k|        }
 2537|       |
 2538|  46.4k|        ts->lr_ref[p]->filter_v[0] = 3;
 2539|  46.4k|        ts->lr_ref[p]->filter_v[1] = -7;
 2540|  46.4k|        ts->lr_ref[p]->filter_v[2] = 15;
 2541|  46.4k|        ts->lr_ref[p]->filter_h[0] = 3;
 2542|  46.4k|        ts->lr_ref[p]->filter_h[1] = -7;
 2543|  46.4k|        ts->lr_ref[p]->filter_h[2] = 15;
 2544|  46.4k|        ts->lr_ref[p]->sgr_weights[0] = -32;
 2545|  46.4k|        ts->lr_ref[p]->sgr_weights[1] = 31;
 2546|  46.4k|    }
 2547|       |
 2548|   183k|    if (f->c->n_tc > 1) {
  ------------------
  |  Branch (2548:9): [True: 183k, False: 29]
  ------------------
 2549|   551k|        for (int p = 0; p < 2; p++)
  ------------------
  |  Branch (2549:25): [True: 367k, False: 183k]
  ------------------
 2550|   367k|            atomic_init(&ts->progress[p], row_sb_start);
 2551|   183k|    }
 2552|   183k|}
decode.c:get_upscale_x0:
 3376|  75.9k|static int get_upscale_x0(const int in_w, const int out_w, const int step) {
 3377|  75.9k|    const int err = out_w * step - (in_w << 14);
 3378|  75.9k|    const int x0 = (-((out_w - in_w) << 13) + (out_w >> 1)) / out_w + 128 - (err / 2);
 3379|  75.9k|    return x0 & 0x3fff;
 3380|  75.9k|}

obu.c:get_poc_diff:
  239|  1.02M|{
  240|  1.02M|    if (!order_hint_n_bits) return 0;
  ------------------
  |  Branch (240:9): [True: 0, False: 1.02M]
  ------------------
  241|  1.02M|    const int mask = 1 << (order_hint_n_bits - 1);
  242|  1.02M|    const int diff = poc0 - poc1;
  243|  1.02M|    return (diff & (mask - 1)) - (diff & mask);
  244|  1.02M|}
refmvs.c:get_gmv_2d:
  482|  6.98M|{
  483|  6.98M|    switch (gmv->type) {
  484|   763k|    case DAV1D_WM_TYPE_ROT_ZOOM:
  ------------------
  |  Branch (484:5): [True: 763k, False: 6.21M]
  ------------------
  485|   763k|        assert(gmv->matrix[5] ==  gmv->matrix[2]);
  ------------------
  |  Branch (485:9): [True: 763k, False: 18.4E]
  ------------------
  486|   763k|        assert(gmv->matrix[4] == -gmv->matrix[3]);
  ------------------
  |  Branch (486:9): [True: 763k, False: 18.4E]
  ------------------
  487|       |        // fall-through
  488|   763k|    default:
  ------------------
  |  Branch (488:5): [True: 0, False: 6.98M]
  ------------------
  489|  1.65M|    case DAV1D_WM_TYPE_AFFINE: {
  ------------------
  |  Branch (489:5): [True: 889k, False: 6.09M]
  ------------------
  490|  1.65M|        const int x = bx4 * 4 + bw4 * 2 - 1;
  491|  1.65M|        const int y = by4 * 4 + bh4 * 2 - 1;
  492|  1.65M|        const int xc = (gmv->matrix[2] - (1 << 16)) * x +
  493|  1.65M|                       gmv->matrix[3] * y + gmv->matrix[0];
  494|  1.65M|        const int yc = (gmv->matrix[5] - (1 << 16)) * y +
  495|  1.65M|                       gmv->matrix[4] * x + gmv->matrix[1];
  496|  1.65M|        const int shift = 16 - (3 - !hdr->hp);
  497|  1.65M|        const int round = (1 << shift) >> 1;
  498|  1.65M|        mv res = (mv) {
  499|  1.65M|            .y = apply_sign(((abs(yc) + round) >> shift) << !hdr->hp, yc),
  500|  1.65M|            .x = apply_sign(((abs(xc) + round) >> shift) << !hdr->hp, xc),
  501|  1.65M|        };
  502|  1.65M|        if (hdr->force_integer_mv)
  ------------------
  |  Branch (502:13): [True: 49.3k, False: 1.60M]
  ------------------
  503|  49.3k|            fix_int_mv_precision(&res);
  504|  1.65M|        return res;
  505|   763k|    }
  506|  97.5k|    case DAV1D_WM_TYPE_TRANSLATION: {
  ------------------
  |  Branch (506:5): [True: 97.5k, False: 6.88M]
  ------------------
  507|  97.5k|        mv res = (mv) {
  508|  97.5k|            .y = gmv->matrix[0] >> 13,
  509|  97.5k|            .x = gmv->matrix[1] >> 13,
  510|  97.5k|        };
  511|  97.5k|        if (hdr->force_integer_mv)
  ------------------
  |  Branch (511:13): [True: 1.23k, False: 96.2k]
  ------------------
  512|  1.23k|            fix_int_mv_precision(&res);
  513|  97.5k|        return res;
  514|   763k|    }
  515|  5.25M|    case DAV1D_WM_TYPE_IDENTITY:
  ------------------
  |  Branch (515:5): [True: 5.25M, False: 1.72M]
  ------------------
  516|  5.25M|        return (mv) { .x = 0, .y = 0 };
  517|  6.98M|    }
  518|  6.98M|}
refmvs.c:fix_int_mv_precision:
  462|  54.7k|static inline void fix_int_mv_precision(mv *const mv) {
  463|  54.7k|    mv->x = (mv->x - (mv->x >> 15) + 3) & ~7U;
  464|  54.7k|    mv->y = (mv->y - (mv->y >> 15) + 3) & ~7U;
  465|  54.7k|}
refmvs.c:fix_mv_precision:
  469|   814k|{
  470|   814k|    if (hdr->force_integer_mv) {
  ------------------
  |  Branch (470:9): [True: 4.19k, False: 810k]
  ------------------
  471|  4.19k|        fix_int_mv_precision(mv);
  472|   810k|    } else if (!hdr->hp) {
  ------------------
  |  Branch (472:16): [True: 61.9k, False: 748k]
  ------------------
  473|  61.9k|        mv->x = (mv->x - (mv->x >> 15)) & ~1U;
  474|  61.9k|        mv->y = (mv->y - (mv->y >> 15)) & ~1U;
  475|  61.9k|    }
  476|   814k|}
refmvs.c:get_poc_diff:
  239|  3.36M|{
  240|  3.36M|    if (!order_hint_n_bits) return 0;
  ------------------
  |  Branch (240:9): [True: 1.42M, False: 1.94M]
  ------------------
  241|  1.94M|    const int mask = 1 << (order_hint_n_bits - 1);
  242|  1.94M|    const int diff = poc0 - poc1;
  243|  1.94M|    return (diff & (mask - 1)) - (diff & mask);
  244|  3.36M|}
decode.c:get_partition_ctx:
   87|  13.2M|{
   88|  13.2M|    return ((a->partition[xb8] >> (4 - bl)) & 1) +
   89|  13.2M|          (((l->partition[yb8] >> (4 - bl)) & 1) << 1);
   90|  13.2M|}
decode.c:get_cur_frame_segid:
  445|  4.82M|{
  446|  4.82M|    cur_seg_map += bx + by * stride;
  447|  4.82M|    if (have_left && have_top) {
  ------------------
  |  Branch (447:9): [True: 1.36M, False: 3.46M]
  |  Branch (447:22): [True: 1.15M, False: 207k]
  ------------------
  448|  1.15M|        const int l = cur_seg_map[-1];
  449|  1.15M|        const int a = cur_seg_map[-stride];
  450|  1.15M|        const int al = cur_seg_map[-(stride + 1)];
  451|       |
  452|  1.15M|        if (l == a && al == l) *seg_ctx = 2;
  ------------------
  |  Branch (452:13): [True: 769k, False: 386k]
  |  Branch (452:23): [True: 744k, False: 25.2k]
  ------------------
  453|   411k|        else if (l == a || al == l || a == al) *seg_ctx = 1;
  ------------------
  |  Branch (453:18): [True: 17.6k, False: 394k]
  |  Branch (453:28): [True: 168k, False: 225k]
  |  Branch (453:39): [True: 139k, False: 86.0k]
  ------------------
  454|  76.1k|        else *seg_ctx = 0;
  455|  1.15M|        return a == al ? a : l;
  ------------------
  |  Branch (455:16): [True: 881k, False: 274k]
  ------------------
  456|  3.66M|    } else {
  457|  3.66M|        *seg_ctx = 0;
  458|  3.66M|        return have_left ? cur_seg_map[-1] : have_top ? cur_seg_map[-stride] : 0;
  ------------------
  |  Branch (458:16): [True: 218k, False: 3.45M]
  |  Branch (458:46): [True: 3.44M, False: 7.06k]
  ------------------
  459|  3.66M|    }
  460|  4.82M|}
decode.c:get_intra_ctx:
   63|  2.26M|{
   64|  2.26M|    if (have_left) {
  ------------------
  |  Branch (64:9): [True: 2.18M, False: 85.9k]
  ------------------
   65|  2.18M|        if (have_top) {
  ------------------
  |  Branch (65:13): [True: 1.97M, False: 208k]
  ------------------
   66|  1.97M|            const int ctx = l->intra[yb4] + a->intra[xb4];
   67|  1.97M|            return ctx + (ctx == 2);
   68|  1.97M|        } else
   69|   208k|            return l->intra[yb4] * 2;
   70|  2.18M|    } else {
   71|  85.9k|        return have_top ? a->intra[xb4] * 2 : 0;
  ------------------
  |  Branch (71:16): [True: 73.3k, False: 12.6k]
  ------------------
   72|  85.9k|    }
   73|  2.26M|}
decode.c:get_tx_ctx:
   79|   772k|{
   80|   772k|    return (l->tx_intra[yb4] >= max_tx->lh) + (a->tx_intra[xb4] >= max_tx->lw);
   81|   772k|}
decode.c:get_comp_ctx:
  160|   778k|{
  161|   778k|    if (have_top) {
  ------------------
  |  Branch (161:9): [True: 671k, False: 107k]
  ------------------
  162|   671k|        if (have_left) {
  ------------------
  |  Branch (162:13): [True: 643k, False: 27.9k]
  ------------------
  163|   643k|            if (a->comp_type[xb4]) {
  ------------------
  |  Branch (163:17): [True: 214k, False: 428k]
  ------------------
  164|   214k|                if (l->comp_type[yb4]) {
  ------------------
  |  Branch (164:21): [True: 143k, False: 70.9k]
  ------------------
  165|   143k|                    return 4;
  166|   143k|                } else {
  167|       |                    // 4U means intra (-1) or bwd (>= 4)
  168|  70.9k|                    return 2 + ((unsigned)l->ref[0][yb4] >= 4U);
  169|  70.9k|                }
  170|   428k|            } else if (l->comp_type[yb4]) {
  ------------------
  |  Branch (170:24): [True: 69.7k, False: 358k]
  ------------------
  171|       |                // 4U means intra (-1) or bwd (>= 4)
  172|  69.7k|                return 2 + ((unsigned)a->ref[0][xb4] >= 4U);
  173|   358k|            } else {
  174|   358k|                return (l->ref[0][yb4] >= 4) ^ (a->ref[0][xb4] >= 4);
  175|   358k|            }
  176|   643k|        } else {
  177|  27.9k|            return a->comp_type[xb4] ? 3 : a->ref[0][xb4] >= 4;
  ------------------
  |  Branch (177:20): [True: 9.70k, False: 18.2k]
  ------------------
  178|  27.9k|        }
  179|   671k|    } else if (have_left) {
  ------------------
  |  Branch (179:16): [True: 107k, False: 18.4E]
  ------------------
  180|   107k|        return l->comp_type[yb4] ? 3 : l->ref[0][yb4] >= 4;
  ------------------
  |  Branch (180:16): [True: 61.3k, False: 45.9k]
  ------------------
  181|  18.4E|    } else {
  182|  18.4E|        return 1;
  183|  18.4E|    }
  184|   778k|}
decode.c:fix_mv_precision:
  469|  1.48M|{
  470|  1.48M|    if (hdr->force_integer_mv) {
  ------------------
  |  Branch (470:9): [True: 25.3k, False: 1.46M]
  ------------------
  471|  25.3k|        fix_int_mv_precision(mv);
  472|  1.46M|    } else if (!hdr->hp) {
  ------------------
  |  Branch (472:16): [True: 653k, False: 808k]
  ------------------
  473|   653k|        mv->x = (mv->x - (mv->x >> 15)) & ~1U;
  474|   653k|        mv->y = (mv->y - (mv->y >> 15)) & ~1U;
  475|   653k|    }
  476|  1.48M|}
decode.c:fix_int_mv_precision:
  462|  71.1k|static inline void fix_int_mv_precision(mv *const mv) {
  463|  71.1k|    mv->x = (mv->x - (mv->x >> 15) + 3) & ~7U;
  464|  71.1k|    mv->y = (mv->y - (mv->y >> 15) + 3) & ~7U;
  465|  71.1k|}
decode.c:get_comp_dir_ctx:
  190|   313k|{
  191|   313k|#define has_uni_comp(edge, off) \
  192|   313k|    ((edge->ref[0][off] < 4) == (edge->ref[1][off] < 4))
  193|       |
  194|   313k|    if (have_top && have_left) {
  ------------------
  |  Branch (194:9): [True: 249k, False: 63.9k]
  |  Branch (194:21): [True: 239k, False: 9.88k]
  ------------------
  195|   239k|        const int a_intra = a->intra[xb4], l_intra = l->intra[yb4];
  196|       |
  197|   239k|        if (a_intra && l_intra) return 2;
  ------------------
  |  Branch (197:13): [True: 7.56k, False: 231k]
  |  Branch (197:24): [True: 1.78k, False: 5.77k]
  ------------------
  198|   237k|        if (a_intra || l_intra) {
  ------------------
  |  Branch (198:13): [True: 5.68k, False: 231k]
  |  Branch (198:24): [True: 7.97k, False: 223k]
  ------------------
  199|  13.9k|            const BlockContext *const edge = a_intra ? l : a;
  ------------------
  |  Branch (199:46): [True: 5.77k, False: 8.13k]
  ------------------
  200|  13.9k|            const int off = a_intra ? yb4 : xb4;
  ------------------
  |  Branch (200:29): [True: 5.77k, False: 8.13k]
  ------------------
  201|       |
  202|  13.9k|            if (edge->comp_type[off] == COMP_INTER_NONE) return 2;
  ------------------
  |  Branch (202:17): [True: 4.00k, False: 9.90k]
  ------------------
  203|  9.90k|            return 1 + 2 * has_uni_comp(edge, off);
  ------------------
  |  |  192|  9.90k|    ((edge->ref[0][off] < 4) == (edge->ref[1][off] < 4))
  ------------------
  204|  13.9k|        }
  205|       |
  206|   223k|        const int a_comp = a->comp_type[xb4] != COMP_INTER_NONE;
  207|   223k|        const int l_comp = l->comp_type[yb4] != COMP_INTER_NONE;
  208|   223k|        const int a_ref0 = a->ref[0][xb4], l_ref0 = l->ref[0][yb4];
  209|       |
  210|   223k|        if (!a_comp && !l_comp) {
  ------------------
  |  Branch (210:13): [True: 61.0k, False: 162k]
  |  Branch (210:24): [True: 23.7k, False: 37.3k]
  ------------------
  211|  23.7k|            return 1 + 2 * ((a_ref0 >= 4) == (l_ref0 >= 4));
  212|   199k|        } else if (!a_comp || !l_comp) {
  ------------------
  |  Branch (212:20): [True: 36.0k, False: 163k]
  |  Branch (212:31): [True: 38.6k, False: 125k]
  ------------------
  213|  76.5k|            const BlockContext *const edge = a_comp ? a : l;
  ------------------
  |  Branch (213:46): [True: 39.3k, False: 37.1k]
  ------------------
  214|  76.5k|            const int off = a_comp ? xb4 : yb4;
  ------------------
  |  Branch (214:29): [True: 39.3k, False: 37.1k]
  ------------------
  215|       |
  216|  76.5k|            if (!has_uni_comp(edge, off)) return 1;
  ------------------
  |  |  192|  76.5k|    ((edge->ref[0][off] < 4) == (edge->ref[1][off] < 4))
  ------------------
  |  Branch (216:17): [True: 57.5k, False: 19.0k]
  ------------------
  217|  19.0k|            return 3 + ((a_ref0 >= 4) == (l_ref0 >= 4));
  218|   123k|        } else {
  219|   123k|            const int a_uni = has_uni_comp(a, xb4), l_uni = has_uni_comp(l, yb4);
  ------------------
  |  |  192|   123k|    ((edge->ref[0][off] < 4) == (edge->ref[1][off] < 4))
  ------------------
                          const int a_uni = has_uni_comp(a, xb4), l_uni = has_uni_comp(l, yb4);
  ------------------
  |  |  192|   123k|    ((edge->ref[0][off] < 4) == (edge->ref[1][off] < 4))
  ------------------
  220|       |
  221|   123k|            if (!a_uni && !l_uni) return 0;
  ------------------
  |  Branch (221:17): [True: 87.2k, False: 36.0k]
  |  Branch (221:27): [True: 76.9k, False: 10.2k]
  ------------------
  222|  46.2k|            if (!a_uni || !l_uni) return 2;
  ------------------
  |  Branch (222:17): [True: 7.99k, False: 38.2k]
  |  Branch (222:27): [True: 17.7k, False: 20.5k]
  ------------------
  223|  18.1k|            return 3 + ((a_ref0 == 4) == (l_ref0 == 4));
  224|  46.2k|        }
  225|   223k|    } else if (have_top || have_left) {
  ------------------
  |  Branch (225:16): [True: 7.57k, False: 66.2k]
  |  Branch (225:28): [True: 64.6k, False: 1.54k]
  ------------------
  226|  74.6k|        const BlockContext *const edge = have_left ? l : a;
  ------------------
  |  Branch (226:42): [True: 64.6k, False: 9.96k]
  ------------------
  227|  74.6k|        const int off = have_left ? yb4 : xb4;
  ------------------
  |  Branch (227:25): [True: 64.6k, False: 9.95k]
  ------------------
  228|       |
  229|  74.6k|        if (edge->intra[off]) return 2;
  ------------------
  |  Branch (229:13): [True: 1.74k, False: 72.9k]
  ------------------
  230|  72.9k|        if (edge->comp_type[off] == COMP_INTER_NONE) return 2;
  ------------------
  |  Branch (230:13): [True: 12.8k, False: 60.0k]
  ------------------
  231|  60.0k|        return 4 * has_uni_comp(edge, off);
  ------------------
  |  |  192|  60.0k|    ((edge->ref[0][off] < 4) == (edge->ref[1][off] < 4))
  ------------------
  232|  18.4E|    } else {
  233|  18.4E|        return 2;
  234|  18.4E|    }
  235|   313k|}
decode.c:av1_get_fwd_ref_ctx:
  307|  1.39M|{
  308|  1.39M|    int cnt[4] = { 0 };
  309|       |
  310|  1.39M|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (310:9): [True: 1.29M, False: 99.5k]
  |  Branch (310:21): [True: 1.21M, False: 72.3k]
  ------------------
  311|  1.21M|        if (a->ref[0][xb4] < 4) cnt[a->ref[0][xb4]]++;
  ------------------
  |  Branch (311:13): [True: 1.15M, False: 66.3k]
  ------------------
  312|  1.21M|        if (a->comp_type[xb4] && a->ref[1][xb4] < 4) cnt[a->ref[1][xb4]]++;
  ------------------
  |  Branch (312:13): [True: 186k, False: 1.03M]
  |  Branch (312:34): [True: 37.6k, False: 148k]
  ------------------
  313|  1.21M|    }
  314|       |
  315|  1.39M|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (315:9): [True: 1.35M, False: 35.8k]
  |  Branch (315:22): [True: 1.28M, False: 75.6k]
  ------------------
  316|  1.28M|        if (l->ref[0][yb4] < 4) cnt[l->ref[0][yb4]]++;
  ------------------
  |  Branch (316:13): [True: 1.20M, False: 71.8k]
  ------------------
  317|  1.28M|        if (l->comp_type[yb4] && l->ref[1][yb4] < 4) cnt[l->ref[1][yb4]]++;
  ------------------
  |  Branch (317:13): [True: 219k, False: 1.06M]
  |  Branch (317:34): [True: 40.4k, False: 179k]
  ------------------
  318|  1.28M|    }
  319|       |
  320|  1.39M|    cnt[0] += cnt[1];
  321|  1.39M|    cnt[2] += cnt[3];
  322|       |
  323|  1.39M|    return cnt[0] == cnt[2] ? 1 : cnt[0] < cnt[2] ? 0 : 2;
  ------------------
  |  Branch (323:12): [True: 143k, False: 1.24M]
  |  Branch (323:35): [True: 117k, False: 1.13M]
  ------------------
  324|  1.39M|}
decode.c:av1_get_fwd_ref_2_ctx:
  350|   212k|{
  351|   212k|    int cnt[2] = { 0 };
  352|       |
  353|   212k|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (353:9): [True: 170k, False: 41.8k]
  |  Branch (353:21): [True: 157k, False: 12.7k]
  ------------------
  354|   157k|        if ((a->ref[0][xb4] ^ 2U) < 2) cnt[a->ref[0][xb4] - 2]++;
  ------------------
  |  Branch (354:13): [True: 81.2k, False: 76.5k]
  ------------------
  355|   157k|        if (a->comp_type[xb4] && (a->ref[1][xb4] ^ 2U) < 2) cnt[a->ref[1][xb4] - 2]++;
  ------------------
  |  Branch (355:13): [True: 65.6k, False: 92.0k]
  |  Branch (355:34): [True: 17.0k, False: 48.6k]
  ------------------
  356|   157k|    }
  357|       |
  358|   212k|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (358:9): [True: 204k, False: 8.23k]
  |  Branch (358:22): [True: 190k, False: 13.7k]
  ------------------
  359|   190k|        if ((l->ref[0][yb4] ^ 2U) < 2) cnt[l->ref[0][yb4] - 2]++;
  ------------------
  |  Branch (359:13): [True: 100k, False: 89.7k]
  ------------------
  360|   190k|        if (l->comp_type[yb4] && (l->ref[1][yb4] ^ 2U) < 2) cnt[l->ref[1][yb4] - 2]++;
  ------------------
  |  Branch (360:13): [True: 94.2k, False: 96.1k]
  |  Branch (360:34): [True: 22.2k, False: 71.9k]
  ------------------
  361|   190k|    }
  362|       |
  363|   212k|    return cnt[0] == cnt[1] ? 1 : cnt[0] < cnt[1] ? 0 : 2;
  ------------------
  |  Branch (363:12): [True: 60.6k, False: 151k]
  |  Branch (363:35): [True: 111k, False: 40.0k]
  ------------------
  364|   212k|}
decode.c:av1_get_fwd_ref_1_ctx:
  330|  1.22M|{
  331|  1.22M|    int cnt[2] = { 0 };
  332|       |
  333|  1.22M|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (333:9): [True: 1.15M, False: 70.7k]
  |  Branch (333:21): [True: 1.09M, False: 60.4k]
  ------------------
  334|  1.09M|        if (a->ref[0][xb4] < 2) cnt[a->ref[0][xb4]]++;
  ------------------
  |  Branch (334:13): [True: 1.00M, False: 84.5k]
  ------------------
  335|  1.09M|        if (a->comp_type[xb4] && a->ref[1][xb4] < 2) cnt[a->ref[1][xb4]]++;
  ------------------
  |  Branch (335:13): [True: 140k, False: 953k]
  |  Branch (335:34): [True: 18.1k, False: 122k]
  ------------------
  336|  1.09M|    }
  337|       |
  338|  1.22M|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (338:9): [True: 1.19M, False: 28.6k]
  |  Branch (338:22): [True: 1.13M, False: 63.5k]
  ------------------
  339|  1.13M|        if (l->ref[0][yb4] < 2) cnt[l->ref[0][yb4]]++;
  ------------------
  |  Branch (339:13): [True: 1.04M, False: 89.4k]
  ------------------
  340|  1.13M|        if (l->comp_type[yb4] && l->ref[1][yb4] < 2) cnt[l->ref[1][yb4]]++;
  ------------------
  |  Branch (340:13): [True: 157k, False: 975k]
  |  Branch (340:34): [True: 17.4k, False: 140k]
  ------------------
  341|  1.13M|    }
  342|       |
  343|  1.22M|    return cnt[0] == cnt[1] ? 1 : cnt[0] < cnt[1] ? 0 : 2;
  ------------------
  |  Branch (343:12): [True: 120k, False: 1.10M]
  |  Branch (343:35): [True: 36.2k, False: 1.06M]
  ------------------
  344|  1.22M|}
decode.c:av1_get_bwd_ref_ctx:
  370|   679k|{
  371|   679k|    int cnt[3] = { 0 };
  372|       |
  373|   679k|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (373:9): [True: 558k, False: 120k]
  |  Branch (373:21): [True: 525k, False: 33.1k]
  ------------------
  374|   525k|        if (a->ref[0][xb4] >= 4) cnt[a->ref[0][xb4] - 4]++;
  ------------------
  |  Branch (374:13): [True: 299k, False: 226k]
  ------------------
  375|   525k|        if (a->comp_type[xb4] && a->ref[1][xb4] >= 4) cnt[a->ref[1][xb4] - 4]++;
  ------------------
  |  Branch (375:13): [True: 161k, False: 363k]
  |  Branch (375:34): [True: 144k, False: 17.2k]
  ------------------
  376|   525k|    }
  377|       |
  378|   679k|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (378:9): [True: 641k, False: 38.0k]
  |  Branch (378:22): [True: 602k, False: 39.3k]
  ------------------
  379|   602k|        if (l->ref[0][yb4] >= 4) cnt[l->ref[0][yb4] - 4]++;
  ------------------
  |  Branch (379:13): [True: 340k, False: 261k]
  ------------------
  380|   602k|        if (l->comp_type[yb4] && l->ref[1][yb4] >= 4) cnt[l->ref[1][yb4] - 4]++;
  ------------------
  |  Branch (380:13): [True: 198k, False: 403k]
  |  Branch (380:34): [True: 180k, False: 18.0k]
  ------------------
  381|   602k|    }
  382|       |
  383|   679k|    cnt[1] += cnt[0];
  384|       |
  385|   679k|    return cnt[2] == cnt[1] ? 1 : cnt[1] < cnt[2] ? 0 : 2;
  ------------------
  |  Branch (385:12): [True: 123k, False: 556k]
  |  Branch (385:35): [True: 407k, False: 149k]
  ------------------
  386|   679k|}
decode.c:av1_get_bwd_ref_1_ctx:
  392|   201k|{
  393|   201k|    int cnt[3] = { 0 };
  394|       |
  395|   201k|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (395:9): [True: 175k, False: 26.2k]
  |  Branch (395:21): [True: 160k, False: 14.1k]
  ------------------
  396|   160k|        if (a->ref[0][xb4] >= 4) cnt[a->ref[0][xb4] - 4]++;
  ------------------
  |  Branch (396:13): [True: 70.9k, False: 90.0k]
  ------------------
  397|   160k|        if (a->comp_type[xb4] && a->ref[1][xb4] >= 4) cnt[a->ref[1][xb4] - 4]++;
  ------------------
  |  Branch (397:13): [True: 69.3k, False: 91.6k]
  |  Branch (397:34): [True: 59.2k, False: 10.0k]
  ------------------
  398|   160k|    }
  399|       |
  400|   201k|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (400:9): [True: 193k, False: 7.76k]
  |  Branch (400:22): [True: 177k, False: 16.2k]
  ------------------
  401|   177k|        if (l->ref[0][yb4] >= 4) cnt[l->ref[0][yb4] - 4]++;
  ------------------
  |  Branch (401:13): [True: 80.3k, False: 96.8k]
  ------------------
  402|   177k|        if (l->comp_type[yb4] && l->ref[1][yb4] >= 4) cnt[l->ref[1][yb4] - 4]++;
  ------------------
  |  Branch (402:13): [True: 78.4k, False: 98.8k]
  |  Branch (402:34): [True: 67.6k, False: 10.8k]
  ------------------
  403|   177k|    }
  404|       |
  405|   201k|    return cnt[0] == cnt[1] ? 1 : cnt[0] < cnt[1] ? 0 : 2;
  ------------------
  |  Branch (405:12): [True: 48.1k, False: 153k]
  |  Branch (405:35): [True: 67.0k, False: 86.2k]
  ------------------
  406|   201k|}
decode.c:av1_get_ref_ctx:
  287|  1.69M|{
  288|  1.69M|    int cnt[2] = { 0 };
  289|       |
  290|  1.69M|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (290:9): [True: 1.53M, False: 153k]
  |  Branch (290:21): [True: 1.44M, False: 95.5k]
  ------------------
  291|  1.44M|        cnt[a->ref[0][xb4] >= 4]++;
  292|  1.44M|        if (a->comp_type[xb4]) cnt[a->ref[1][xb4] >= 4]++;
  ------------------
  |  Branch (292:13): [True: 127k, False: 1.31M]
  ------------------
  293|  1.44M|    }
  294|       |
  295|  1.69M|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (295:9): [True: 1.63M, False: 57.2k]
  |  Branch (295:22): [True: 1.53M, False: 102k]
  ------------------
  296|  1.53M|        cnt[l->ref[0][yb4] >= 4]++;
  297|  1.53M|        if (l->comp_type[yb4]) cnt[l->ref[1][yb4] >= 4]++;
  ------------------
  |  Branch (297:13): [True: 162k, False: 1.37M]
  ------------------
  298|  1.53M|    }
  299|       |
  300|  1.69M|    return cnt[0] == cnt[1] ? 1 : cnt[0] < cnt[1] ? 0 : 2;
  ------------------
  |  Branch (300:12): [True: 184k, False: 1.50M]
  |  Branch (300:35): [True: 377k, False: 1.13M]
  ------------------
  301|  1.69M|}
decode.c:av1_get_uni_p1_ctx:
  412|  64.0k|{
  413|  64.0k|    int cnt[3] = { 0 };
  414|       |
  415|  64.0k|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (415:9): [True: 49.8k, False: 14.1k]
  |  Branch (415:21): [True: 48.3k, False: 1.48k]
  ------------------
  416|  48.3k|        if (a->ref[0][xb4] - 1U < 3) cnt[a->ref[0][xb4] - 1]++;
  ------------------
  |  Branch (416:13): [True: 4.48k, False: 43.8k]
  ------------------
  417|  48.3k|        if (a->comp_type[xb4] && a->ref[1][xb4] - 1U < 3) cnt[a->ref[1][xb4] - 1]++;
  ------------------
  |  Branch (417:13): [True: 35.4k, False: 12.9k]
  |  Branch (417:34): [True: 21.9k, False: 13.4k]
  ------------------
  418|  48.3k|    }
  419|       |
  420|  64.0k|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (420:9): [True: 62.4k, False: 1.58k]
  |  Branch (420:22): [True: 60.7k, False: 1.71k]
  ------------------
  421|  60.7k|        if (l->ref[0][yb4] - 1U < 3) cnt[l->ref[0][yb4] - 1]++;
  ------------------
  |  Branch (421:13): [True: 6.83k, False: 53.8k]
  ------------------
  422|  60.7k|        if (l->comp_type[yb4] && l->ref[1][yb4] - 1U < 3) cnt[l->ref[1][yb4] - 1]++;
  ------------------
  |  Branch (422:13): [True: 47.7k, False: 12.9k]
  |  Branch (422:34): [True: 29.6k, False: 18.1k]
  ------------------
  423|  60.7k|    }
  424|       |
  425|  64.0k|    cnt[1] += cnt[2];
  426|       |
  427|  64.0k|    return cnt[0] == cnt[1] ? 1 : cnt[0] < cnt[1] ? 0 : 2;
  ------------------
  |  Branch (427:12): [True: 19.0k, False: 44.9k]
  |  Branch (427:35): [True: 29.9k, False: 15.0k]
  ------------------
  428|  64.0k|}
decode.c:get_drl_context:
  432|   928k|{
  433|   928k|    if (ref_mv_stack[ref_idx].weight >= 640)
  ------------------
  |  Branch (433:9): [True: 784k, False: 143k]
  ------------------
  434|   784k|        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: 146k, False: 18.4E]
  ------------------
  437|   928k|}
decode.c:get_gmv_2d:
  482|  4.83M|{
  483|  4.83M|    switch (gmv->type) {
  484|   447k|    case DAV1D_WM_TYPE_ROT_ZOOM:
  ------------------
  |  Branch (484:5): [True: 447k, False: 4.38M]
  ------------------
  485|   447k|        assert(gmv->matrix[5] ==  gmv->matrix[2]);
  ------------------
  |  Branch (485:9): [True: 447k, False: 18.4E]
  ------------------
  486|   447k|        assert(gmv->matrix[4] == -gmv->matrix[3]);
  ------------------
  |  Branch (486:9): [True: 447k, False: 18.4E]
  ------------------
  487|       |        // fall-through
  488|   447k|    default:
  ------------------
  |  Branch (488:5): [True: 0, False: 4.83M]
  ------------------
  489|  1.25M|    case DAV1D_WM_TYPE_AFFINE: {
  ------------------
  |  Branch (489:5): [True: 803k, False: 4.03M]
  ------------------
  490|  1.25M|        const int x = bx4 * 4 + bw4 * 2 - 1;
  491|  1.25M|        const int y = by4 * 4 + bh4 * 2 - 1;
  492|  1.25M|        const int xc = (gmv->matrix[2] - (1 << 16)) * x +
  493|  1.25M|                       gmv->matrix[3] * y + gmv->matrix[0];
  494|  1.25M|        const int yc = (gmv->matrix[5] - (1 << 16)) * y +
  495|  1.25M|                       gmv->matrix[4] * x + gmv->matrix[1];
  496|  1.25M|        const int shift = 16 - (3 - !hdr->hp);
  497|  1.25M|        const int round = (1 << shift) >> 1;
  498|  1.25M|        mv res = (mv) {
  499|  1.25M|            .y = apply_sign(((abs(yc) + round) >> shift) << !hdr->hp, yc),
  500|  1.25M|            .x = apply_sign(((abs(xc) + round) >> shift) << !hdr->hp, xc),
  501|  1.25M|        };
  502|  1.25M|        if (hdr->force_integer_mv)
  ------------------
  |  Branch (502:13): [True: 45.3k, False: 1.20M]
  ------------------
  503|  45.3k|            fix_int_mv_precision(&res);
  504|  1.25M|        return res;
  505|   447k|    }
  506|  71.1k|    case DAV1D_WM_TYPE_TRANSLATION: {
  ------------------
  |  Branch (506:5): [True: 71.1k, False: 4.76M]
  ------------------
  507|  71.1k|        mv res = (mv) {
  508|  71.1k|            .y = gmv->matrix[0] >> 13,
  509|  71.1k|            .x = gmv->matrix[1] >> 13,
  510|  71.1k|        };
  511|  71.1k|        if (hdr->force_integer_mv)
  ------------------
  |  Branch (511:13): [True: 364, False: 70.8k]
  ------------------
  512|    364|            fix_int_mv_precision(&res);
  513|  71.1k|        return res;
  514|   447k|    }
  515|  3.52M|    case DAV1D_WM_TYPE_IDENTITY:
  ------------------
  |  Branch (515:5): [True: 3.52M, False: 1.31M]
  ------------------
  516|  3.52M|        return (mv) { .x = 0, .y = 0 };
  517|  4.83M|    }
  518|  4.83M|}
decode.c:get_mask_comp_ctx:
  266|   272k|{
  267|   272k|    const int a_ctx = a->comp_type[xb4] >= COMP_INTER_SEG ? 1 :
  ------------------
  |  Branch (267:23): [True: 26.1k, False: 246k]
  ------------------
  268|   272k|                      a->ref[0][xb4] == 6 ? 3 : 0;
  ------------------
  |  Branch (268:23): [True: 15.1k, False: 231k]
  ------------------
  269|   272k|    const int l_ctx = l->comp_type[yb4] >= COMP_INTER_SEG ? 1 :
  ------------------
  |  Branch (269:23): [True: 31.7k, False: 241k]
  ------------------
  270|   272k|                      l->ref[0][yb4] == 6 ? 3 : 0;
  ------------------
  |  Branch (270:23): [True: 17.8k, False: 223k]
  ------------------
  271|       |
  272|   272k|    return imin(a_ctx + l_ctx, 5);
  273|   272k|}
decode.c:get_jnt_comp_ctx:
  251|   229k|{
  252|   229k|    const int d0 = abs(get_poc_diff(order_hint_n_bits, ref0poc, poc));
  253|   229k|    const int d1 = abs(get_poc_diff(order_hint_n_bits, poc, ref1poc));
  254|   229k|    const int offset = d0 == d1;
  255|   229k|    const int a_ctx = a->comp_type[xb4] >= COMP_INTER_AVG ||
  ------------------
  |  Branch (255:23): [True: 102k, False: 127k]
  ------------------
  256|   127k|                      a->ref[0][xb4] == 6;
  ------------------
  |  Branch (256:23): [True: 11.2k, False: 116k]
  ------------------
  257|   229k|    const int l_ctx = l->comp_type[yb4] >= COMP_INTER_AVG ||
  ------------------
  |  Branch (257:23): [True: 120k, False: 109k]
  ------------------
  258|   109k|                      l->ref[0][yb4] == 6;
  ------------------
  |  Branch (258:23): [True: 13.0k, False: 96.5k]
  ------------------
  259|       |
  260|   229k|    return 3 * offset + a_ctx + l_ctx;
  261|   229k|}
decode.c:get_filter_ctx:
  139|  1.88M|{
  140|  1.88M|    const int a_filter = (a->ref[0][xb4] == ref || a->ref[1][xb4] == ref) ?
  ------------------
  |  Branch (140:27): [True: 1.37M, False: 505k]
  |  Branch (140:52): [True: 19.8k, False: 486k]
  ------------------
  141|  1.40M|                         a->filter[dir][xb4] : DAV1D_N_SWITCHABLE_FILTERS;
  142|  1.88M|    const int l_filter = (l->ref[0][yb4] == ref || l->ref[1][yb4] == ref) ?
  ------------------
  |  Branch (142:27): [True: 1.43M, False: 442k]
  |  Branch (142:52): [True: 22.6k, False: 419k]
  ------------------
  143|  1.47M|                         l->filter[dir][yb4] : DAV1D_N_SWITCHABLE_FILTERS;
  144|       |
  145|  1.88M|    if (a_filter == l_filter) {
  ------------------
  |  Branch (145:9): [True: 1.27M, False: 602k]
  ------------------
  146|  1.27M|        return comp * 4 + a_filter;
  147|  1.27M|    } else if (a_filter == DAV1D_N_SWITCHABLE_FILTERS) {
  ------------------
  |  Branch (147:16): [True: 292k, False: 310k]
  ------------------
  148|   292k|        return comp * 4 + l_filter;
  149|   310k|    } else if (l_filter == DAV1D_N_SWITCHABLE_FILTERS) {
  ------------------
  |  Branch (149:16): [True: 225k, False: 85.2k]
  ------------------
  150|   225k|        return comp * 4 + a_filter;
  151|   225k|    } else {
  152|  85.2k|        return comp * 4 + DAV1D_N_SWITCHABLE_FILTERS;
  153|  85.2k|    }
  154|  1.88M|}
decode.c:gather_top_partition_prob:
  106|  1.04M|{
  107|       |    // Exploit the fact that cdfs for PARTITION_V, PARTITION_SPLIT and
  108|       |    // PARTITION_T_TOP_SPLIT are neighbors.
  109|  1.04M|    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|  1.04M|    out += in[PARTITION_T_LEFT_SPLIT - 1];
  115|  1.04M|    if (bl != BL_128X128)
  ------------------
  |  Branch (115:9): [True: 999k, False: 41.8k]
  ------------------
  116|   999k|        out += in[PARTITION_V4 - 1] - in[PARTITION_T_RIGHT_SPLIT];
  117|  1.04M|    return out;
  118|  1.04M|}
decode.c:gather_left_partition_prob:
   94|   268k|{
   95|   268k|    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|   268k|    out += in[PARTITION_SPLIT - 1] - in[PARTITION_T_LEFT_SPLIT];
   99|   268k|    if (bl != BL_128X128)
  ------------------
  |  Branch (99:9): [True: 221k, False: 47.6k]
  ------------------
  100|   221k|        out += in[PARTITION_H4 - 1] - in[PARTITION_H4];
  101|   268k|    return out;
  102|   268k|}
decode.c:get_poc_diff:
  239|  2.11M|{
  240|  2.11M|    if (!order_hint_n_bits) return 0;
  ------------------
  |  Branch (240:9): [True: 63.8k, False: 2.05M]
  ------------------
  241|  2.05M|    const int mask = 1 << (order_hint_n_bits - 1);
  242|  2.05M|    const int diff = poc0 - poc1;
  243|  2.05M|    return (diff & (mask - 1)) - (diff & mask);
  244|  2.11M|}
recon_tmpl.c:get_uv_inter_txtp:
  122|   841k|{
  123|   841k|    if (uvt_dim->max == TX_32X32)
  ------------------
  |  Branch (123:9): [True: 224k, False: 617k]
  ------------------
  124|   224k|        return ytxtp == IDTX ? IDTX : DCT_DCT;
  ------------------
  |  Branch (124:16): [True: 4.20k, False: 220k]
  ------------------
  125|   617k|    if (uvt_dim->min == TX_16X16 &&
  ------------------
  |  Branch (125:9): [True: 55.0k, False: 562k]
  ------------------
  126|  55.0k|        ((1 << ytxtp) & ((1 << H_FLIPADST) | (1 << V_FLIPADST) |
  ------------------
  |  Branch (126:9): [True: 623, False: 54.4k]
  ------------------
  127|  55.0k|                         (1 << H_ADST) | (1 << V_ADST))))
  128|    623|    {
  129|    623|        return DCT_DCT;
  130|    623|    }
  131|       |
  132|   616k|    return ytxtp;
  133|   617k|}

dav1d_prep_grain_8bpc:
  105|  1.72k|{
  106|  1.72k|    const Dav1dFilmGrainData *const data = &out->frame_hdr->film_grain.data;
  107|       |#if BITDEPTH != 8
  108|       |    const int bitdepth_max = (1 << out->p.bpc) - 1;
  109|       |#endif
  110|       |
  111|       |    // Generate grain LUTs as needed
  112|  1.72k|    dsp->generate_grain_y(grain_lut[0], data HIGHBD_TAIL_SUFFIX); // always needed
  113|  1.72k|    if (data->num_uv_points[0] || data->chroma_scaling_from_luma)
  ------------------
  |  Branch (113:9): [True: 309, False: 1.41k]
  |  Branch (113:35): [True: 833, False: 578]
  ------------------
  114|  1.14k|        dsp->generate_grain_uv[in->p.layout - 1](grain_lut[1], grain_lut[0],
  115|  1.14k|                                                 data, 0 HIGHBD_TAIL_SUFFIX);
  116|  1.72k|    if (data->num_uv_points[1] || data->chroma_scaling_from_luma)
  ------------------
  |  Branch (116:9): [True: 311, False: 1.40k]
  |  Branch (116:35): [True: 833, False: 576]
  ------------------
  117|  1.14k|        dsp->generate_grain_uv[in->p.layout - 1](grain_lut[2], grain_lut[0],
  118|  1.14k|                                                 data, 1 HIGHBD_TAIL_SUFFIX);
  119|       |
  120|       |    // Generate scaling LUTs as needed
  121|  1.72k|    if (data->num_y_points || data->chroma_scaling_from_luma)
  ------------------
  |  Branch (121:9): [True: 734, False: 986]
  |  Branch (121:31): [True: 813, False: 173]
  ------------------
  122|  1.54k|        generate_scaling(in->p.bpc, data->y_points, data->num_y_points, scaling[0]);
  123|  1.72k|    if (data->num_uv_points[0])
  ------------------
  |  Branch (123:9): [True: 309, False: 1.41k]
  ------------------
  124|    309|        generate_scaling(in->p.bpc, data->uv_points[0], data->num_uv_points[0], scaling[1]);
  125|  1.72k|    if (data->num_uv_points[1])
  ------------------
  |  Branch (125:9): [True: 311, False: 1.40k]
  ------------------
  126|    311|        generate_scaling(in->p.bpc, data->uv_points[1], data->num_uv_points[1], scaling[2]);
  127|       |
  128|       |    // Copy over the non-modified planes
  129|  1.72k|    assert(out->stride[0] == in->stride[0]);
  ------------------
  |  Branch (129:5): [True: 1.72k, False: 0]
  ------------------
  130|  1.72k|    if (!data->num_y_points) {
  ------------------
  |  Branch (130:9): [True: 986, False: 734]
  ------------------
  131|    986|        const ptrdiff_t stride = out->stride[0];
  132|    986|        const ptrdiff_t sz = out->p.h * stride;
  133|    986|        if (sz < 0)
  ------------------
  |  Branch (133:13): [True: 0, False: 986]
  ------------------
  134|      0|            memcpy((uint8_t*) out->data[0] + sz - stride,
  135|      0|                   (uint8_t*) in->data[0] + sz - stride, -sz);
  136|    986|        else
  137|    986|            memcpy(out->data[0], in->data[0], sz);
  138|    986|    }
  139|       |
  140|  1.72k|    if (in->p.layout != DAV1D_PIXEL_LAYOUT_I400 && !data->chroma_scaling_from_luma) {
  ------------------
  |  Branch (140:9): [True: 1.40k, False: 311]
  |  Branch (140:52): [True: 576, False: 833]
  ------------------
  141|    576|        assert(out->stride[1] == in->stride[1]);
  ------------------
  |  Branch (141:9): [True: 576, False: 0]
  ------------------
  142|    576|        const int ss_ver = in->p.layout == DAV1D_PIXEL_LAYOUT_I420;
  143|    576|        const ptrdiff_t stride = out->stride[1];
  144|    576|        const ptrdiff_t sz = ((out->p.h + ss_ver) >> ss_ver) * stride;
  145|    576|        if (sz < 0) {
  ------------------
  |  Branch (145:13): [True: 0, False: 576]
  ------------------
  146|      0|            if (!data->num_uv_points[0])
  ------------------
  |  Branch (146:17): [True: 0, False: 0]
  ------------------
  147|      0|                memcpy((uint8_t*) out->data[1] + sz - stride,
  148|      0|                       (uint8_t*) in->data[1] + sz - stride, -sz);
  149|      0|            if (!data->num_uv_points[1])
  ------------------
  |  Branch (149:17): [True: 0, False: 0]
  ------------------
  150|      0|                memcpy((uint8_t*) out->data[2] + sz - stride,
  151|      0|                       (uint8_t*) in->data[2] + sz - stride, -sz);
  152|    576|        } else {
  153|    576|            if (!data->num_uv_points[0])
  ------------------
  |  Branch (153:17): [True: 267, False: 309]
  ------------------
  154|    267|                memcpy(out->data[1], in->data[1], sz);
  155|    576|            if (!data->num_uv_points[1])
  ------------------
  |  Branch (155:17): [True: 265, False: 311]
  ------------------
  156|    265|                memcpy(out->data[2], in->data[2], sz);
  157|    576|        }
  158|    576|    }
  159|  1.72k|}
dav1d_apply_grain_row_8bpc:
  167|  13.4k|{
  168|       |    // Synthesize grain for the affected planes
  169|  13.4k|    const Dav1dFilmGrainData *const data = &out->frame_hdr->film_grain.data;
  170|  13.4k|    const int ss_y = in->p.layout == DAV1D_PIXEL_LAYOUT_I420;
  171|  13.4k|    const int ss_x = in->p.layout != DAV1D_PIXEL_LAYOUT_I444;
  172|  13.4k|    const int cpw = (out->p.w + ss_x) >> ss_x;
  173|  13.4k|    const int is_id = out->seq_hdr->mtrx == DAV1D_MC_IDENTITY;
  174|  13.4k|    pixel *const luma_src =
  175|  13.4k|        ((pixel *) in->data[0]) + row * FG_BLOCK_SIZE * PXSTRIDE(in->stride[0]);
  ------------------
  |  |   37|  13.4k|#define FG_BLOCK_SIZE 32
  ------------------
                      ((pixel *) in->data[0]) + row * FG_BLOCK_SIZE * PXSTRIDE(in->stride[0]);
  ------------------
  |  |   53|  13.4k|#define PXSTRIDE(x) (x)
  ------------------
  176|       |#if BITDEPTH != 8
  177|       |    const int bitdepth_max = (1 << out->p.bpc) - 1;
  178|       |#endif
  179|       |
  180|  13.4k|    if (data->num_y_points) {
  ------------------
  |  Branch (180:9): [True: 4.99k, False: 8.41k]
  ------------------
  181|  4.99k|        const int bh = imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE);
  ------------------
  |  |   37|  4.99k|#define FG_BLOCK_SIZE 32
  ------------------
                      const int bh = imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE);
  ------------------
  |  |   37|  4.99k|#define FG_BLOCK_SIZE 32
  ------------------
  182|  4.99k|        dsp->fgy_32x32xn(((pixel *) out->data[0]) + row * FG_BLOCK_SIZE * PXSTRIDE(out->stride[0]),
  ------------------
  |  |   37|  4.99k|#define FG_BLOCK_SIZE 32
  ------------------
                      dsp->fgy_32x32xn(((pixel *) out->data[0]) + row * FG_BLOCK_SIZE * PXSTRIDE(out->stride[0]),
  ------------------
  |  |   53|  4.99k|#define PXSTRIDE(x) (x)
  ------------------
  183|  4.99k|                         luma_src, out->stride[0], data,
  184|  4.99k|                         out->p.w, scaling[0], grain_lut[0], bh, row HIGHBD_TAIL_SUFFIX);
  185|  4.99k|    }
  186|       |
  187|  13.4k|    if (!data->num_uv_points[0] && !data->num_uv_points[1] &&
  ------------------
  |  Branch (187:9): [True: 11.1k, False: 2.24k]
  |  Branch (187:36): [True: 5.92k, False: 5.23k]
  ------------------
  188|  5.92k|        !data->chroma_scaling_from_luma)
  ------------------
  |  Branch (188:9): [True: 1.47k, False: 4.45k]
  ------------------
  189|  1.47k|    {
  190|  1.47k|        return;
  191|  1.47k|    }
  192|       |
  193|  11.9k|    const int bh = (imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE) + ss_y) >> ss_y;
  ------------------
  |  |   37|  11.9k|#define FG_BLOCK_SIZE 32
  ------------------
                  const int bh = (imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE) + ss_y) >> ss_y;
  ------------------
  |  |   37|  11.9k|#define FG_BLOCK_SIZE 32
  ------------------
  194|       |
  195|       |    // extend padding pixels
  196|  11.9k|    if (out->p.w & ss_x) {
  ------------------
  |  Branch (196:9): [True: 7.86k, False: 4.06k]
  ------------------
  197|  7.86k|        pixel *ptr = luma_src;
  198|   212k|        for (int y = 0; y < bh; y++) {
  ------------------
  |  Branch (198:25): [True: 204k, False: 7.86k]
  ------------------
  199|   204k|            ptr[out->p.w] = ptr[out->p.w - 1];
  200|   204k|            ptr += PXSTRIDE(in->stride[0]) << ss_y;
  ------------------
  |  |   53|   204k|#define PXSTRIDE(x) (x)
  ------------------
  201|   204k|        }
  202|  7.86k|    }
  203|       |
  204|  11.9k|    const ptrdiff_t uv_off = row * FG_BLOCK_SIZE * PXSTRIDE(out->stride[1]) >> ss_y;
  ------------------
  |  |   37|  11.9k|#define FG_BLOCK_SIZE 32
  ------------------
                  const ptrdiff_t uv_off = row * FG_BLOCK_SIZE * PXSTRIDE(out->stride[1]) >> ss_y;
  ------------------
  |  |   53|  11.9k|#define PXSTRIDE(x) (x)
  ------------------
  205|  11.9k|    if (data->chroma_scaling_from_luma) {
  ------------------
  |  Branch (205:9): [True: 4.35k, False: 7.57k]
  ------------------
  206|  13.0k|        for (int pl = 0; pl < 2; pl++)
  ------------------
  |  Branch (206:26): [True: 8.67k, False: 4.35k]
  ------------------
  207|  8.67k|            dsp->fguv_32x32xn[in->p.layout - 1](((pixel *) out->data[1 + pl]) + uv_off,
  208|  8.67k|                                                ((const pixel *) in->data[1 + pl]) + uv_off,
  209|  8.67k|                                                in->stride[1], data, cpw,
  210|  8.67k|                                                scaling[0], grain_lut[1 + pl],
  211|  8.67k|                                                bh, row, luma_src, in->stride[0],
  212|  8.67k|                                                pl, is_id HIGHBD_TAIL_SUFFIX);
  213|  7.57k|    } else {
  214|  21.9k|        for (int pl = 0; pl < 2; pl++)
  ------------------
  |  Branch (214:26): [True: 14.3k, False: 7.57k]
  ------------------
  215|  14.3k|            if (data->num_uv_points[pl])
  ------------------
  |  Branch (215:17): [True: 8.80k, False: 5.58k]
  ------------------
  216|  8.80k|                dsp->fguv_32x32xn[in->p.layout - 1](((pixel *) out->data[1 + pl]) + uv_off,
  217|  8.80k|                                                    ((const pixel *) in->data[1 + pl]) + uv_off,
  218|  8.80k|                                                    in->stride[1], data, cpw,
  219|  8.80k|                                                    scaling[1 + pl], grain_lut[1 + pl],
  220|  8.80k|                                                    bh, row, luma_src, in->stride[0],
  221|  8.80k|                                                    pl, is_id HIGHBD_TAIL_SUFFIX);
  222|  7.57k|    }
  223|  11.9k|}
fg_apply_tmpl.c:generate_scaling:
   44|  2.16k|{
   45|  2.16k|#if BITDEPTH == 8
   46|  2.16k|    const int shift_x = 0;
   47|  2.16k|    const int scaling_size = SCALING_SIZE;
  ------------------
  |  |   39|  2.16k|#define SCALING_SIZE 256
  ------------------
   48|       |#else
   49|       |    assert(bitdepth > 8);
   50|       |    const int shift_x = bitdepth - 8;
   51|       |    const int scaling_size = 1 << bitdepth;
   52|       |#endif
   53|       |
   54|  2.16k|    if (num == 0) {
  ------------------
  |  Branch (54:9): [True: 813, False: 1.35k]
  ------------------
   55|    813|        memset(scaling, 0, scaling_size);
   56|    813|        return;
   57|    813|    }
   58|       |
   59|       |    // Fill up the preceding entries with the initial value
   60|  1.35k|    memset(scaling, points[0][1], points[0][0] << shift_x);
   61|       |
   62|       |    // Linearly interpolate the values in the middle
   63|  4.50k|    for (int i = 0; i < num - 1; i++) {
  ------------------
  |  Branch (63:21): [True: 3.15k, False: 1.35k]
  ------------------
   64|  3.15k|        const int bx = points[i][0];
   65|  3.15k|        const int by = points[i][1];
   66|  3.15k|        const int ex = points[i+1][0];
   67|  3.15k|        const int ey = points[i+1][1];
   68|  3.15k|        const int dx = ex - bx;
   69|  3.15k|        const int dy = ey - by;
   70|  3.15k|        assert(dx > 0);
  ------------------
  |  Branch (70:9): [True: 3.15k, False: 0]
  ------------------
   71|  3.15k|        const int delta = dy * ((0x10000 + (dx >> 1)) / dx);
   72|   115k|        for (int x = 0, d = 0x8000; x < dx; x++) {
  ------------------
  |  Branch (72:37): [True: 112k, False: 3.15k]
  ------------------
   73|   112k|            scaling[(bx + x) << shift_x] = by + (d >> 16);
   74|   112k|            d += delta;
   75|   112k|        }
   76|  3.15k|    }
   77|       |
   78|       |    // Fill up the remaining entries with the final value
   79|  1.35k|    const int n = points[num - 1][0] << shift_x;
   80|  1.35k|    memset(&scaling[n], points[num - 1][1], scaling_size - n);
   81|       |
   82|       |#if BITDEPTH != 8
   83|       |    const int pad = 1 << shift_x, rnd = pad >> 1;
   84|       |    for (int i = 0; i < num - 1; i++) {
   85|       |        const int bx = points[i][0] << shift_x;
   86|       |        const int ex = points[i+1][0] << shift_x;
   87|       |        const int dx = ex - bx;
   88|       |        for (int x = 0; x < dx; x += pad) {
   89|       |            const int range = scaling[bx + x + pad] - scaling[bx + x];
   90|       |            for (int n = 1, r = rnd; n < pad; n++) {
   91|       |                r += range;
   92|       |                scaling[bx + x + n] = scaling[bx + x] + (r >> shift_x);
   93|       |            }
   94|       |        }
   95|       |    }
   96|       |#endif
   97|  1.35k|}
dav1d_prep_grain_16bpc:
  105|  2.29k|{
  106|  2.29k|    const Dav1dFilmGrainData *const data = &out->frame_hdr->film_grain.data;
  107|  2.29k|#if BITDEPTH != 8
  108|  2.29k|    const int bitdepth_max = (1 << out->p.bpc) - 1;
  109|  2.29k|#endif
  110|       |
  111|       |    // Generate grain LUTs as needed
  112|  2.29k|    dsp->generate_grain_y(grain_lut[0], data HIGHBD_TAIL_SUFFIX); // always needed
  ------------------
  |  |   74|  2.29k|#define HIGHBD_TAIL_SUFFIX , bitdepth_max
  ------------------
  113|  2.29k|    if (data->num_uv_points[0] || data->chroma_scaling_from_luma)
  ------------------
  |  Branch (113:9): [True: 561, False: 1.73k]
  |  Branch (113:35): [True: 622, False: 1.11k]
  ------------------
  114|  1.18k|        dsp->generate_grain_uv[in->p.layout - 1](grain_lut[1], grain_lut[0],
  115|  1.18k|                                                 data, 0 HIGHBD_TAIL_SUFFIX);
  ------------------
  |  |   74|  1.18k|#define HIGHBD_TAIL_SUFFIX , bitdepth_max
  ------------------
  116|  2.29k|    if (data->num_uv_points[1] || data->chroma_scaling_from_luma)
  ------------------
  |  Branch (116:9): [True: 149, False: 2.14k]
  |  Branch (116:35): [True: 622, False: 1.52k]
  ------------------
  117|    771|        dsp->generate_grain_uv[in->p.layout - 1](grain_lut[2], grain_lut[0],
  118|    771|                                                 data, 1 HIGHBD_TAIL_SUFFIX);
  ------------------
  |  |   74|    771|#define HIGHBD_TAIL_SUFFIX , bitdepth_max
  ------------------
  119|       |
  120|       |    // Generate scaling LUTs as needed
  121|  2.29k|    if (data->num_y_points || data->chroma_scaling_from_luma)
  ------------------
  |  Branch (121:9): [True: 1.37k, False: 924]
  |  Branch (121:31): [True: 422, False: 502]
  ------------------
  122|  1.79k|        generate_scaling(in->p.bpc, data->y_points, data->num_y_points, scaling[0]);
  123|  2.29k|    if (data->num_uv_points[0])
  ------------------
  |  Branch (123:9): [True: 561, False: 1.73k]
  ------------------
  124|    561|        generate_scaling(in->p.bpc, data->uv_points[0], data->num_uv_points[0], scaling[1]);
  125|  2.29k|    if (data->num_uv_points[1])
  ------------------
  |  Branch (125:9): [True: 149, False: 2.14k]
  ------------------
  126|    149|        generate_scaling(in->p.bpc, data->uv_points[1], data->num_uv_points[1], scaling[2]);
  127|       |
  128|       |    // Copy over the non-modified planes
  129|  2.29k|    assert(out->stride[0] == in->stride[0]);
  ------------------
  |  Branch (129:5): [True: 2.29k, False: 0]
  ------------------
  130|  2.29k|    if (!data->num_y_points) {
  ------------------
  |  Branch (130:9): [True: 924, False: 1.37k]
  ------------------
  131|    924|        const ptrdiff_t stride = out->stride[0];
  132|    924|        const ptrdiff_t sz = out->p.h * stride;
  133|    924|        if (sz < 0)
  ------------------
  |  Branch (133:13): [True: 0, False: 924]
  ------------------
  134|      0|            memcpy((uint8_t*) out->data[0] + sz - stride,
  135|      0|                   (uint8_t*) in->data[0] + sz - stride, -sz);
  136|    924|        else
  137|    924|            memcpy(out->data[0], in->data[0], sz);
  138|    924|    }
  139|       |
  140|  2.29k|    if (in->p.layout != DAV1D_PIXEL_LAYOUT_I400 && !data->chroma_scaling_from_luma) {
  ------------------
  |  Branch (140:9): [True: 1.43k, False: 856]
  |  Branch (140:52): [True: 816, False: 622]
  ------------------
  141|    816|        assert(out->stride[1] == in->stride[1]);
  ------------------
  |  Branch (141:9): [True: 816, False: 0]
  ------------------
  142|    816|        const int ss_ver = in->p.layout == DAV1D_PIXEL_LAYOUT_I420;
  143|    816|        const ptrdiff_t stride = out->stride[1];
  144|    816|        const ptrdiff_t sz = ((out->p.h + ss_ver) >> ss_ver) * stride;
  145|    816|        if (sz < 0) {
  ------------------
  |  Branch (145:13): [True: 0, False: 816]
  ------------------
  146|      0|            if (!data->num_uv_points[0])
  ------------------
  |  Branch (146:17): [True: 0, False: 0]
  ------------------
  147|      0|                memcpy((uint8_t*) out->data[1] + sz - stride,
  148|      0|                       (uint8_t*) in->data[1] + sz - stride, -sz);
  149|      0|            if (!data->num_uv_points[1])
  ------------------
  |  Branch (149:17): [True: 0, False: 0]
  ------------------
  150|      0|                memcpy((uint8_t*) out->data[2] + sz - stride,
  151|      0|                       (uint8_t*) in->data[2] + sz - stride, -sz);
  152|    816|        } else {
  153|    816|            if (!data->num_uv_points[0])
  ------------------
  |  Branch (153:17): [True: 255, False: 561]
  ------------------
  154|    255|                memcpy(out->data[1], in->data[1], sz);
  155|    816|            if (!data->num_uv_points[1])
  ------------------
  |  Branch (155:17): [True: 667, False: 149]
  ------------------
  156|    667|                memcpy(out->data[2], in->data[2], sz);
  157|    816|        }
  158|    816|    }
  159|  2.29k|}
dav1d_apply_grain_row_16bpc:
  167|  9.82k|{
  168|       |    // Synthesize grain for the affected planes
  169|  9.82k|    const Dav1dFilmGrainData *const data = &out->frame_hdr->film_grain.data;
  170|  9.82k|    const int ss_y = in->p.layout == DAV1D_PIXEL_LAYOUT_I420;
  171|  9.82k|    const int ss_x = in->p.layout != DAV1D_PIXEL_LAYOUT_I444;
  172|  9.82k|    const int cpw = (out->p.w + ss_x) >> ss_x;
  173|  9.82k|    const int is_id = out->seq_hdr->mtrx == DAV1D_MC_IDENTITY;
  174|  9.82k|    pixel *const luma_src =
  175|  9.82k|        ((pixel *) in->data[0]) + row * FG_BLOCK_SIZE * PXSTRIDE(in->stride[0]);
  ------------------
  |  |   37|  9.82k|#define FG_BLOCK_SIZE 32
  ------------------
  176|  9.82k|#if BITDEPTH != 8
  177|  9.82k|    const int bitdepth_max = (1 << out->p.bpc) - 1;
  178|  9.82k|#endif
  179|       |
  180|  9.82k|    if (data->num_y_points) {
  ------------------
  |  Branch (180:9): [True: 5.83k, False: 3.99k]
  ------------------
  181|  5.83k|        const int bh = imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE);
  ------------------
  |  |   37|  5.83k|#define FG_BLOCK_SIZE 32
  ------------------
                      const int bh = imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE);
  ------------------
  |  |   37|  5.83k|#define FG_BLOCK_SIZE 32
  ------------------
  182|  5.83k|        dsp->fgy_32x32xn(((pixel *) out->data[0]) + row * FG_BLOCK_SIZE * PXSTRIDE(out->stride[0]),
  ------------------
  |  |   37|  5.83k|#define FG_BLOCK_SIZE 32
  ------------------
  183|  5.83k|                         luma_src, out->stride[0], data,
  184|  5.83k|                         out->p.w, scaling[0], grain_lut[0], bh, row HIGHBD_TAIL_SUFFIX);
  ------------------
  |  |   74|  5.83k|#define HIGHBD_TAIL_SUFFIX , bitdepth_max
  ------------------
  185|  5.83k|    }
  186|       |
  187|  9.82k|    if (!data->num_uv_points[0] && !data->num_uv_points[1] &&
  ------------------
  |  Branch (187:9): [True: 8.79k, False: 1.03k]
  |  Branch (187:36): [True: 7.24k, False: 1.54k]
  ------------------
  188|  7.24k|        !data->chroma_scaling_from_luma)
  ------------------
  |  Branch (188:9): [True: 4.38k, False: 2.85k]
  ------------------
  189|  4.38k|    {
  190|  4.38k|        return;
  191|  4.38k|    }
  192|       |
  193|  5.43k|    const int bh = (imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE) + ss_y) >> ss_y;
  ------------------
  |  |   37|  5.43k|#define FG_BLOCK_SIZE 32
  ------------------
                  const int bh = (imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE) + ss_y) >> ss_y;
  ------------------
  |  |   37|  5.43k|#define FG_BLOCK_SIZE 32
  ------------------
  194|       |
  195|       |    // extend padding pixels
  196|  5.43k|    if (out->p.w & ss_x) {
  ------------------
  |  Branch (196:9): [True: 3.06k, False: 2.37k]
  ------------------
  197|  3.06k|        pixel *ptr = luma_src;
  198|  54.3k|        for (int y = 0; y < bh; y++) {
  ------------------
  |  Branch (198:25): [True: 51.2k, False: 3.06k]
  ------------------
  199|  51.2k|            ptr[out->p.w] = ptr[out->p.w - 1];
  200|  51.2k|            ptr += PXSTRIDE(in->stride[0]) << ss_y;
  201|  51.2k|        }
  202|  3.06k|    }
  203|       |
  204|  5.43k|    const ptrdiff_t uv_off = row * FG_BLOCK_SIZE * PXSTRIDE(out->stride[1]) >> ss_y;
  ------------------
  |  |   37|  5.43k|#define FG_BLOCK_SIZE 32
  ------------------
  205|  5.43k|    if (data->chroma_scaling_from_luma) {
  ------------------
  |  Branch (205:9): [True: 2.78k, False: 2.65k]
  ------------------
  206|  8.28k|        for (int pl = 0; pl < 2; pl++)
  ------------------
  |  Branch (206:26): [True: 5.50k, False: 2.78k]
  ------------------
  207|  5.50k|            dsp->fguv_32x32xn[in->p.layout - 1](((pixel *) out->data[1 + pl]) + uv_off,
  208|  5.50k|                                                ((const pixel *) in->data[1 + pl]) + uv_off,
  209|  5.50k|                                                in->stride[1], data, cpw,
  210|  5.50k|                                                scaling[0], grain_lut[1 + pl],
  211|  5.50k|                                                bh, row, luma_src, in->stride[0],
  212|  5.50k|                                                pl, is_id HIGHBD_TAIL_SUFFIX);
  ------------------
  |  |   74|  5.50k|#define HIGHBD_TAIL_SUFFIX , bitdepth_max
  ------------------
  213|  2.78k|    } else {
  214|  7.78k|        for (int pl = 0; pl < 2; pl++)
  ------------------
  |  Branch (214:26): [True: 5.12k, False: 2.65k]
  ------------------
  215|  5.12k|            if (data->num_uv_points[pl])
  ------------------
  |  Branch (215:17): [True: 3.06k, False: 2.06k]
  ------------------
  216|  3.06k|                dsp->fguv_32x32xn[in->p.layout - 1](((pixel *) out->data[1 + pl]) + uv_off,
  217|  3.06k|                                                    ((const pixel *) in->data[1 + pl]) + uv_off,
  218|  3.06k|                                                    in->stride[1], data, cpw,
  219|  3.06k|                                                    scaling[1 + pl], grain_lut[1 + pl],
  220|  3.06k|                                                    bh, row, luma_src, in->stride[0],
  221|  3.06k|                                                    pl, is_id HIGHBD_TAIL_SUFFIX);
  ------------------
  |  |   74|  3.06k|#define HIGHBD_TAIL_SUFFIX , bitdepth_max
  ------------------
  222|  2.65k|    }
  223|  5.43k|}

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

dav1d_init_get_bits:
   38|   409k|{
   39|   409k|    assert(sz);
  ------------------
  |  Branch (39:5): [True: 409k, False: 0]
  ------------------
   40|   409k|    c->ptr = c->ptr_start = data;
   41|   409k|    c->ptr_end = &c->ptr_start[sz];
   42|   409k|    c->state = 0;
   43|   409k|    c->bits_left = 0;
   44|   409k|    c->error = 0;
   45|   409k|}
dav1d_get_bit:
   47|  9.69M|unsigned dav1d_get_bit(GetBits *const c) {
   48|  9.69M|    if (!c->bits_left) {
  ------------------
  |  Branch (48:9): [True: 1.60M, False: 8.09M]
  ------------------
   49|  1.60M|        if (c->ptr >= c->ptr_end) {
  ------------------
  |  Branch (49:13): [True: 10.9k, False: 1.59M]
  ------------------
   50|  10.9k|            c->error = 1;
   51|  1.59M|        } else {
   52|  1.59M|            const unsigned state = *c->ptr++;
   53|  1.59M|            c->bits_left = 7;
   54|  1.59M|            c->state = (uint64_t) state << 57;
   55|  1.59M|            return state >> 7;
   56|  1.59M|        }
   57|  1.60M|    }
   58|       |
   59|  8.10M|    const uint64_t state = c->state;
   60|  8.10M|    c->bits_left--;
   61|  8.10M|    c->state = state << 1;
   62|  8.10M|    return (unsigned) (state >> 63);
   63|  9.69M|}
dav1d_get_uleb128:
   95|   170k|unsigned dav1d_get_uleb128(GetBits *const c) {
   96|   170k|    uint64_t val = 0;
   97|   170k|    unsigned i = 0, more;
   98|       |
   99|   175k|    do {
  100|   175k|        const int v = dav1d_get_bits(c, 8);
  101|   175k|        more = v & 0x80;
  102|   175k|        val |= ((uint64_t) (v & 0x7F)) << i;
  103|   175k|        i += 7;
  104|   175k|    } while (more && i < 56);
  ------------------
  |  Branch (104:14): [True: 5.86k, False: 169k]
  |  Branch (104:22): [True: 5.55k, False: 307]
  ------------------
  105|       |
  106|   170k|    if (val > UINT32_MAX || more) {
  ------------------
  |  Branch (106:9): [True: 267, False: 169k]
  |  Branch (106:29): [True: 85, False: 169k]
  ------------------
  107|    352|        c->error = 1;
  108|    352|        return 0;
  109|    352|    }
  110|       |
  111|   169k|    return (unsigned) val;
  112|   170k|}
dav1d_get_uniform:
  114|   185k|unsigned dav1d_get_uniform(GetBits *const c, const unsigned max) {
  115|       |    // Output in range [0..max-1]
  116|       |    // max must be > 1, or else nothing is read from the bitstream
  117|   185k|    assert(max > 1);
  ------------------
  |  Branch (117:5): [True: 185k, False: 0]
  ------------------
  118|   185k|    const int l = ulog2(max) + 1;
  119|   185k|    assert(l > 1);
  ------------------
  |  Branch (119:5): [True: 185k, False: 0]
  ------------------
  120|   185k|    const unsigned m = (1U << l) - max;
  121|   185k|    const unsigned v = dav1d_get_bits(c, l - 1);
  122|   185k|    return v < m ? v : (v << 1) - m + dav1d_get_bit(c);
  ------------------
  |  Branch (122:12): [True: 171k, False: 14.0k]
  ------------------
  123|   185k|}
dav1d_get_vlc:
  125|  1.21k|unsigned dav1d_get_vlc(GetBits *const c) {
  126|  1.21k|    if (dav1d_get_bit(c))
  ------------------
  |  Branch (126:9): [True: 510, False: 707]
  ------------------
  127|    510|        return 0;
  128|       |
  129|    707|    int n_bits = 0;
  130|  8.63k|    do {
  131|  8.63k|        if (++n_bits == 32)
  ------------------
  |  Branch (131:13): [True: 200, False: 8.43k]
  ------------------
  132|    200|            return UINT32_MAX;
  133|  8.63k|    } while (!dav1d_get_bit(c));
  ------------------
  |  Branch (133:14): [True: 7.92k, False: 507]
  ------------------
  134|       |
  135|    507|    return ((1U << n_bits) - 1) + dav1d_get_bits(c, n_bits);
  136|    707|}
dav1d_get_bits_subexp:
  162|   172k|int dav1d_get_bits_subexp(GetBits *const c, const int ref, const unsigned n) {
  163|   172k|    return (int) get_bits_subexp_u(c, ref + (1 << n), 2 << n) - (1 << n);
  164|   172k|}
getbits.c:refill:
   65|  1.93M|static inline void refill(GetBits *const c, const int n) {
   66|  1.93M|    assert(c->bits_left >= 0 && c->bits_left < 32);
  ------------------
  |  Branch (66:5): [True: 1.93M, False: 0]
  |  Branch (66:5): [True: 1.93M, False: 0]
  ------------------
   67|  1.93M|    unsigned state = 0;
   68|  2.02M|    do {
   69|  2.02M|        if (c->ptr >= c->ptr_end) {
  ------------------
  |  Branch (69:13): [True: 23.3k, False: 1.99M]
  ------------------
   70|  23.3k|            c->error = 1;
   71|  23.3k|            if (state) break;
  ------------------
  |  Branch (71:17): [True: 1.08k, False: 22.2k]
  ------------------
   72|  22.2k|            return;
   73|  23.3k|        }
   74|  1.99M|        state = (state << 8) | *c->ptr++;
   75|  1.99M|        c->bits_left += 8;
   76|  1.99M|    } while (n > c->bits_left);
  ------------------
  |  Branch (76:14): [True: 82.5k, False: 1.91M]
  ------------------
   77|  1.91M|    c->state |= (uint64_t) state << (64 - c->bits_left);
   78|  1.91M|}
getbits.c:get_bits_subexp_u:
  140|   172k|{
  141|   172k|    unsigned v = 0;
  142|       |
  143|   318k|    for (int i = 0;; i++) {
  144|   318k|        const int b = i ? 3 + i - 1 : 3;
  ------------------
  |  Branch (144:23): [True: 146k, False: 172k]
  ------------------
  145|       |
  146|   318k|        if (n < v + 3 * (1 << b)) {
  ------------------
  |  Branch (146:13): [True: 7.33k, False: 311k]
  ------------------
  147|  7.33k|            v += dav1d_get_uniform(c, n - v + 1);
  148|  7.33k|            break;
  149|  7.33k|        }
  150|       |
  151|   311k|        if (!dav1d_get_bit(c)) {
  ------------------
  |  Branch (151:13): [True: 164k, False: 146k]
  ------------------
  152|   164k|            v += dav1d_get_bits(c, b);
  153|   164k|            break;
  154|   164k|        }
  155|       |
  156|   146k|        v += 1 << b;
  157|   146k|    }
  158|       |
  159|   172k|    return ref * 2 <= n ? inv_recenter(ref, v) : n - inv_recenter(n - ref, v);
  ------------------
  |  Branch (159:12): [True: 159k, False: 12.2k]
  ------------------
  160|   172k|}

obu.c:dav1d_bytealign_get_bits:
   52|   481k|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|   481k|    assert(c->bits_left <= 7);
  ------------------
  |  Branch (60:5): [True: 481k, False: 0]
  ------------------
   61|       |
   62|   481k|    c->bits_left = 0;
   63|   481k|    c->state = 0;
   64|   481k|}

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]);
  ------------------
  |  Branch (135:5): [True: 1, False: 0]
  ------------------
  136|      1|    assert(mem.nwc[BL_64X64] == &nodes.branch_sb128[1 + 4 + 16]);
  ------------------
  |  Branch (136:5): [True: 1, False: 0]
  ------------------
  137|      1|    assert(mem.nwc[BL_32X32] == &nodes.branch_sb128[1 + 4 + 16 + 64]);
  ------------------
  |  Branch (137:5): [True: 1, False: 0]
  ------------------
  138|      1|    assert(mem.nt == &nodes.tip_sb128[256]);
  ------------------
  |  Branch (138:5): [True: 1, False: 0]
  ------------------
  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]);
  ------------------
  |  Branch (145:5): [True: 1, False: 0]
  ------------------
  146|      1|    assert(mem.nwc[BL_32X32] == &nodes.branch_sb64[1 + 4 + 16]);
  ------------------
  |  Branch (146:5): [True: 1, False: 0]
  ------------------
  147|      1|    assert(mem.nt == &nodes.tip_sb64[64]);
  ------------------
  |  Branch (147:5): [True: 1, False: 0]
  ------------------
  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|  3.82M|static inline int sm_flag(const BlockContext *const b, const int idx) {
   96|  3.82M|    if (!b->intra[idx]) return 0;
  ------------------
  |  Branch (96:9): [True: 219k, False: 3.60M]
  ------------------
   97|  3.60M|    const enum IntraPredMode m = b->mode[idx];
   98|  3.60M|    return (m == SMOOTH_PRED || m == SMOOTH_H_PRED ||
  ------------------
  |  Branch (98:13): [True: 129k, False: 3.47M]
  |  Branch (98:33): [True: 62.2k, False: 3.41M]
  ------------------
   99|  3.41M|            m == SMOOTH_V_PRED) ? ANGLE_SMOOTH_EDGE_FLAG : 0;
  ------------------
  |  |   93|   238k|#define ANGLE_SMOOTH_EDGE_FLAG      512
  ------------------
  |  Branch (99:13): [True: 44.1k, False: 3.36M]
  ------------------
  100|  3.82M|}
recon_tmpl.c:sm_uv_flag:
  102|  2.23M|static inline int sm_uv_flag(const BlockContext *const b, const int idx) {
  103|  2.23M|    const enum IntraPredMode m = b->uvmode[idx];
  104|  2.23M|    return (m == SMOOTH_PRED || m == SMOOTH_H_PRED ||
  ------------------
  |  Branch (104:13): [True: 86.1k, False: 2.15M]
  |  Branch (104:33): [True: 46.2k, False: 2.10M]
  ------------------
  105|  2.10M|            m == SMOOTH_V_PRED) ? ANGLE_SMOOTH_EDGE_FLAG : 0;
  ------------------
  |  |   93|   162k|#define ANGLE_SMOOTH_EDGE_FLAG      512
  ------------------
  |  Branch (105:13): [True: 29.3k, False: 2.07M]
  ------------------
  106|  2.23M|}

dav1d_prepare_intra_edges_8bpc:
   86|  11.4M|{
   87|  11.4M|    const int bitdepth = bitdepth_from_max(bitdepth_max);
  ------------------
  |  |   58|  11.4M|#define bitdepth_from_max(x) 8
  ------------------
   88|  11.4M|    assert(y < h && x < w);
  ------------------
  |  Branch (88:5): [True: 11.4M, False: 18.4E]
  |  Branch (88:5): [True: 11.4M, False: 5.74k]
  ------------------
   89|       |
   90|  11.3M|    switch (mode) {
   91|   243k|    case VERT_PRED:
  ------------------
  |  Branch (91:5): [True: 243k, False: 11.1M]
  ------------------
   92|   719k|    case HOR_PRED:
  ------------------
  |  Branch (92:5): [True: 475k, False: 10.9M]
  ------------------
   93|   759k|    case DIAG_DOWN_LEFT_PRED:
  ------------------
  |  Branch (93:5): [True: 40.2k, False: 11.3M]
  ------------------
   94|   807k|    case DIAG_DOWN_RIGHT_PRED:
  ------------------
  |  Branch (94:5): [True: 47.4k, False: 11.3M]
  ------------------
   95|   853k|    case VERT_RIGHT_PRED:
  ------------------
  |  Branch (95:5): [True: 45.9k, False: 11.3M]
  ------------------
   96|   934k|    case HOR_DOWN_PRED:
  ------------------
  |  Branch (96:5): [True: 80.9k, False: 11.3M]
  ------------------
   97|  1.06M|    case HOR_UP_PRED:
  ------------------
  |  Branch (97:5): [True: 127k, False: 11.2M]
  ------------------
   98|  1.12M|    case VERT_LEFT_PRED: {
  ------------------
  |  Branch (98:5): [True: 65.1k, False: 11.3M]
  ------------------
   99|  1.12M|        *angle = av1_mode_to_angle_map[mode - VERT_PRED] + 3 * *angle;
  100|       |
  101|  1.12M|        if (*angle <= 90)
  ------------------
  |  Branch (101:13): [True: 309k, False: 817k]
  ------------------
  102|   309k|            mode = *angle < 90 && have_top ? Z1_PRED : VERT_PRED;
  ------------------
  |  Branch (102:20): [True: 139k, False: 169k]
  |  Branch (102:35): [True: 137k, False: 1.90k]
  ------------------
  103|   817k|        else if (*angle < 180)
  ------------------
  |  Branch (103:18): [True: 266k, False: 551k]
  ------------------
  104|   266k|            mode = Z2_PRED;
  105|   551k|        else
  106|   551k|            mode = *angle > 180 && have_left ? Z3_PRED : HOR_PRED;
  ------------------
  |  Branch (106:20): [True: 210k, False: 340k]
  |  Branch (106:36): [True: 208k, False: 1.91k]
  ------------------
  107|  1.12M|        break;
  108|  1.06M|    }
  109|  9.26M|    case DC_PRED:
  ------------------
  |  Branch (109:5): [True: 9.26M, False: 2.12M]
  ------------------
  110|  9.51M|    case PAETH_PRED:
  ------------------
  |  Branch (110:5): [True: 251k, False: 11.1M]
  ------------------
  111|  9.51M|        mode = av1_mode_conv[mode][have_left][have_top];
  112|  9.51M|        break;
  113|   750k|    default:
  ------------------
  |  Branch (113:5): [True: 750k, False: 10.6M]
  ------------------
  114|   750k|        break;
  115|  11.3M|    }
  116|       |
  117|  11.3M|    const pixel *dst_top;
  118|  11.3M|    if (have_top &&
  ------------------
  |  Branch (118:9): [True: 11.1M, False: 165k]
  ------------------
  119|  11.1M|        (av1_intra_prediction_edges[mode].needs_top ||
  ------------------
  |  Branch (119:10): [True: 10.6M, False: 538k]
  ------------------
  120|   538k|         av1_intra_prediction_edges[mode].needs_topleft ||
  ------------------
  |  Branch (120:10): [True: 203k, False: 334k]
  ------------------
  121|   334k|         (av1_intra_prediction_edges[mode].needs_left && !have_left)))
  ------------------
  |  Branch (121:11): [True: 334k, False: 54]
  |  Branch (121:58): [True: 5.79k, False: 328k]
  ------------------
  122|  10.8M|    {
  123|  10.8M|        if (prefilter_toplevel_sb_edge) {
  ------------------
  |  Branch (123:13): [True: 963k, False: 9.88M]
  ------------------
  124|   963k|            dst_top = &prefilter_toplevel_sb_edge[x * 4];
  125|  9.88M|        } else {
  126|  9.88M|            dst_top = &dst[-PXSTRIDE(stride)];
  ------------------
  |  |   53|  9.88M|#define PXSTRIDE(x) (x)
  ------------------
  127|  9.88M|        }
  128|  10.8M|    }
  129|       |
  130|  11.3M|    if (av1_intra_prediction_edges[mode].needs_left) {
  ------------------
  |  Branch (130:9): [True: 10.1M, False: 1.22M]
  ------------------
  131|  10.1M|        const int sz = th << 2;
  132|  10.1M|        pixel *const left = &topleft_out[-sz];
  133|       |
  134|  10.1M|        if (have_left) {
  ------------------
  |  Branch (134:13): [True: 10.0M, False: 19.3k]
  ------------------
  135|  10.0M|            const int px_have = imin(sz, (h - y) << 2);
  136|       |
  137|  80.3M|            for (int i = 0; i < px_have; i++)
  ------------------
  |  Branch (137:29): [True: 70.2M, False: 10.0M]
  ------------------
  138|  70.2M|                left[sz - 1 - i] = dst[PXSTRIDE(stride) * i - 1];
  ------------------
  |  |   53|  70.2M|#define PXSTRIDE(x) (x)
  ------------------
  139|  10.0M|            if (px_have < sz)
  ------------------
  |  Branch (139:17): [True: 23.8k, False: 10.0M]
  ------------------
  140|  23.8k|                pixel_set(left, left[sz - px_have], sz - px_have);
  ------------------
  |  |   48|  23.8k|#define pixel_set memset
  ------------------
  141|  10.0M|        } else {
  142|  18.4E|            pixel_set(left, have_top ? *dst_top : ((1 << bitdepth) >> 1) + 1, sz);
  ------------------
  |  |   48|  19.3k|#define pixel_set memset
  ------------------
  |  Branch (142:29): [True: 20.3k, False: 18.4E]
  ------------------
  143|  19.3k|        }
  144|       |
  145|  10.1M|        if (av1_intra_prediction_edges[mode].needs_bottomleft) {
  ------------------
  |  Branch (145:13): [True: 208k, False: 9.90M]
  ------------------
  146|   208k|            const int have_bottomleft = (!have_left || y + th >= h) ? 0 :
  ------------------
  |  Branch (146:42): [True: 18.4E, False: 208k]
  |  Branch (146:56): [True: 4.85k, False: 204k]
  ------------------
  147|   208k|                                        (edge_flags & EDGE_I444_LEFT_HAS_BOTTOM);
  148|       |
  149|   208k|            if (have_bottomleft) {
  ------------------
  |  Branch (149:17): [True: 35.7k, False: 173k]
  ------------------
  150|  35.7k|                const int px_have = imin(sz, (h - y - th) << 2);
  151|       |
  152|   295k|                for (int i = 0; i < px_have; i++)
  ------------------
  |  Branch (152:33): [True: 259k, False: 35.7k]
  ------------------
  153|   259k|                    left[-(i + 1)] = dst[(sz + i) * PXSTRIDE(stride) - 1];
  ------------------
  |  |   53|   259k|#define PXSTRIDE(x) (x)
  ------------------
  154|  35.7k|                if (px_have < sz)
  ------------------
  |  Branch (154:21): [True: 394, False: 35.3k]
  ------------------
  155|    394|                    pixel_set(left - sz, left[-px_have], sz - px_have);
  ------------------
  |  |   48|    394|#define pixel_set memset
  ------------------
  156|   173k|            } else {
  157|   173k|                pixel_set(left - sz, left[0], sz);
  ------------------
  |  |   48|   173k|#define pixel_set memset
  ------------------
  158|   173k|            }
  159|   208k|        }
  160|  10.1M|    }
  161|       |
  162|  11.3M|    if (av1_intra_prediction_edges[mode].needs_top) {
  ------------------
  |  Branch (162:9): [True: 10.5M, False: 785k]
  ------------------
  163|  10.5M|        const int sz = tw << 2;
  164|  10.5M|        pixel *const top = &topleft_out[1];
  165|       |
  166|  10.5M|        if (have_top) {
  ------------------
  |  Branch (166:13): [True: 10.5M, False: 21.1k]
  ------------------
  167|  10.5M|            const int px_have = imin(sz, (w - x) << 2);
  168|  10.5M|            pixel_copy(top, dst_top, px_have);
  ------------------
  |  |   47|  10.5M|#define pixel_copy memcpy
  ------------------
  169|  10.5M|            if (px_have < sz)
  ------------------
  |  Branch (169:17): [True: 376k, False: 10.1M]
  ------------------
  170|   376k|                pixel_set(top + px_have, top[px_have - 1], sz - px_have);
  ------------------
  |  |   48|   376k|#define pixel_set memset
  ------------------
  171|  10.5M|        } else {
  172|  18.4E|            pixel_set(top, have_left ? dst[-1] : ((1 << bitdepth) >> 1) - 1, sz);
  ------------------
  |  |   48|  21.1k|#define pixel_set memset
  ------------------
  |  Branch (172:28): [True: 22.2k, False: 18.4E]
  ------------------
  173|  21.1k|        }
  174|       |
  175|  10.5M|        if (av1_intra_prediction_edges[mode].needs_topright) {
  ------------------
  |  Branch (175:13): [True: 137k, False: 10.4M]
  ------------------
  176|   137k|            const int have_topright = (!have_top || x + tw >= w) ? 0 :
  ------------------
  |  Branch (176:40): [True: 0, False: 137k]
  |  Branch (176:53): [True: 2.75k, False: 135k]
  ------------------
  177|   137k|                                      (edge_flags & EDGE_I444_TOP_HAS_RIGHT);
  178|       |
  179|   137k|            if (have_topright) {
  ------------------
  |  Branch (179:17): [True: 111k, False: 26.5k]
  ------------------
  180|   111k|                const int px_have = imin(sz, (w - x - tw) << 2);
  181|       |
  182|   111k|                pixel_copy(top + sz, &dst_top[sz], px_have);
  ------------------
  |  |   47|   111k|#define pixel_copy memcpy
  ------------------
  183|   111k|                if (px_have < sz)
  ------------------
  |  Branch (183:21): [True: 874, False: 110k]
  ------------------
  184|    874|                    pixel_set(top + sz + px_have, top[sz + px_have - 1],
  ------------------
  |  |   48|    874|#define pixel_set memset
  ------------------
  185|    874|                              sz - px_have);
  186|   111k|            } else {
  187|  26.5k|                pixel_set(top + sz, top[sz - 1], sz);
  ------------------
  |  |   48|  26.5k|#define pixel_set memset
  ------------------
  188|  26.5k|            }
  189|   137k|        }
  190|  10.5M|    }
  191|       |
  192|  11.3M|    if (av1_intra_prediction_edges[mode].needs_topleft) {
  ------------------
  |  Branch (192:9): [True: 983k, False: 10.3M]
  ------------------
  193|   983k|        if (have_left)
  ------------------
  |  Branch (193:13): [True: 974k, False: 9.05k]
  ------------------
  194|   974k|            *topleft_out = have_top ? dst_top[-1] : dst[-1];
  ------------------
  |  Branch (194:28): [True: 963k, False: 10.5k]
  ------------------
  195|  9.05k|        else
  196|  9.05k|            *topleft_out = have_top ? *dst_top : (1 << bitdepth) >> 1;
  ------------------
  |  Branch (196:28): [True: 8.79k, False: 262]
  ------------------
  197|       |
  198|   983k|        if (mode == Z2_PRED && tw + th >= 6 && filter_edge)
  ------------------
  |  Branch (198:13): [True: 266k, False: 716k]
  |  Branch (198:32): [True: 26.4k, False: 239k]
  |  Branch (198:48): [True: 21.9k, False: 4.53k]
  ------------------
  199|  21.9k|            *topleft_out = ((topleft_out[-1] + topleft_out[1]) * 5 +
  200|  21.9k|                            topleft_out[0] * 6 + 8) >> 4;
  201|   983k|    }
  202|       |
  203|  11.3M|    return mode;
  204|  11.3M|}
dav1d_prepare_intra_edges_16bpc:
   86|  13.2M|{
   87|  13.2M|    const int bitdepth = bitdepth_from_max(bitdepth_max);
  ------------------
  |  |   75|  13.2M|#define bitdepth_from_max(bitdepth_max) (32 - clz(bitdepth_max))
  ------------------
   88|  13.2M|    assert(y < h && x < w);
  ------------------
  |  Branch (88:5): [True: 12.9M, False: 331k]
  |  Branch (88:5): [True: 12.9M, False: 18.4E]
  ------------------
   89|       |
   90|  12.9M|    switch (mode) {
   91|   344k|    case VERT_PRED:
  ------------------
  |  Branch (91:5): [True: 344k, False: 12.5M]
  ------------------
   92|  1.11M|    case HOR_PRED:
  ------------------
  |  Branch (92:5): [True: 768k, False: 12.1M]
  ------------------
   93|  1.22M|    case DIAG_DOWN_LEFT_PRED:
  ------------------
  |  Branch (93:5): [True: 110k, False: 12.8M]
  ------------------
   94|  1.41M|    case DIAG_DOWN_RIGHT_PRED:
  ------------------
  |  Branch (94:5): [True: 188k, False: 12.7M]
  ------------------
   95|  1.58M|    case VERT_RIGHT_PRED:
  ------------------
  |  Branch (95:5): [True: 172k, False: 12.7M]
  ------------------
   96|  1.73M|    case HOR_DOWN_PRED:
  ------------------
  |  Branch (96:5): [True: 149k, False: 12.7M]
  ------------------
   97|  2.31M|    case HOR_UP_PRED:
  ------------------
  |  Branch (97:5): [True: 582k, False: 12.3M]
  ------------------
   98|  2.45M|    case VERT_LEFT_PRED: {
  ------------------
  |  Branch (98:5): [True: 139k, False: 12.8M]
  ------------------
   99|  2.45M|        *angle = av1_mode_to_angle_map[mode - VERT_PRED] + 3 * *angle;
  100|       |
  101|  2.45M|        if (*angle <= 90)
  ------------------
  |  Branch (101:13): [True: 514k, False: 1.94M]
  ------------------
  102|   514k|            mode = *angle < 90 && have_top ? Z1_PRED : VERT_PRED;
  ------------------
  |  Branch (102:20): [True: 346k, False: 167k]
  |  Branch (102:35): [True: 336k, False: 10.3k]
  ------------------
  103|  1.94M|        else if (*angle < 180)
  ------------------
  |  Branch (103:18): [True: 730k, False: 1.20M]
  ------------------
  104|   730k|            mode = Z2_PRED;
  105|  1.20M|        else
  106|  1.20M|            mode = *angle > 180 && have_left ? Z3_PRED : HOR_PRED;
  ------------------
  |  Branch (106:20): [True: 838k, False: 371k]
  |  Branch (106:36): [True: 834k, False: 4.23k]
  ------------------
  107|  2.45M|        break;
  108|  2.31M|    }
  109|  8.82M|    case DC_PRED:
  ------------------
  |  Branch (109:5): [True: 8.82M, False: 4.11M]
  ------------------
  110|  9.58M|    case PAETH_PRED:
  ------------------
  |  Branch (110:5): [True: 752k, False: 12.1M]
  ------------------
  111|  9.58M|        mode = av1_mode_conv[mode][have_left][have_top];
  112|  9.58M|        break;
  113|  1.77M|    default:
  ------------------
  |  Branch (113:5): [True: 1.77M, False: 11.1M]
  ------------------
  114|  1.77M|        break;
  115|  12.9M|    }
  116|       |
  117|  12.7M|    const pixel *dst_top;
  118|  12.7M|    if (have_top &&
  ------------------
  |  Branch (118:9): [True: 12.2M, False: 465k]
  ------------------
  119|  12.2M|        (av1_intra_prediction_edges[mode].needs_top ||
  ------------------
  |  Branch (119:10): [True: 11.1M, False: 1.15M]
  ------------------
  120|  1.15M|         av1_intra_prediction_edges[mode].needs_topleft ||
  ------------------
  |  Branch (120:10): [True: 786k, False: 363k]
  ------------------
  121|   364k|         (av1_intra_prediction_edges[mode].needs_left && !have_left)))
  ------------------
  |  Branch (121:11): [True: 364k, False: 18.4E]
  |  Branch (121:58): [True: 6.57k, False: 357k]
  ------------------
  122|  11.9M|    {
  123|  11.9M|        if (prefilter_toplevel_sb_edge) {
  ------------------
  |  Branch (123:13): [True: 798k, False: 11.1M]
  ------------------
  124|   798k|            dst_top = &prefilter_toplevel_sb_edge[x * 4];
  125|  11.1M|        } else {
  126|  11.1M|            dst_top = &dst[-PXSTRIDE(stride)];
  127|  11.1M|        }
  128|  11.9M|    }
  129|       |
  130|  12.7M|    if (av1_intra_prediction_edges[mode].needs_left) {
  ------------------
  |  Branch (130:9): [True: 11.3M, False: 1.34M]
  ------------------
  131|  11.3M|        const int sz = th << 2;
  132|  11.3M|        pixel *const left = &topleft_out[-sz];
  133|       |
  134|  11.3M|        if (have_left) {
  ------------------
  |  Branch (134:13): [True: 11.3M, False: 31.8k]
  ------------------
  135|  11.3M|            const int px_have = imin(sz, (h - y) << 2);
  136|       |
  137|  83.7M|            for (int i = 0; i < px_have; i++)
  ------------------
  |  Branch (137:29): [True: 72.3M, False: 11.3M]
  ------------------
  138|  72.3M|                left[sz - 1 - i] = dst[PXSTRIDE(stride) * i - 1];
  139|  11.3M|            if (px_have < sz)
  ------------------
  |  Branch (139:17): [True: 36.8k, False: 11.3M]
  ------------------
  140|  36.8k|                pixel_set(left, left[sz - px_have], sz - px_have);
  141|  11.3M|        } else {
  142|  31.8k|            pixel_set(left, have_top ? *dst_top : ((1 << bitdepth) >> 1) + 1, sz);
  ------------------
  |  Branch (142:29): [True: 26.4k, False: 5.39k]
  ------------------
  143|  31.8k|        }
  144|       |
  145|  11.3M|        if (av1_intra_prediction_edges[mode].needs_bottomleft) {
  ------------------
  |  Branch (145:13): [True: 723k, False: 10.6M]
  ------------------
  146|   723k|            const int have_bottomleft = (!have_left || y + th >= h) ? 0 :
  ------------------
  |  Branch (146:42): [True: 18.4E, False: 723k]
  |  Branch (146:56): [True: 17.6k, False: 705k]
  ------------------
  147|   723k|                                        (edge_flags & EDGE_I444_LEFT_HAS_BOTTOM);
  148|       |
  149|   723k|            if (have_bottomleft) {
  ------------------
  |  Branch (149:17): [True: 75.5k, False: 647k]
  ------------------
  150|  75.5k|                const int px_have = imin(sz, (h - y - th) << 2);
  151|       |
  152|   532k|                for (int i = 0; i < px_have; i++)
  ------------------
  |  Branch (152:33): [True: 456k, False: 75.5k]
  ------------------
  153|   456k|                    left[-(i + 1)] = dst[(sz + i) * PXSTRIDE(stride) - 1];
  154|  75.5k|                if (px_have < sz)
  ------------------
  |  Branch (154:21): [True: 349, False: 75.2k]
  ------------------
  155|    349|                    pixel_set(left - sz, left[-px_have], sz - px_have);
  156|   647k|            } else {
  157|   647k|                pixel_set(left - sz, left[0], sz);
  158|   647k|            }
  159|   723k|        }
  160|  11.3M|    }
  161|       |
  162|  12.7M|    if (av1_intra_prediction_edges[mode].needs_top) {
  ------------------
  |  Branch (162:9): [True: 10.4M, False: 2.33M]
  ------------------
  163|  10.4M|        const int sz = tw << 2;
  164|  10.4M|        pixel *const top = &topleft_out[1];
  165|       |
  166|  10.4M|        if (have_top) {
  ------------------
  |  Branch (166:13): [True: 10.3M, False: 53.6k]
  ------------------
  167|  10.3M|            const int px_have = imin(sz, (w - x) << 2);
  168|  10.3M|            pixel_copy(top, dst_top, px_have);
  ------------------
  |  |   65|  10.3M|#define pixel_copy(a, b, c) memcpy(a, b, (c) << 1)
  ------------------
  169|  10.3M|            if (px_have < sz)
  ------------------
  |  Branch (169:17): [True: 467k, False: 9.88M]
  ------------------
  170|   467k|                pixel_set(top + px_have, top[px_have - 1], sz - px_have);
  171|  10.3M|        } else {
  172|  18.4E|            pixel_set(top, have_left ? dst[-1] : ((1 << bitdepth) >> 1) - 1, sz);
  ------------------
  |  Branch (172:28): [True: 92.6k, False: 18.4E]
  ------------------
  173|  53.6k|        }
  174|       |
  175|  10.4M|        if (av1_intra_prediction_edges[mode].needs_topright) {
  ------------------
  |  Branch (175:13): [True: 332k, False: 10.0M]
  ------------------
  176|   332k|            const int have_topright = (!have_top || x + tw >= w) ? 0 :
  ------------------
  |  Branch (176:40): [True: 18.4E, False: 332k]
  |  Branch (176:53): [True: 5.37k, False: 326k]
  ------------------
  177|   332k|                                      (edge_flags & EDGE_I444_TOP_HAS_RIGHT);
  178|       |
  179|   332k|            if (have_topright) {
  ------------------
  |  Branch (179:17): [True: 288k, False: 43.2k]
  ------------------
  180|   288k|                const int px_have = imin(sz, (w - x - tw) << 2);
  181|       |
  182|   288k|                pixel_copy(top + sz, &dst_top[sz], px_have);
  ------------------
  |  |   65|   288k|#define pixel_copy(a, b, c) memcpy(a, b, (c) << 1)
  ------------------
  183|   288k|                if (px_have < sz)
  ------------------
  |  Branch (183:21): [True: 1.35k, False: 287k]
  ------------------
  184|  1.35k|                    pixel_set(top + sz + px_have, top[sz + px_have - 1],
  185|  1.35k|                              sz - px_have);
  186|   288k|            } else {
  187|  43.2k|                pixel_set(top + sz, top[sz - 1], sz);
  188|  43.2k|            }
  189|   332k|        }
  190|  10.4M|    }
  191|       |
  192|  12.7M|    if (av1_intra_prediction_edges[mode].needs_topleft) {
  ------------------
  |  Branch (192:9): [True: 2.42M, False: 10.3M]
  ------------------
  193|  2.42M|        if (have_left)
  ------------------
  |  Branch (193:13): [True: 2.41M, False: 13.5k]
  ------------------
  194|  2.41M|            *topleft_out = have_top ? dst_top[-1] : dst[-1];
  ------------------
  |  Branch (194:28): [True: 2.38M, False: 32.5k]
  ------------------
  195|  13.5k|        else
  196|  13.5k|            *topleft_out = have_top ? *dst_top : (1 << bitdepth) >> 1;
  ------------------
  |  Branch (196:28): [True: 10.6k, False: 2.84k]
  ------------------
  197|       |
  198|  2.42M|        if (mode == Z2_PRED && tw + th >= 6 && filter_edge)
  ------------------
  |  Branch (198:13): [True: 653k, False: 1.77M]
  |  Branch (198:32): [True: 50.3k, False: 602k]
  |  Branch (198:48): [True: 44.3k, False: 6.02k]
  ------------------
  199|  44.3k|            *topleft_out = ((topleft_out[-1] + topleft_out[1]) * 5 +
  200|  44.3k|                            topleft_out[0] * 6 + 8) >> 4;
  201|  2.42M|    }
  202|       |
  203|  12.7M|    return mode;
  204|  12.9M|}

dav1d_intra_pred_dsp_init_8bpc:
  744|  5.08k|COLD void bitfn(dav1d_intra_pred_dsp_init)(Dav1dIntraPredDSPContext *const c) {
  745|  5.08k|    c->intra_pred[DC_PRED      ] = ipred_dc_c;
  746|  5.08k|    c->intra_pred[DC_128_PRED  ] = ipred_dc_128_c;
  747|  5.08k|    c->intra_pred[TOP_DC_PRED  ] = ipred_dc_top_c;
  748|  5.08k|    c->intra_pred[LEFT_DC_PRED ] = ipred_dc_left_c;
  749|  5.08k|    c->intra_pred[HOR_PRED     ] = ipred_h_c;
  750|  5.08k|    c->intra_pred[VERT_PRED    ] = ipred_v_c;
  751|  5.08k|    c->intra_pred[PAETH_PRED   ] = ipred_paeth_c;
  752|  5.08k|    c->intra_pred[SMOOTH_PRED  ] = ipred_smooth_c;
  753|  5.08k|    c->intra_pred[SMOOTH_V_PRED] = ipred_smooth_v_c;
  754|  5.08k|    c->intra_pred[SMOOTH_H_PRED] = ipred_smooth_h_c;
  755|  5.08k|    c->intra_pred[Z1_PRED      ] = ipred_z1_c;
  756|  5.08k|    c->intra_pred[Z2_PRED      ] = ipred_z2_c;
  757|  5.08k|    c->intra_pred[Z3_PRED      ] = ipred_z3_c;
  758|  5.08k|    c->intra_pred[FILTER_PRED  ] = ipred_filter_c;
  759|       |
  760|  5.08k|    c->cfl_ac[DAV1D_PIXEL_LAYOUT_I420 - 1] = cfl_ac_420_c;
  761|  5.08k|    c->cfl_ac[DAV1D_PIXEL_LAYOUT_I422 - 1] = cfl_ac_422_c;
  762|  5.08k|    c->cfl_ac[DAV1D_PIXEL_LAYOUT_I444 - 1] = cfl_ac_444_c;
  763|       |
  764|  5.08k|    c->cfl_pred[DC_PRED     ] = ipred_cfl_c;
  765|  5.08k|    c->cfl_pred[DC_128_PRED ] = ipred_cfl_128_c;
  766|  5.08k|    c->cfl_pred[TOP_DC_PRED ] = ipred_cfl_top_c;
  767|  5.08k|    c->cfl_pred[LEFT_DC_PRED] = ipred_cfl_left_c;
  768|       |
  769|  5.08k|    c->pal_pred = pal_pred_c;
  770|       |
  771|  5.08k|#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|  5.08k|#endif
  782|  5.08k|}
dav1d_intra_pred_dsp_init_16bpc:
  744|  8.47k|COLD void bitfn(dav1d_intra_pred_dsp_init)(Dav1dIntraPredDSPContext *const c) {
  745|  8.47k|    c->intra_pred[DC_PRED      ] = ipred_dc_c;
  746|  8.47k|    c->intra_pred[DC_128_PRED  ] = ipred_dc_128_c;
  747|  8.47k|    c->intra_pred[TOP_DC_PRED  ] = ipred_dc_top_c;
  748|  8.47k|    c->intra_pred[LEFT_DC_PRED ] = ipred_dc_left_c;
  749|  8.47k|    c->intra_pred[HOR_PRED     ] = ipred_h_c;
  750|  8.47k|    c->intra_pred[VERT_PRED    ] = ipred_v_c;
  751|  8.47k|    c->intra_pred[PAETH_PRED   ] = ipred_paeth_c;
  752|  8.47k|    c->intra_pred[SMOOTH_PRED  ] = ipred_smooth_c;
  753|  8.47k|    c->intra_pred[SMOOTH_V_PRED] = ipred_smooth_v_c;
  754|  8.47k|    c->intra_pred[SMOOTH_H_PRED] = ipred_smooth_h_c;
  755|  8.47k|    c->intra_pred[Z1_PRED      ] = ipred_z1_c;
  756|  8.47k|    c->intra_pred[Z2_PRED      ] = ipred_z2_c;
  757|  8.47k|    c->intra_pred[Z3_PRED      ] = ipred_z3_c;
  758|  8.47k|    c->intra_pred[FILTER_PRED  ] = ipred_filter_c;
  759|       |
  760|  8.47k|    c->cfl_ac[DAV1D_PIXEL_LAYOUT_I420 - 1] = cfl_ac_420_c;
  761|  8.47k|    c->cfl_ac[DAV1D_PIXEL_LAYOUT_I422 - 1] = cfl_ac_422_c;
  762|  8.47k|    c->cfl_ac[DAV1D_PIXEL_LAYOUT_I444 - 1] = cfl_ac_444_c;
  763|       |
  764|  8.47k|    c->cfl_pred[DC_PRED     ] = ipred_cfl_c;
  765|  8.47k|    c->cfl_pred[DC_128_PRED ] = ipred_cfl_128_c;
  766|  8.47k|    c->cfl_pred[TOP_DC_PRED ] = ipred_cfl_top_c;
  767|  8.47k|    c->cfl_pred[LEFT_DC_PRED] = ipred_cfl_left_c;
  768|       |
  769|  8.47k|    c->pal_pred = pal_pred_c;
  770|       |
  771|  8.47k|#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.47k|#endif
  782|  8.47k|}

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

dav1d_itx_dsp_init_8bpc:
  220|  5.08k|COLD void bitfn(dav1d_itx_dsp_init)(Dav1dInvTxfmDSPContext *const c, int bpc) {
  221|  5.08k|#define assign_itx_all_fn64(w, h, pfx) \
  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  224|       |
  225|  5.08k|#define assign_itx_all_fn32(w, h, pfx) \
  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  229|       |
  230|  5.08k|#define assign_itx_all_fn16(w, h, pfx) \
  231|  5.08k|    assign_itx_all_fn32(w, h, pfx); \
  232|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  233|  5.08k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  234|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  235|  5.08k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  236|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  237|  5.08k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  238|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  239|  5.08k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  240|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  241|  5.08k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  242|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  243|  5.08k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  244|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  245|  5.08k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  246|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  247|  5.08k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  248|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  249|  5.08k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  250|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  251|  5.08k|        inv_txfm_add_identity_dct_##w##x##h##_c
  252|       |
  253|  5.08k|#define assign_itx_all_fn84(w, h, pfx) \
  254|  5.08k|    assign_itx_all_fn16(w, h, pfx); \
  255|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  256|  5.08k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  257|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  258|  5.08k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  259|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  260|  5.08k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  261|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  262|  5.08k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  263|  5.08k|
  264|  5.08k|#if !(HAVE_ASM && TRIM_DSP_FUNCTIONS && ( \
  265|  5.08k|  ARCH_AARCH64 || \
  266|  5.08k|  (ARCH_ARM && (defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32))) \
  267|  5.08k|))
  268|  5.08k|    c->itxfm_add[TX_4X4][WHT_WHT] = inv_txfm_add_wht_wht_4x4_c;
  269|  5.08k|#endif
  270|  5.08k|    assign_itx_all_fn84( 4,  4, );
  ------------------
  |  |  254|  5.08k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  5.08k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  5.08k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  5.08k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  5.08k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  5.08k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  5.08k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  5.08k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  5.08k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  5.08k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  5.08k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  5.08k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  5.08k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  5.08k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  5.08k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  5.08k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  271|  5.08k|    assign_itx_all_fn84( 4,  8, R);
  ------------------
  |  |  254|  5.08k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  5.08k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  5.08k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  5.08k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  5.08k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  5.08k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  5.08k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  5.08k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  5.08k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  5.08k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  5.08k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  5.08k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  5.08k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  5.08k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  5.08k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  5.08k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  272|  5.08k|    assign_itx_all_fn84( 4, 16, R);
  ------------------
  |  |  254|  5.08k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  5.08k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  5.08k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  5.08k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  5.08k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  5.08k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  5.08k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  5.08k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  5.08k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  5.08k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  5.08k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  5.08k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  5.08k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  5.08k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  5.08k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  5.08k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  273|  5.08k|    assign_itx_all_fn84( 8,  4, R);
  ------------------
  |  |  254|  5.08k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  5.08k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  5.08k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  5.08k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  5.08k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  5.08k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  5.08k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  5.08k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  5.08k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  5.08k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  5.08k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  5.08k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  5.08k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  5.08k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  5.08k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  5.08k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  274|  5.08k|    assign_itx_all_fn84( 8,  8, );
  ------------------
  |  |  254|  5.08k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  5.08k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  5.08k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  5.08k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  5.08k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  5.08k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  5.08k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  5.08k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  5.08k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  5.08k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  5.08k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  5.08k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  5.08k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  5.08k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  5.08k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  5.08k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  275|  5.08k|    assign_itx_all_fn84( 8, 16, R);
  ------------------
  |  |  254|  5.08k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  5.08k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  5.08k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  5.08k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  5.08k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  5.08k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  5.08k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  5.08k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  5.08k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  5.08k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  5.08k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  5.08k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  5.08k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  5.08k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  5.08k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  5.08k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  276|  5.08k|    assign_itx_all_fn32( 8, 32, R);
  ------------------
  |  |  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  277|  5.08k|    assign_itx_all_fn84(16,  4, R);
  ------------------
  |  |  254|  5.08k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  5.08k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  5.08k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  5.08k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  5.08k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  5.08k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  5.08k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  5.08k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  5.08k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  5.08k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  5.08k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  5.08k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  5.08k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  5.08k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  5.08k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  5.08k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  278|  5.08k|    assign_itx_all_fn84(16,  8, R);
  ------------------
  |  |  254|  5.08k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  5.08k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  5.08k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  5.08k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  5.08k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  5.08k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  5.08k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  5.08k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  5.08k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  5.08k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  5.08k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  5.08k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  5.08k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  5.08k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  5.08k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  5.08k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  279|  5.08k|    assign_itx_all_fn16(16, 16, );
  ------------------
  |  |  231|  5.08k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  ------------------
  |  |  232|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  233|  5.08k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  234|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  235|  5.08k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  236|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  237|  5.08k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  238|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  239|  5.08k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  240|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  241|  5.08k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  242|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  243|  5.08k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  244|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  245|  5.08k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  246|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  247|  5.08k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  248|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  249|  5.08k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  250|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  251|  5.08k|        inv_txfm_add_identity_dct_##w##x##h##_c
  ------------------
  280|  5.08k|    assign_itx_all_fn32(16, 32, R);
  ------------------
  |  |  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  281|  5.08k|    assign_itx_all_fn64(16, 64, R);
  ------------------
  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  282|  5.08k|    assign_itx_all_fn32(32,  8, R);
  ------------------
  |  |  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  283|  5.08k|    assign_itx_all_fn32(32, 16, R);
  ------------------
  |  |  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  284|  5.08k|    assign_itx_all_fn32(32, 32, );
  ------------------
  |  |  226|  5.08k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  5.08k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  285|  5.08k|    assign_itx_all_fn64(32, 64, R);
  ------------------
  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  286|  5.08k|    assign_itx_all_fn64(64, 16, R);
  ------------------
  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  287|  5.08k|    assign_itx_all_fn64(64, 32, R);
  ------------------
  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  288|  5.08k|    assign_itx_all_fn64(64, 64, );
  ------------------
  |  |  222|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  5.08k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  289|       |
  290|  5.08k|    int all_simd = 0;
  291|  5.08k|#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|  5.08k|#if ARCH_X86
  305|  5.08k|    itx_dsp_init_x86(c, bpc, &all_simd);
  306|  5.08k|#endif
  307|  5.08k|#endif
  308|       |
  309|  5.08k|    if (!all_simd)
  ------------------
  |  Branch (309:9): [True: 0, False: 5.08k]
  ------------------
  310|      0|        dav1d_init_last_nonzero_col_from_eob_tables();
  311|  5.08k|}
itx_tmpl.c:inv_txfm_add_c:
   47|  36.6k|{
   48|  36.6k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[tx];
   49|  36.6k|    const int w = 4 * t_dim->w, h = 4 * t_dim->h;
   50|  36.6k|    const int has_dconly = txtp == DCT_DCT;
   51|  36.6k|    assert(w >= 4 && w <= 64);
  ------------------
  |  Branch (51:5): [True: 36.6k, False: 1]
  |  Branch (51:5): [True: 36.6k, False: 0]
  ------------------
   52|  36.6k|    assert(h >= 4 && h <= 64);
  ------------------
  |  Branch (52:5): [True: 36.6k, False: 1]
  |  Branch (52:5): [True: 36.6k, False: 0]
  ------------------
   53|  36.6k|    assert(eob >= 0);
  ------------------
  |  Branch (53:5): [True: 36.6k, False: 0]
  ------------------
   54|       |
   55|  36.6k|    const int is_rect2 = w * 2 == h || h * 2 == w;
  ------------------
  |  Branch (55:26): [True: 7.00k, False: 29.6k]
  |  Branch (55:40): [True: 8.14k, False: 21.5k]
  ------------------
   56|  36.6k|    const int rnd = (1 << shift) >> 1;
   57|       |
   58|  36.6k|    if (eob < has_dconly) {
  ------------------
  |  Branch (58:9): [True: 17.9k, False: 18.7k]
  ------------------
   59|  17.9k|        int dc = coeff[0];
   60|  17.9k|        coeff[0] = 0;
   61|  17.9k|        if (is_rect2)
  ------------------
  |  Branch (61:13): [True: 7.56k, False: 10.3k]
  ------------------
   62|  7.56k|            dc = (dc * 181 + 128) >> 8;
   63|  17.9k|        dc = (dc * 181 + 128) >> 8;
   64|  17.9k|        dc = (dc + rnd) >> shift;
   65|  17.9k|        dc = (dc * 181 + 128 + 2048) >> 12;
   66|   731k|        for (int y = 0; y < h; y++, dst += PXSTRIDE(stride))
  ------------------
  |  |   53|   713k|#define PXSTRIDE(x) (x)
  ------------------
  |  Branch (66:25): [True: 713k, False: 17.9k]
  ------------------
   67|  36.2M|            for (int x = 0; x < w; x++)
  ------------------
  |  Branch (67:29): [True: 35.5M, False: 713k]
  ------------------
   68|  35.5M|                dst[x] = iclip_pixel(dst[x] + dc);
  ------------------
  |  |   49|  35.5M|#define iclip_pixel iclip_u8
  ------------------
   69|  17.9k|        return;
   70|  17.9k|    }
   71|       |
   72|  18.7k|    const uint8_t *const txtps = dav1d_tx1d_types[txtp];
   73|  18.7k|    const itx_1d_fn first_1d_fn = dav1d_tx1d_fns[t_dim->lw][txtps[0]];
   74|  18.7k|    const itx_1d_fn second_1d_fn = dav1d_tx1d_fns[t_dim->lh][txtps[1]];
   75|  18.7k|    const int sh = imin(h, 32), sw = imin(w, 32);
   76|  18.7k|#if BITDEPTH == 8
   77|  18.7k|    const int row_clip_min = INT16_MIN;
   78|  18.7k|    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|  18.7k|    const int row_clip_max = ~row_clip_min;
   84|  18.7k|    const int col_clip_max = ~col_clip_min;
   85|       |
   86|  18.7k|    int32_t tmp[64 * 64], *c = tmp;
   87|  18.7k|    int last_nonzero_col; // in first 1d itx
   88|  18.7k|    if (txtps[1] == IDENTITY && txtps[0] != IDENTITY) {
  ------------------
  |  Branch (88:9): [True: 0, False: 18.7k]
  |  Branch (88:33): [True: 0, False: 0]
  ------------------
   89|      0|        last_nonzero_col = imin(sh - 1, eob);
   90|  18.7k|    } else if (txtps[0] == IDENTITY && txtps[1] != IDENTITY) {
  ------------------
  |  Branch (90:16): [True: 0, False: 18.7k]
  |  Branch (90:40): [True: 0, False: 0]
  ------------------
   91|      0|        last_nonzero_col = eob >> (t_dim->lw + 2);
   92|  18.7k|    } else {
   93|  18.7k|        last_nonzero_col = dav1d_last_nonzero_col_from_eob[tx][eob];
   94|  18.7k|    }
   95|  18.7k|    assert(last_nonzero_col < sh);
  ------------------
  |  Branch (95:5): [True: 18.7k, False: 18.4E]
  ------------------
   96|   238k|    for (int y = 0; y <= last_nonzero_col; y++, c += w) {
  ------------------
  |  Branch (96:21): [True: 220k, False: 18.7k]
  ------------------
   97|   220k|        if (is_rect2)
  ------------------
  |  Branch (97:13): [True: 88.9k, False: 131k]
  ------------------
   98|  2.62M|            for (int x = 0; x < sw; x++)
  ------------------
  |  Branch (98:29): [True: 2.53M, False: 88.9k]
  ------------------
   99|  2.53M|                c[x] = (coeff[y + x * sh] * 181 + 128) >> 8;
  100|   131k|        else
  101|  4.27M|            for (int x = 0; x < sw; x++)
  ------------------
  |  Branch (101:29): [True: 4.14M, False: 131k]
  ------------------
  102|  4.14M|                c[x] = coeff[y + x * sh];
  103|   220k|        first_1d_fn(c, 1, row_clip_min, row_clip_max);
  104|   220k|    }
  105|  18.7k|    if (last_nonzero_col + 1 < sh)
  ------------------
  |  Branch (105:9): [True: 15.5k, False: 3.16k]
  ------------------
  106|  15.5k|        memset(c, 0, sizeof(*c) * (sh - last_nonzero_col - 1) * w);
  107|       |
  108|  18.7k|    memset(coeff, 0, sizeof(*coeff) * sw * sh);
  109|  23.4M|    for (int i = 0; i < w * sh; i++)
  ------------------
  |  Branch (109:21): [True: 23.4M, False: 18.7k]
  ------------------
  110|  23.4M|        tmp[i] = iclip((tmp[i] + rnd) >> shift, col_clip_min, col_clip_max);
  111|       |
  112|   792k|    for (int x = 0; x < w; x++)
  ------------------
  |  Branch (112:21): [True: 773k, False: 18.7k]
  ------------------
  113|   773k|        second_1d_fn(&tmp[x], w, col_clip_min, col_clip_max);
  114|       |
  115|  18.7k|    c = tmp;
  116|   842k|    for (int y = 0; y < h; y++, dst += PXSTRIDE(stride))
  ------------------
  |  |   53|   824k|#define PXSTRIDE(x) (x)
  ------------------
  |  Branch (116:21): [True: 824k, False: 18.7k]
  ------------------
  117|  37.2M|        for (int x = 0; x < w; x++)
  ------------------
  |  Branch (117:25): [True: 36.4M, False: 824k]
  ------------------
  118|  36.4M|            dst[x] = iclip_pixel(dst[x] + ((*c++ + 8) >> 4));
  ------------------
  |  |   49|  36.4M|#define iclip_pixel iclip_u8
  ------------------
  119|  18.7k|}
itx_tmpl.c:inv_txfm_add_dct_dct_16x32_c:
  127|  3.24k|                                               HIGHBD_DECL_SUFFIX) \
  128|  3.24k|{ \
  129|  3.24k|    inv_txfm_add_c(dst, stride, coeff, eob, pfx##TX_##w##X##h, shift, type \
  130|  3.24k|                   HIGHBD_TAIL_SUFFIX); \
  131|  3.24k|}
itx_tmpl.c:inv_txfm_add_dct_dct_16x64_c:
  127|    490|                                               HIGHBD_DECL_SUFFIX) \
  128|    490|{ \
  129|    490|    inv_txfm_add_c(dst, stride, coeff, eob, pfx##TX_##w##X##h, shift, type \
  130|    490|                   HIGHBD_TAIL_SUFFIX); \
  131|    490|}
itx_tmpl.c:inv_txfm_add_dct_dct_32x16_c:
  127|  5.41k|                                               HIGHBD_DECL_SUFFIX) \
  128|  5.41k|{ \
  129|  5.41k|    inv_txfm_add_c(dst, stride, coeff, eob, pfx##TX_##w##X##h, shift, type \
  130|  5.41k|                   HIGHBD_TAIL_SUFFIX); \
  131|  5.41k|}
itx_tmpl.c:inv_txfm_add_dct_dct_32x32_c:
  127|  8.51k|                                               HIGHBD_DECL_SUFFIX) \
  128|  8.51k|{ \
  129|  8.51k|    inv_txfm_add_c(dst, stride, coeff, eob, pfx##TX_##w##X##h, shift, type \
  130|  8.51k|                   HIGHBD_TAIL_SUFFIX); \
  131|  8.51k|}
itx_tmpl.c:inv_txfm_add_dct_dct_32x64_c:
  127|  3.77k|                                               HIGHBD_DECL_SUFFIX) \
  128|  3.77k|{ \
  129|  3.77k|    inv_txfm_add_c(dst, stride, coeff, eob, pfx##TX_##w##X##h, shift, type \
  130|  3.77k|                   HIGHBD_TAIL_SUFFIX); \
  131|  3.77k|}
itx_tmpl.c:inv_txfm_add_dct_dct_64x16_c:
  127|    587|                                               HIGHBD_DECL_SUFFIX) \
  128|    587|{ \
  129|    587|    inv_txfm_add_c(dst, stride, coeff, eob, pfx##TX_##w##X##h, shift, type \
  130|    587|                   HIGHBD_TAIL_SUFFIX); \
  131|    587|}
itx_tmpl.c:inv_txfm_add_dct_dct_64x32_c:
  127|  2.74k|                                               HIGHBD_DECL_SUFFIX) \
  128|  2.74k|{ \
  129|  2.74k|    inv_txfm_add_c(dst, stride, coeff, eob, pfx##TX_##w##X##h, shift, type \
  130|  2.74k|                   HIGHBD_TAIL_SUFFIX); \
  131|  2.74k|}
itx_tmpl.c:inv_txfm_add_dct_dct_64x64_c:
  127|  11.9k|                                               HIGHBD_DECL_SUFFIX) \
  128|  11.9k|{ \
  129|  11.9k|    inv_txfm_add_c(dst, stride, coeff, eob, pfx##TX_##w##X##h, shift, type \
  130|  11.9k|                   HIGHBD_TAIL_SUFFIX); \
  131|  11.9k|}
dav1d_itx_dsp_init_16bpc:
  220|  8.47k|COLD void bitfn(dav1d_itx_dsp_init)(Dav1dInvTxfmDSPContext *const c, int bpc) {
  221|  8.47k|#define assign_itx_all_fn64(w, h, pfx) \
  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  224|       |
  225|  8.47k|#define assign_itx_all_fn32(w, h, pfx) \
  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  229|       |
  230|  8.47k|#define assign_itx_all_fn16(w, h, pfx) \
  231|  8.47k|    assign_itx_all_fn32(w, h, pfx); \
  232|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  233|  8.47k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  234|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  235|  8.47k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  236|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  237|  8.47k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  238|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  239|  8.47k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  240|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  241|  8.47k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  242|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  243|  8.47k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  244|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  245|  8.47k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  246|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  247|  8.47k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  248|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  249|  8.47k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  250|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  251|  8.47k|        inv_txfm_add_identity_dct_##w##x##h##_c
  252|       |
  253|  8.47k|#define assign_itx_all_fn84(w, h, pfx) \
  254|  8.47k|    assign_itx_all_fn16(w, h, pfx); \
  255|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  256|  8.47k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  257|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  258|  8.47k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  259|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  260|  8.47k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  261|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  262|  8.47k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  263|  8.47k|
  264|  8.47k|#if !(HAVE_ASM && TRIM_DSP_FUNCTIONS && ( \
  265|  8.47k|  ARCH_AARCH64 || \
  266|  8.47k|  (ARCH_ARM && (defined(__ARM_NEON) || defined(__APPLE__) || defined(_WIN32))) \
  267|  8.47k|))
  268|  8.47k|    c->itxfm_add[TX_4X4][WHT_WHT] = inv_txfm_add_wht_wht_4x4_c;
  269|  8.47k|#endif
  270|  8.47k|    assign_itx_all_fn84( 4,  4, );
  ------------------
  |  |  254|  8.47k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.47k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.47k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.47k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.47k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.47k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.47k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.47k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.47k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.47k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.47k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.47k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.47k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.47k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.47k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.47k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  271|  8.47k|    assign_itx_all_fn84( 4,  8, R);
  ------------------
  |  |  254|  8.47k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.47k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.47k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.47k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.47k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.47k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.47k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.47k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.47k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.47k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.47k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.47k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.47k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.47k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.47k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.47k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  272|  8.47k|    assign_itx_all_fn84( 4, 16, R);
  ------------------
  |  |  254|  8.47k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.47k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.47k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.47k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.47k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.47k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.47k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.47k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.47k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.47k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.47k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.47k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.47k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.47k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.47k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.47k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  273|  8.47k|    assign_itx_all_fn84( 8,  4, R);
  ------------------
  |  |  254|  8.47k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.47k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.47k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.47k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.47k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.47k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.47k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.47k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.47k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.47k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.47k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.47k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.47k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.47k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.47k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.47k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  274|  8.47k|    assign_itx_all_fn84( 8,  8, );
  ------------------
  |  |  254|  8.47k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.47k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.47k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.47k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.47k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.47k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.47k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.47k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.47k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.47k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.47k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.47k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.47k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.47k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.47k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.47k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  275|  8.47k|    assign_itx_all_fn84( 8, 16, R);
  ------------------
  |  |  254|  8.47k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.47k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.47k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.47k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.47k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.47k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.47k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.47k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.47k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.47k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.47k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.47k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.47k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.47k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.47k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.47k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  276|  8.47k|    assign_itx_all_fn32( 8, 32, R);
  ------------------
  |  |  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  277|  8.47k|    assign_itx_all_fn84(16,  4, R);
  ------------------
  |  |  254|  8.47k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.47k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.47k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.47k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.47k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.47k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.47k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.47k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.47k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.47k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.47k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.47k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.47k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.47k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.47k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.47k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  278|  8.47k|    assign_itx_all_fn84(16,  8, R);
  ------------------
  |  |  254|  8.47k|    assign_itx_all_fn16(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  231|  8.47k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  |  |  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  232|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  |  |  233|  8.47k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  |  |  234|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  |  |  235|  8.47k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  |  |  236|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  |  |  237|  8.47k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  |  |  238|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  |  |  239|  8.47k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  |  |  240|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  |  |  241|  8.47k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  |  |  242|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  |  |  243|  8.47k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  |  |  244|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  |  |  245|  8.47k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  |  |  246|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  |  |  247|  8.47k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  |  |  248|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  |  |  249|  8.47k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  |  |  250|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  |  |  251|  8.47k|        inv_txfm_add_identity_dct_##w##x##h##_c
  |  |  ------------------
  |  |  255|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_FLIPADST] = \
  |  |  256|  8.47k|        inv_txfm_add_flipadst_identity_##w##x##h##_c; \
  |  |  257|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_FLIPADST] = \
  |  |  258|  8.47k|        inv_txfm_add_identity_flipadst_##w##x##h##_c; \
  |  |  259|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_ADST] = \
  |  |  260|  8.47k|        inv_txfm_add_adst_identity_##w##x##h##_c; \
  |  |  261|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_ADST] = \
  |  |  262|  8.47k|        inv_txfm_add_identity_adst_##w##x##h##_c; \
  ------------------
  279|  8.47k|    assign_itx_all_fn16(16, 16, );
  ------------------
  |  |  231|  8.47k|    assign_itx_all_fn32(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  |  |  ------------------
  |  |  |  |  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  |  |  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  |  |  ------------------
  |  |  232|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_ADST ] = \
  |  |  233|  8.47k|        inv_txfm_add_adst_dct_##w##x##h##_c; \
  |  |  234|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_DCT ] = \
  |  |  235|  8.47k|        inv_txfm_add_dct_adst_##w##x##h##_c; \
  |  |  236|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_ADST] = \
  |  |  237|  8.47k|        inv_txfm_add_adst_adst_##w##x##h##_c; \
  |  |  238|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][ADST_FLIPADST] = \
  |  |  239|  8.47k|        inv_txfm_add_flipadst_adst_##w##x##h##_c; \
  |  |  240|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_ADST] = \
  |  |  241|  8.47k|        inv_txfm_add_adst_flipadst_##w##x##h##_c; \
  |  |  242|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_FLIPADST] = \
  |  |  243|  8.47k|        inv_txfm_add_flipadst_dct_##w##x##h##_c; \
  |  |  244|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_DCT] = \
  |  |  245|  8.47k|        inv_txfm_add_dct_flipadst_##w##x##h##_c; \
  |  |  246|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][FLIPADST_FLIPADST] = \
  |  |  247|  8.47k|        inv_txfm_add_flipadst_flipadst_##w##x##h##_c; \
  |  |  248|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][H_DCT] = \
  |  |  249|  8.47k|        inv_txfm_add_dct_identity_##w##x##h##_c; \
  |  |  250|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][V_DCT] = \
  |  |  251|  8.47k|        inv_txfm_add_identity_dct_##w##x##h##_c
  ------------------
  280|  8.47k|    assign_itx_all_fn32(16, 32, R);
  ------------------
  |  |  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  281|  8.47k|    assign_itx_all_fn64(16, 64, R);
  ------------------
  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  282|  8.47k|    assign_itx_all_fn32(32,  8, R);
  ------------------
  |  |  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  283|  8.47k|    assign_itx_all_fn32(32, 16, R);
  ------------------
  |  |  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  284|  8.47k|    assign_itx_all_fn32(32, 32, );
  ------------------
  |  |  226|  8.47k|    assign_itx_all_fn64(w, h, pfx); \
  |  |  ------------------
  |  |  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  |  |  ------------------
  |  |  227|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][IDTX] = \
  |  |  228|  8.47k|        inv_txfm_add_identity_identity_##w##x##h##_c
  ------------------
  285|  8.47k|    assign_itx_all_fn64(32, 64, R);
  ------------------
  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  286|  8.47k|    assign_itx_all_fn64(64, 16, R);
  ------------------
  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  287|  8.47k|    assign_itx_all_fn64(64, 32, R);
  ------------------
  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  288|  8.47k|    assign_itx_all_fn64(64, 64, );
  ------------------
  |  |  222|  8.47k|    c->itxfm_add[pfx##TX_##w##X##h][DCT_DCT  ] = \
  |  |  223|  8.47k|        inv_txfm_add_dct_dct_##w##x##h##_c
  ------------------
  289|       |
  290|  8.47k|    int all_simd = 0;
  291|  8.47k|#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.47k|#if ARCH_X86
  305|  8.47k|    itx_dsp_init_x86(c, bpc, &all_simd);
  306|  8.47k|#endif
  307|  8.47k|#endif
  308|       |
  309|  8.47k|    if (!all_simd)
  ------------------
  |  Branch (309:9): [True: 5.05k, False: 3.41k]
  ------------------
  310|  5.05k|        dav1d_init_last_nonzero_col_from_eob_tables();
  311|  8.47k|}

dav1d_copy_lpf_8bpc:
  106|   132k|{
  107|   132k|    const int have_tt = f->c->n_tc > 1;
  108|   132k|    const int resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
  109|   132k|    const int offset = 8 * !!sby;
  110|   132k|    const ptrdiff_t *const src_stride = f->cur.stride;
  111|   132k|    const ptrdiff_t *const lr_stride = f->sr_cur.p.stride;
  112|   132k|    const int tt_off = have_tt * sby * (4 << f->seq_hdr->sb128);
  113|   132k|    pixel *const dst[3] = {
  114|   132k|        f->lf.lr_lpf_line[0] + tt_off * PXSTRIDE(lr_stride[0]),
  ------------------
  |  |   53|   132k|#define PXSTRIDE(x) (x)
  ------------------
  115|   132k|        f->lf.lr_lpf_line[1] + tt_off * PXSTRIDE(lr_stride[1]),
  ------------------
  |  |   53|   132k|#define PXSTRIDE(x) (x)
  ------------------
  116|   132k|        f->lf.lr_lpf_line[2] + tt_off * PXSTRIDE(lr_stride[1])
  ------------------
  |  |   53|   132k|#define PXSTRIDE(x) (x)
  ------------------
  117|   132k|    };
  118|       |
  119|       |    // TODO Also check block level restore type to reduce copying.
  120|   132k|    const int restore_planes = f->lf.restore_planes;
  121|   132k|    const int cdef_planes = f->lf.cdef_planes;
  122|       |
  123|   132k|    if ((cdef_planes & 1) || (restore_planes & LR_RESTORE_Y)) {
  ------------------
  |  Branch (123:9): [True: 28.6k, False: 103k]
  |  Branch (123:30): [True: 100k, False: 3.29k]
  ------------------
  124|   129k|        const int h = f->cur.p.h;
  125|   129k|        const int w = f->bw << 2;
  126|   129k|        const int row_h = imin((sby + 1) << (6 + f->seq_hdr->sb128), h - 1);
  127|   129k|        const int y_stripe = (sby << (6 + f->seq_hdr->sb128)) - offset;
  128|   129k|        if (restore_planes & LR_RESTORE_Y || !resize)
  ------------------
  |  Branch (128:13): [True: 104k, False: 24.1k]
  |  Branch (128:46): [True: 21.2k, False: 2.82k]
  ------------------
  129|   126k|            backup_lpf(f, dst[0], lr_stride[0],
  130|   126k|                       src[0] - offset * PXSTRIDE(src_stride[0]), src_stride[0],
  ------------------
  |  |   53|   126k|#define PXSTRIDE(x) (x)
  ------------------
  131|   126k|                       0, f->seq_hdr->sb128, y_stripe, row_h, w, h, 0, 1);
  132|   129k|        if (have_tt && resize && (cdef_planes & 1)) {
  ------------------
  |  Branch (132:13): [True: 129k, False: 18]
  |  Branch (132:24): [True: 7.43k, False: 121k]
  |  Branch (132:34): [True: 5.12k, False: 2.31k]
  ------------------
  133|  5.12k|            const ptrdiff_t cdef_off_y = sby * 4 * PXSTRIDE(src_stride[0]);
  ------------------
  |  |   53|  5.12k|#define PXSTRIDE(x) (x)
  ------------------
  134|  5.12k|            backup_lpf(f, f->lf.cdef_lpf_line[0] + cdef_off_y, src_stride[0],
  135|  5.12k|                       src[0] - offset * PXSTRIDE(src_stride[0]), src_stride[0],
  ------------------
  |  |   53|  5.12k|#define PXSTRIDE(x) (x)
  ------------------
  136|  5.12k|                       0, f->seq_hdr->sb128, y_stripe, row_h, w, h, 0, 0);
  137|  5.12k|        }
  138|   129k|    }
  139|   132k|    if (((cdef_planes & 2) || (restore_planes & (LR_RESTORE_U | LR_RESTORE_V))) &&
  ------------------
  |  Branch (139:10): [True: 11.1k, False: 121k]
  |  Branch (139:31): [True: 3.25k, False: 117k]
  ------------------
  140|  14.3k|        f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400)
  ------------------
  |  Branch (140:9): [True: 14.3k, False: 0]
  ------------------
  141|  14.3k|    {
  142|  14.3k|        const int ss_ver = f->sr_cur.p.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  143|  14.3k|        const int ss_hor = f->sr_cur.p.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  144|  14.3k|        const int h = (f->cur.p.h + ss_ver) >> ss_ver;
  145|  14.3k|        const int w = f->bw << (2 - ss_hor);
  146|  14.3k|        const int row_h = imin((sby + 1) << ((6 - ss_ver) + f->seq_hdr->sb128), h - 1);
  147|  14.3k|        const int offset_uv = offset >> ss_ver;
  148|  14.3k|        const int y_stripe = (sby << ((6 - ss_ver) + f->seq_hdr->sb128)) - offset_uv;
  149|  14.3k|        const ptrdiff_t cdef_off_uv = sby * 4 * PXSTRIDE(src_stride[1]);
  ------------------
  |  |   53|  14.3k|#define PXSTRIDE(x) (x)
  ------------------
  150|  14.3k|        if ((cdef_planes & 2) || (restore_planes & LR_RESTORE_U)) {
  ------------------
  |  Branch (150:13): [True: 11.1k, False: 3.24k]
  |  Branch (150:34): [True: 2.27k, False: 970]
  ------------------
  151|  13.4k|            if (restore_planes & LR_RESTORE_U || !resize)
  ------------------
  |  Branch (151:17): [True: 4.71k, False: 8.71k]
  |  Branch (151:50): [True: 6.79k, False: 1.91k]
  ------------------
  152|  11.5k|                backup_lpf(f, dst[1], lr_stride[1],
  153|  11.5k|                           src[1] - offset_uv * PXSTRIDE(src_stride[1]),
  ------------------
  |  |   53|  11.5k|#define PXSTRIDE(x) (x)
  ------------------
  154|  11.5k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  155|  11.5k|                           row_h, w, h, ss_hor, 1);
  156|  13.4k|            if (have_tt && resize && (cdef_planes & 2))
  ------------------
  |  Branch (156:17): [True: 13.4k, False: 1]
  |  Branch (156:28): [True: 5.37k, False: 8.04k]
  |  Branch (156:38): [True: 3.23k, False: 2.14k]
  ------------------
  157|  3.23k|                backup_lpf(f, f->lf.cdef_lpf_line[1] + cdef_off_uv, src_stride[1],
  158|  3.23k|                           src[1] - offset_uv * PXSTRIDE(src_stride[1]),
  ------------------
  |  |   53|  3.23k|#define PXSTRIDE(x) (x)
  ------------------
  159|  3.23k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  160|  3.23k|                           row_h, w, h, ss_hor, 0);
  161|  13.4k|        }
  162|  14.3k|        if ((cdef_planes & 2) || (restore_planes & LR_RESTORE_V)) {
  ------------------
  |  Branch (162:13): [True: 11.1k, False: 3.24k]
  |  Branch (162:34): [True: 2.61k, False: 632]
  ------------------
  163|  13.7k|            if (restore_planes & LR_RESTORE_V || !resize)
  ------------------
  |  Branch (163:17): [True: 4.22k, False: 9.53k]
  |  Branch (163:50): [True: 6.88k, False: 2.65k]
  ------------------
  164|  11.1k|                backup_lpf(f, dst[2], lr_stride[1],
  165|  11.1k|                           src[2] - offset_uv * PXSTRIDE(src_stride[1]),
  ------------------
  |  |   53|  11.1k|#define PXSTRIDE(x) (x)
  ------------------
  166|  11.1k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  167|  11.1k|                           row_h, w, h, ss_hor, 1);
  168|  13.7k|            if (have_tt && resize && (cdef_planes & 2))
  ------------------
  |  Branch (168:17): [True: 13.7k, False: 0]
  |  Branch (168:28): [True: 5.67k, False: 8.08k]
  |  Branch (168:38): [True: 3.23k, False: 2.44k]
  ------------------
  169|  3.23k|                backup_lpf(f, f->lf.cdef_lpf_line[2] + cdef_off_uv, src_stride[1],
  170|  3.23k|                           src[2] - offset_uv * PXSTRIDE(src_stride[1]),
  ------------------
  |  |   53|  3.23k|#define PXSTRIDE(x) (x)
  ------------------
  171|  3.23k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  172|  3.23k|                           row_h, w, h, ss_hor, 0);
  173|  13.7k|        }
  174|  14.3k|    }
  175|   132k|}
dav1d_loopfilter_sbrow_cols_8bpc:
  315|   254k|{
  316|   254k|    int x, have_left;
  317|       |    // Don't filter outside the frame
  318|   254k|    const int is_sb64 = !f->seq_hdr->sb128;
  319|   254k|    const int starty4 = (sby & is_sb64) << 4;
  320|   254k|    const int sbsz = 32 >> is_sb64;
  321|   254k|    const int sbl2 = 5 - is_sb64;
  322|   254k|    const int halign = (f->bh + 31) & ~31;
  323|   254k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  324|   254k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  325|   254k|    const int vmask = 16 >> ss_ver, hmask = 16 >> ss_hor;
  326|   254k|    const unsigned vmax = 1U << vmask, hmax = 1U << hmask;
  327|   254k|    const unsigned endy4 = starty4 + imin(f->h4 - sby * sbsz, sbsz);
  328|   254k|    const unsigned uv_endy4 = (endy4 + ss_ver) >> ss_ver;
  329|       |
  330|       |    // fix lpf strength at tile col boundaries
  331|   254k|    const uint8_t *lpf_y = &f->lf.tx_lpf_right_edge[0][sby << sbl2];
  332|   254k|    const uint8_t *lpf_uv = &f->lf.tx_lpf_right_edge[1][sby << (sbl2 - ss_ver)];
  333|   333k|    for (int tile_col = 1;; tile_col++) {
  334|   333k|        x = f->frame_hdr->tiling.col_start_sb[tile_col];
  335|   333k|        if ((x << sbl2) >= f->bw) break;
  ------------------
  |  Branch (335:13): [True: 253k, False: 79.1k]
  ------------------
  336|  79.1k|        const int bx4 = x & is_sb64 ? 16 : 0, cbx4 = bx4 >> ss_hor;
  ------------------
  |  Branch (336:25): [True: 76.4k, False: 2.67k]
  ------------------
  337|  79.1k|        x >>= is_sb64;
  338|       |
  339|  79.1k|        uint16_t (*const y_hmask)[2] = lflvl[x].filter_y[0][bx4];
  340|  1.36M|        for (unsigned y = starty4, mask = 1 << y; y < endy4; y++, mask <<= 1) {
  ------------------
  |  Branch (340:51): [True: 1.28M, False: 79.1k]
  ------------------
  341|  1.28M|            const int sidx = mask >= 0x10000U;
  342|  1.28M|            const unsigned smask = mask >> (sidx << 4);
  343|  1.28M|            const int idx = 2 * !!(y_hmask[2][sidx] & smask) +
  344|  1.28M|                                !!(y_hmask[1][sidx] & smask);
  345|  1.28M|            y_hmask[2][sidx] &= ~smask;
  346|  1.28M|            y_hmask[1][sidx] &= ~smask;
  347|  1.28M|            y_hmask[0][sidx] &= ~smask;
  348|  1.28M|            y_hmask[imin(idx, lpf_y[y - starty4])][sidx] |= smask;
  349|  1.28M|        }
  350|       |
  351|  79.1k|        if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (351:13): [True: 2.73k, False: 76.3k]
  ------------------
  352|  2.73k|            uint16_t (*const uv_hmask)[2] = lflvl[x].filter_uv[0][cbx4];
  353|  36.9k|            for (unsigned y = starty4 >> ss_ver, uv_mask = 1 << y; y < uv_endy4;
  ------------------
  |  Branch (353:68): [True: 34.1k, False: 2.73k]
  ------------------
  354|  34.1k|                 y++, uv_mask <<= 1)
  355|  34.1k|            {
  356|  34.1k|                const int sidx = uv_mask >= vmax;
  357|  34.1k|                const unsigned smask = uv_mask >> (sidx << (4 - ss_ver));
  358|  34.1k|                const int idx = !!(uv_hmask[1][sidx] & smask);
  359|  34.1k|                uv_hmask[1][sidx] &= ~smask;
  360|  34.1k|                uv_hmask[0][sidx] &= ~smask;
  361|  34.1k|                uv_hmask[imin(idx, lpf_uv[y - (starty4 >> ss_ver)])][sidx] |= smask;
  362|  34.1k|            }
  363|  2.73k|        }
  364|  79.1k|        lpf_y  += halign;
  365|  79.1k|        lpf_uv += halign >> ss_ver;
  366|  79.1k|    }
  367|       |
  368|       |    // fix lpf strength at tile row boundaries
  369|   254k|    if (start_of_tile_row) {
  ------------------
  |  Branch (369:9): [True: 795, False: 253k]
  ------------------
  370|    795|        const BlockContext *a;
  371|    795|        for (x = 0, a = &f->a[f->sb128w * (start_of_tile_row - 1)];
  372|  2.77k|             x < f->sb128w; x++, a++)
  ------------------
  |  Branch (372:14): [True: 1.97k, False: 795]
  ------------------
  373|  1.97k|        {
  374|  1.97k|            uint16_t (*const y_vmask)[2] = lflvl[x].filter_y[1][starty4];
  375|  1.97k|            const unsigned w = imin(32, f->w4 - (x << 5));
  376|  58.9k|            for (unsigned mask = 1, i = 0; i < w; mask <<= 1, i++) {
  ------------------
  |  Branch (376:44): [True: 57.0k, False: 1.97k]
  ------------------
  377|  57.0k|                const int sidx = mask >= 0x10000U;
  378|  57.0k|                const unsigned smask = mask >> (sidx << 4);
  379|  57.0k|                const int idx = 2 * !!(y_vmask[2][sidx] & smask) +
  380|  57.0k|                                    !!(y_vmask[1][sidx] & smask);
  381|  57.0k|                y_vmask[2][sidx] &= ~smask;
  382|  57.0k|                y_vmask[1][sidx] &= ~smask;
  383|  57.0k|                y_vmask[0][sidx] &= ~smask;
  384|  57.0k|                y_vmask[imin(idx, a->tx_lpf_y[i])][sidx] |= smask;
  385|  57.0k|            }
  386|       |
  387|  1.97k|            if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (387:17): [True: 1.24k, False: 735]
  ------------------
  388|  1.24k|                const unsigned cw = (w + ss_hor) >> ss_hor;
  389|  1.24k|                uint16_t (*const uv_vmask)[2] = lflvl[x].filter_uv[1][starty4 >> ss_ver];
  390|  20.0k|                for (unsigned uv_mask = 1, i = 0; i < cw; uv_mask <<= 1, i++) {
  ------------------
  |  Branch (390:51): [True: 18.7k, False: 1.24k]
  ------------------
  391|  18.7k|                    const int sidx = uv_mask >= hmax;
  392|  18.7k|                    const unsigned smask = uv_mask >> (sidx << (4 - ss_hor));
  393|  18.7k|                    const int idx = !!(uv_vmask[1][sidx] & smask);
  394|  18.7k|                    uv_vmask[1][sidx] &= ~smask;
  395|  18.7k|                    uv_vmask[0][sidx] &= ~smask;
  396|  18.7k|                    uv_vmask[imin(idx, a->tx_lpf_uv[i])][sidx] |= smask;
  397|  18.7k|                }
  398|  1.24k|            }
  399|  1.97k|        }
  400|    795|    }
  401|       |
  402|   254k|    pixel *ptr;
  403|   254k|    uint8_t (*level_ptr)[2] = f->lf.level[0] + f->b4_stride * sby * sbsz;
  404|   530k|    for (ptr = p[0], have_left = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (404:44): [True: 276k, False: 254k]
  ------------------
  405|   276k|         x++, have_left = 1, ptr += 128, level_ptr += 32)
  406|   276k|    {
  407|   276k|        filter_plane_cols_y(f, have_left, level_ptr, f->b4_stride,
  408|   276k|                            lflvl[x].filter_y[0], ptr, f->cur.stride[0],
  409|   276k|                            imin(32, f->w4 - x * 32), starty4, endy4);
  410|   276k|    }
  411|       |
  412|   254k|    if (!f->frame_hdr->loopfilter.level_u && !f->frame_hdr->loopfilter.level_v)
  ------------------
  |  Branch (412:9): [True: 213k, False: 40.7k]
  |  Branch (412:46): [True: 210k, False: 3.13k]
  ------------------
  413|   210k|        return;
  414|       |
  415|  43.9k|    ptrdiff_t uv_off;
  416|  43.9k|    level_ptr = f->lf.level[1] + f->b4_stride * (sby * sbsz >> ss_ver);
  417|   105k|    for (uv_off = 0, have_left = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (417:44): [True: 61.1k, False: 43.9k]
  ------------------
  418|  61.1k|         x++, have_left = 1, uv_off += 128 >> ss_hor, level_ptr += 32 >> ss_hor)
  419|  61.1k|    {
  420|  61.1k|        filter_plane_cols_uv(f, have_left, level_ptr, f->b4_stride,
  421|  61.1k|                             lflvl[x].filter_uv[0],
  422|  61.1k|                             &p[1][uv_off], &p[2][uv_off], f->cur.stride[1],
  423|  61.1k|                             (imin(32, f->w4 - x * 32) + ss_hor) >> ss_hor,
  424|  61.1k|                             starty4 >> ss_ver, uv_endy4, ss_ver);
  425|  61.1k|    }
  426|  43.9k|}
dav1d_loopfilter_sbrow_rows_8bpc:
  431|   254k|{
  432|   254k|    int x;
  433|       |    // Don't filter outside the frame
  434|   254k|    const int have_top = sby > 0;
  435|   254k|    const int is_sb64 = !f->seq_hdr->sb128;
  436|   254k|    const int starty4 = (sby & is_sb64) << 4;
  437|   254k|    const int sbsz = 32 >> is_sb64;
  438|   254k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  439|   254k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  440|   254k|    const unsigned endy4 = starty4 + imin(f->h4 - sby * sbsz, sbsz);
  441|   254k|    const unsigned uv_endy4 = (endy4 + ss_ver) >> ss_ver;
  442|       |
  443|   254k|    pixel *ptr;
  444|   254k|    uint8_t (*level_ptr)[2] = f->lf.level[0] + f->b4_stride * sby * sbsz;
  445|   530k|    for (ptr = p[0], x = 0; x < f->sb128w; x++, ptr += 128, level_ptr += 32) {
  ------------------
  |  Branch (445:29): [True: 276k, False: 254k]
  ------------------
  446|   276k|        filter_plane_rows_y(f, have_top, level_ptr, f->b4_stride,
  447|   276k|                            lflvl[x].filter_y[1], ptr, f->cur.stride[0],
  448|   276k|                            imin(32, f->w4 - x * 32), starty4, endy4);
  449|   276k|    }
  450|       |
  451|   254k|    if (!f->frame_hdr->loopfilter.level_u && !f->frame_hdr->loopfilter.level_v)
  ------------------
  |  Branch (451:9): [True: 213k, False: 40.7k]
  |  Branch (451:46): [True: 210k, False: 3.13k]
  ------------------
  452|   210k|        return;
  453|       |
  454|  43.9k|    ptrdiff_t uv_off;
  455|  43.9k|    level_ptr = f->lf.level[1] + f->b4_stride * (sby * sbsz >> ss_ver);
  456|   105k|    for (uv_off = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (456:29): [True: 61.1k, False: 43.9k]
  ------------------
  457|  61.1k|         x++, uv_off += 128 >> ss_hor, level_ptr += 32 >> ss_hor)
  458|  61.1k|    {
  459|  61.1k|        filter_plane_rows_uv(f, have_top, level_ptr, f->b4_stride,
  460|  61.1k|                             lflvl[x].filter_uv[1],
  461|  61.1k|                             &p[1][uv_off], &p[2][uv_off], f->cur.stride[1],
  462|  61.1k|                             (imin(32, f->w4 - x * 32) + ss_hor) >> ss_hor,
  463|  61.1k|                             starty4 >> ss_ver, uv_endy4, ss_hor);
  464|  61.1k|    }
  465|  43.9k|}
lf_apply_tmpl.c:backup_lpf:
   47|  2.23M|{
   48|  2.23M|    const int cdef_backup = !lr_backup;
   49|  2.23M|    const int dst_w = f->frame_hdr->super_res.enabled ?
  ------------------
  |  Branch (49:23): [True: 102k, False: 2.13M]
  ------------------
   50|  2.13M|                      (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|  2.23M|    int stripe_h = ((64 << (cdef_backup & sb128)) - 8 * !row) >> ss_ver;
   54|  2.23M|    src += (stripe_h - 2) * PXSTRIDE(src_stride);
  ------------------
  |  |   53|  2.23M|#define PXSTRIDE(x) (x)
  ------------------
   55|       |
   56|  2.23M|    if (f->c->n_tc == 1) {
  ------------------
  |  Branch (56:9): [True: 0, False: 2.23M]
  ------------------
   57|      0|        if (row) {
  ------------------
  |  Branch (57:13): [True: 0, False: 0]
  ------------------
   58|      0|            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|      0|            pixel_copy(&dst[PXSTRIDE(dst_stride) *  0],
  ------------------
  |  |   47|      0|#define pixel_copy memcpy
  ------------------
                          pixel_copy(&dst[PXSTRIDE(dst_stride) *  0],
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
   62|      0|                       &dst[PXSTRIDE(dst_stride) *  top],      dst_w);
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
   63|      0|            pixel_copy(&dst[PXSTRIDE(dst_stride) *  1],
  ------------------
  |  |   47|      0|#define pixel_copy memcpy
  ------------------
                          pixel_copy(&dst[PXSTRIDE(dst_stride) *  1],
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
   64|      0|                       &dst[PXSTRIDE(dst_stride) * (top + 1)], dst_w);
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
   65|      0|            pixel_copy(&dst[PXSTRIDE(dst_stride) *  2],
  ------------------
  |  |   47|      0|#define pixel_copy memcpy
  ------------------
                          pixel_copy(&dst[PXSTRIDE(dst_stride) *  2],
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
   66|      0|                       &dst[PXSTRIDE(dst_stride) * (top + 2)], dst_w);
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
   67|      0|            pixel_copy(&dst[PXSTRIDE(dst_stride) *  3],
  ------------------
  |  |   47|      0|#define pixel_copy memcpy
  ------------------
                          pixel_copy(&dst[PXSTRIDE(dst_stride) *  3],
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
   68|      0|                       &dst[PXSTRIDE(dst_stride) * (top + 3)], dst_w);
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
   69|      0|        }
   70|      0|        dst += 4 * PXSTRIDE(dst_stride);
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
   71|      0|    }
   72|       |
   73|  2.23M|    if (lr_backup && (f->frame_hdr->width[0] != f->frame_hdr->width[1])) {
  ------------------
  |  Branch (73:9): [True: 2.18M, False: 50.7k]
  |  Branch (73:22): [True: 45.7k, False: 2.14M]
  ------------------
   74|   117k|        while (row + stripe_h <= row_h) {
  ------------------
  |  Branch (74:16): [True: 71.2k, False: 45.7k]
  ------------------
   75|  71.2k|            const int n_lines = 4 - (row + stripe_h + 1 == h);
   76|  71.2k|            f->dsp->mc.resize(dst, dst_stride, src, src_stride,
   77|  71.2k|                              dst_w, n_lines, src_w, f->resize_step[ss_hor],
   78|  71.2k|                              f->resize_start[ss_hor] HIGHBD_CALL_SUFFIX);
   79|  71.2k|            row += stripe_h; // unmodified stripe_h for the 1st stripe
   80|  71.2k|            stripe_h = 64 >> ss_ver;
   81|  71.2k|            src += stripe_h * PXSTRIDE(src_stride);
  ------------------
  |  |   53|  71.2k|#define PXSTRIDE(x) (x)
  ------------------
   82|  71.2k|            dst += n_lines * PXSTRIDE(dst_stride);
  ------------------
  |  |   53|  71.2k|#define PXSTRIDE(x) (x)
  ------------------
   83|  71.2k|            if (n_lines == 3) {
  ------------------
  |  Branch (83:17): [True: 2.77k, False: 68.5k]
  ------------------
   84|  2.77k|                pixel_copy(dst, &dst[-PXSTRIDE(dst_stride)], dst_w);
  ------------------
  |  |   47|  2.77k|#define pixel_copy memcpy
  ------------------
                              pixel_copy(dst, &dst[-PXSTRIDE(dst_stride)], dst_w);
  ------------------
  |  |   53|  2.77k|#define PXSTRIDE(x) (x)
  ------------------
   85|  2.77k|                dst += PXSTRIDE(dst_stride);
  ------------------
  |  |   53|  2.77k|#define PXSTRIDE(x) (x)
  ------------------
   86|  2.77k|            }
   87|  71.2k|        }
   88|  2.19M|    } else {
   89|  6.33M|        while (row + stripe_h <= row_h) {
  ------------------
  |  Branch (89:16): [True: 4.13M, False: 2.19M]
  ------------------
   90|  4.13M|            const int n_lines = 4 - (row + stripe_h + 1 == h);
   91|  20.6M|            for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (91:29): [True: 16.5M, False: 4.13M]
  ------------------
   92|  16.5M|                pixel_copy(dst, i == n_lines ? &dst[-PXSTRIDE(dst_stride)] :
  ------------------
  |  |   47|  16.5M|#define pixel_copy memcpy
  ------------------
                              pixel_copy(dst, i == n_lines ? &dst[-PXSTRIDE(dst_stride)] :
  ------------------
  |  |   53|    958|#define PXSTRIDE(x) (x)
  ------------------
  |  Branch (92:33): [True: 958, False: 16.5M]
  ------------------
   93|  16.5M|                                               src, src_w);
   94|  16.5M|                dst += PXSTRIDE(dst_stride);
  ------------------
  |  |   53|  16.5M|#define PXSTRIDE(x) (x)
  ------------------
   95|  16.5M|                src += PXSTRIDE(src_stride);
  ------------------
  |  |   53|  16.5M|#define PXSTRIDE(x) (x)
  ------------------
   96|  16.5M|            }
   97|  4.13M|            row += stripe_h; // unmodified stripe_h for the 1st stripe
   98|  4.13M|            stripe_h = 64 >> ss_ver;
   99|  4.13M|            src += (stripe_h - 4) * PXSTRIDE(src_stride);
  ------------------
  |  |   53|  4.13M|#define PXSTRIDE(x) (x)
  ------------------
  100|  4.13M|        }
  101|  2.19M|    }
  102|  2.23M|}
lf_apply_tmpl.c:filter_plane_cols_y:
  185|  3.73M|{
  186|  3.73M|    const Dav1dDSPContext *const dsp = f->dsp;
  187|  3.73M|    const loopfilter_sb_fn loop_filter_sb = dsp->lf.loop_filter_sb[0][0];
  188|       |
  189|       |    // filter edges between columns (e.g. block1 | block2)
  190|  96.8M|    for (int x = 0; x < w; x++) {
  ------------------
  |  Branch (190:21): [True: 93.1M, False: 3.73M]
  ------------------
  191|  93.1M|        if (!have_left && !x) continue;
  ------------------
  |  Branch (191:13): [True: 91.7M, False: 1.39M]
  |  Branch (191:27): [True: 3.68M, False: 88.0M]
  ------------------
  192|  89.4M|        uint32_t hmask[4];
  193|  89.4M|        if (!starty4) {
  ------------------
  |  Branch (193:13): [True: 82.4M, False: 7.00M]
  ------------------
  194|  82.4M|            hmask[0] = mask[x][0][0];
  195|  82.4M|            hmask[1] = mask[x][1][0];
  196|  82.4M|            hmask[2] = mask[x][2][0];
  197|  82.4M|            if (endy4 > 16) {
  ------------------
  |  Branch (197:17): [True: 74.7M, False: 7.64M]
  ------------------
  198|  74.7M|                hmask[0] |= (unsigned) mask[x][0][1] << 16;
  199|  74.7M|                hmask[1] |= (unsigned) mask[x][1][1] << 16;
  200|  74.7M|                hmask[2] |= (unsigned) mask[x][2][1] << 16;
  201|  74.7M|            }
  202|  82.4M|        } else {
  203|  7.00M|            hmask[0] = mask[x][0][1];
  204|  7.00M|            hmask[1] = mask[x][1][1];
  205|  7.00M|            hmask[2] = mask[x][2][1];
  206|  7.00M|        }
  207|  89.4M|        hmask[3] = 0;
  208|  89.4M|        loop_filter_sb(&dst[x * 4], ls, hmask, &lvl[x], b4_stride,
  209|  89.4M|                       &f->lf.lim_lut, endy4 - starty4 HIGHBD_CALL_SUFFIX);
  210|  89.4M|    }
  211|  3.73M|}
lf_apply_tmpl.c:filter_plane_cols_uv:
  252|   131k|{
  253|   131k|    const Dav1dDSPContext *const dsp = f->dsp;
  254|   131k|    const loopfilter_sb_fn loop_filter_sb = dsp->lf.loop_filter_sb[1][0];
  255|       |
  256|       |    // filter edges between columns (e.g. block1 | block2)
  257|  2.06M|    for (int x = 0; x < w; x++) {
  ------------------
  |  Branch (257:21): [True: 1.93M, False: 131k]
  ------------------
  258|  1.93M|        if (!have_left && !x) continue;
  ------------------
  |  Branch (258:13): [True: 1.33M, False: 605k]
  |  Branch (258:27): [True: 98.8k, False: 1.23M]
  ------------------
  259|  1.83M|        uint32_t hmask[3];
  260|  1.83M|        if (!starty4) {
  ------------------
  |  Branch (260:13): [True: 1.68M, False: 156k]
  ------------------
  261|  1.68M|            hmask[0] = mask[x][0][0];
  262|  1.68M|            hmask[1] = mask[x][1][0];
  263|  1.68M|            if (endy4 > (16 >> ss_ver)) {
  ------------------
  |  Branch (263:17): [True: 1.44M, False: 236k]
  ------------------
  264|  1.44M|                hmask[0] |= (unsigned) mask[x][0][1] << (16 >> ss_ver);
  265|  1.44M|                hmask[1] |= (unsigned) mask[x][1][1] << (16 >> ss_ver);
  266|  1.44M|            }
  267|  1.68M|        } else {
  268|   156k|            hmask[0] = mask[x][0][1];
  269|   156k|            hmask[1] = mask[x][1][1];
  270|   156k|        }
  271|  1.83M|        hmask[2] = 0;
  272|  1.83M|        loop_filter_sb(&u[x * 4], ls, hmask, &lvl[x], b4_stride,
  273|  1.83M|                       &f->lf.lim_lut, endy4 - starty4 HIGHBD_CALL_SUFFIX);
  274|  1.83M|        loop_filter_sb(&v[x * 4], ls, hmask, (const uint8_t(*)[2]) &lvl[x][1],
  275|  1.83M|                       b4_stride, &f->lf.lim_lut, endy4 - starty4 HIGHBD_CALL_SUFFIX);
  276|  1.83M|    }
  277|   131k|}
lf_apply_tmpl.c:filter_plane_rows_y:
  221|  3.73M|{
  222|  3.73M|    const Dav1dDSPContext *const dsp = f->dsp;
  223|  3.73M|    const loopfilter_sb_fn loop_filter_sb = dsp->lf.loop_filter_sb[0][1];
  224|       |
  225|       |    //                                 block1
  226|       |    // filter edges between rows (e.g. ------)
  227|       |    //                                 block2
  228|   112M|    for (int y = starty4; y < endy4;
  ------------------
  |  Branch (228:27): [True: 108M, False: 3.73M]
  ------------------
  229|   108M|         y++, dst += 4 * PXSTRIDE(ls), lvl += b4_stride)
  ------------------
  |  |   53|   108M|#define PXSTRIDE(x) (x)
  ------------------
  230|   108M|    {
  231|   108M|        if (!have_top && !y) continue;
  ------------------
  |  Branch (231:13): [True: 982k, False: 107M]
  |  Branch (231:26): [True: 45.8k, False: 936k]
  ------------------
  232|   108M|        const uint32_t vmask[4] = {
  233|   108M|            mask[y][0][0] | ((unsigned) mask[y][0][1] << 16),
  234|   108M|            mask[y][1][0] | ((unsigned) mask[y][1][1] << 16),
  235|   108M|            mask[y][2][0] | ((unsigned) mask[y][2][1] << 16),
  236|   108M|            0,
  237|   108M|        };
  238|   108M|        loop_filter_sb(dst, ls, vmask, (const uint8_t(*)[2]) &lvl[0][1],
  239|   108M|                       b4_stride, &f->lf.lim_lut, w HIGHBD_CALL_SUFFIX);
  240|   108M|    }
  241|  3.73M|}
lf_apply_tmpl.c:filter_plane_rows_uv:
  288|   132k|{
  289|   132k|    const Dav1dDSPContext *const dsp = f->dsp;
  290|   132k|    const loopfilter_sb_fn loop_filter_sb = dsp->lf.loop_filter_sb[1][1];
  291|   132k|    ptrdiff_t off_l = 0;
  292|       |
  293|       |    //                                 block1
  294|       |    // filter edges between rows (e.g. ------)
  295|       |    //                                 block2
  296|  2.24M|    for (int y = starty4; y < endy4;
  ------------------
  |  Branch (296:27): [True: 2.11M, False: 132k]
  ------------------
  297|  2.11M|         y++, off_l += 4 * PXSTRIDE(ls), lvl += b4_stride)
  ------------------
  |  |   53|  2.11M|#define PXSTRIDE(x) (x)
  ------------------
  298|  2.11M|    {
  299|  2.11M|        if (!have_top && !y) continue;
  ------------------
  |  Branch (299:13): [True: 177k, False: 1.93M]
  |  Branch (299:26): [True: 14.5k, False: 162k]
  ------------------
  300|  2.09M|        const uint32_t vmask[3] = {
  301|  2.09M|            mask[y][0][0] | ((unsigned) mask[y][0][1] << (16 >> ss_hor)),
  302|  2.09M|            mask[y][1][0] | ((unsigned) mask[y][1][1] << (16 >> ss_hor)),
  303|  2.09M|            0,
  304|  2.09M|        };
  305|  2.09M|        loop_filter_sb(&u[off_l], ls, vmask, lvl, b4_stride,
  306|  2.09M|                       &f->lf.lim_lut, w HIGHBD_CALL_SUFFIX);
  307|  2.09M|        loop_filter_sb(&v[off_l], ls, vmask, (const uint8_t(*)[2]) &lvl[0][1],
  308|  2.09M|                       b4_stride, &f->lf.lim_lut, w HIGHBD_CALL_SUFFIX);
  309|  2.09M|    }
  310|   132k|}
dav1d_copy_lpf_16bpc:
  106|  2.05M|{
  107|  2.05M|    const int have_tt = f->c->n_tc > 1;
  108|  2.05M|    const int resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
  109|  2.05M|    const int offset = 8 * !!sby;
  110|  2.05M|    const ptrdiff_t *const src_stride = f->cur.stride;
  111|  2.05M|    const ptrdiff_t *const lr_stride = f->sr_cur.p.stride;
  112|  2.05M|    const int tt_off = have_tt * sby * (4 << f->seq_hdr->sb128);
  113|  2.05M|    pixel *const dst[3] = {
  114|  2.05M|        f->lf.lr_lpf_line[0] + tt_off * PXSTRIDE(lr_stride[0]),
  115|  2.05M|        f->lf.lr_lpf_line[1] + tt_off * PXSTRIDE(lr_stride[1]),
  116|  2.05M|        f->lf.lr_lpf_line[2] + tt_off * PXSTRIDE(lr_stride[1])
  117|  2.05M|    };
  118|       |
  119|       |    // TODO Also check block level restore type to reduce copying.
  120|  2.05M|    const int restore_planes = f->lf.restore_planes;
  121|  2.05M|    const int cdef_planes = f->lf.cdef_planes;
  122|       |
  123|  2.05M|    if ((cdef_planes & 1) || (restore_planes & LR_RESTORE_Y)) {
  ------------------
  |  Branch (123:9): [True: 2.02M, False: 32.0k]
  |  Branch (123:30): [True: 31.2k, False: 798]
  ------------------
  124|  2.05M|        const int h = f->cur.p.h;
  125|  2.05M|        const int w = f->bw << 2;
  126|  2.05M|        const int row_h = imin((sby + 1) << (6 + f->seq_hdr->sb128), h - 1);
  127|  2.05M|        const int y_stripe = (sby << (6 + f->seq_hdr->sb128)) - offset;
  128|  2.05M|        if (restore_planes & LR_RESTORE_Y || !resize)
  ------------------
  |  Branch (128:13): [True: 148k, False: 1.90M]
  |  Branch (128:46): [True: 1.87M, False: 33.4k]
  ------------------
  129|  2.01M|            backup_lpf(f, dst[0], lr_stride[0],
  130|  2.01M|                       src[0] - offset * PXSTRIDE(src_stride[0]), src_stride[0],
  131|  2.01M|                       0, f->seq_hdr->sb128, y_stripe, row_h, w, h, 0, 1);
  132|  2.05M|        if (have_tt && resize && (cdef_planes & 1)) {
  ------------------
  |  Branch (132:13): [True: 2.04M, False: 2.39k]
  |  Branch (132:24): [True: 60.9k, False: 1.98M]
  |  Branch (132:34): [True: 35.4k, False: 25.5k]
  ------------------
  133|  35.4k|            const ptrdiff_t cdef_off_y = sby * 4 * PXSTRIDE(src_stride[0]);
  134|  35.4k|            backup_lpf(f, f->lf.cdef_lpf_line[0] + cdef_off_y, src_stride[0],
  135|  35.4k|                       src[0] - offset * PXSTRIDE(src_stride[0]), src_stride[0],
  136|  35.4k|                       0, f->seq_hdr->sb128, y_stripe, row_h, w, h, 0, 0);
  137|  35.4k|        }
  138|  2.05M|    }
  139|  2.05M|    if (((cdef_planes & 2) || (restore_planes & (LR_RESTORE_U | LR_RESTORE_V))) &&
  ------------------
  |  Branch (139:10): [True: 9.96k, False: 2.04M]
  |  Branch (139:31): [True: 4.65k, False: 2.03M]
  ------------------
  140|  12.4k|        f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400)
  ------------------
  |  Branch (140:9): [True: 12.4k, False: 0]
  ------------------
  141|  12.4k|    {
  142|  12.4k|        const int ss_ver = f->sr_cur.p.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  143|  12.4k|        const int ss_hor = f->sr_cur.p.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  144|  12.4k|        const int h = (f->cur.p.h + ss_ver) >> ss_ver;
  145|  12.4k|        const int w = f->bw << (2 - ss_hor);
  146|  12.4k|        const int row_h = imin((sby + 1) << ((6 - ss_ver) + f->seq_hdr->sb128), h - 1);
  147|  12.4k|        const int offset_uv = offset >> ss_ver;
  148|  12.4k|        const int y_stripe = (sby << ((6 - ss_ver) + f->seq_hdr->sb128)) - offset_uv;
  149|  12.4k|        const ptrdiff_t cdef_off_uv = sby * 4 * PXSTRIDE(src_stride[1]);
  150|  12.4k|        if ((cdef_planes & 2) || (restore_planes & LR_RESTORE_U)) {
  ------------------
  |  Branch (150:13): [True: 7.72k, False: 4.73k]
  |  Branch (150:34): [True: 3.39k, False: 1.34k]
  ------------------
  151|  11.1k|            if (restore_planes & LR_RESTORE_U || !resize)
  ------------------
  |  Branch (151:17): [True: 5.71k, False: 5.40k]
  |  Branch (151:50): [True: 4.63k, False: 768]
  ------------------
  152|  10.3k|                backup_lpf(f, dst[1], lr_stride[1],
  153|  10.3k|                           src[1] - offset_uv * PXSTRIDE(src_stride[1]),
  154|  10.3k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  155|  10.3k|                           row_h, w, h, ss_hor, 1);
  156|  11.1k|            if (have_tt && resize && (cdef_planes & 2))
  ------------------
  |  Branch (156:17): [True: 11.1k, False: 18.4E]
  |  Branch (156:28): [True: 4.00k, False: 7.11k]
  |  Branch (156:38): [True: 1.86k, False: 2.14k]
  ------------------
  157|  1.86k|                backup_lpf(f, f->lf.cdef_lpf_line[1] + cdef_off_uv, src_stride[1],
  158|  1.86k|                           src[1] - offset_uv * PXSTRIDE(src_stride[1]),
  159|  1.86k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  160|  1.86k|                           row_h, w, h, ss_hor, 0);
  161|  11.1k|        }
  162|  12.4k|        if ((cdef_planes & 2) || (restore_planes & LR_RESTORE_V)) {
  ------------------
  |  Branch (162:13): [True: 7.72k, False: 4.74k]
  |  Branch (162:34): [True: 4.39k, False: 344]
  ------------------
  163|  12.1k|            if (restore_planes & LR_RESTORE_V || !resize)
  ------------------
  |  Branch (163:17): [True: 6.64k, False: 5.47k]
  |  Branch (163:50): [True: 4.67k, False: 805]
  ------------------
  164|  11.3k|                backup_lpf(f, dst[2], lr_stride[1],
  165|  11.3k|                           src[2] - offset_uv * PXSTRIDE(src_stride[1]),
  166|  11.3k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  167|  11.3k|                           row_h, w, h, ss_hor, 1);
  168|  12.1k|            if (have_tt && resize && (cdef_planes & 2))
  ------------------
  |  Branch (168:17): [True: 12.1k, False: 3]
  |  Branch (168:28): [True: 4.74k, False: 7.37k]
  |  Branch (168:38): [True: 1.86k, False: 2.88k]
  ------------------
  169|  1.86k|                backup_lpf(f, f->lf.cdef_lpf_line[2] + cdef_off_uv, src_stride[1],
  170|  1.86k|                           src[2] - offset_uv * PXSTRIDE(src_stride[1]),
  171|  1.86k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  172|  1.86k|                           row_h, w, h, ss_hor, 0);
  173|  12.1k|        }
  174|  12.4k|    }
  175|  2.05M|}
dav1d_loopfilter_sbrow_cols_16bpc:
  315|  3.44M|{
  316|  3.44M|    int x, have_left;
  317|       |    // Don't filter outside the frame
  318|  3.44M|    const int is_sb64 = !f->seq_hdr->sb128;
  319|  3.44M|    const int starty4 = (sby & is_sb64) << 4;
  320|  3.44M|    const int sbsz = 32 >> is_sb64;
  321|  3.44M|    const int sbl2 = 5 - is_sb64;
  322|  3.44M|    const int halign = (f->bh + 31) & ~31;
  323|  3.44M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  324|  3.44M|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  325|  3.44M|    const int vmask = 16 >> ss_ver, hmask = 16 >> ss_hor;
  326|  3.44M|    const unsigned vmax = 1U << vmask, hmax = 1U << hmask;
  327|  3.44M|    const unsigned endy4 = starty4 + imin(f->h4 - sby * sbsz, sbsz);
  328|  3.44M|    const unsigned uv_endy4 = (endy4 + ss_ver) >> ss_ver;
  329|       |
  330|       |    // fix lpf strength at tile col boundaries
  331|  3.44M|    const uint8_t *lpf_y = &f->lf.tx_lpf_right_edge[0][sby << sbl2];
  332|  3.44M|    const uint8_t *lpf_uv = &f->lf.tx_lpf_right_edge[1][sby << (sbl2 - ss_ver)];
  333|  3.76M|    for (int tile_col = 1;; tile_col++) {
  334|  3.76M|        x = f->frame_hdr->tiling.col_start_sb[tile_col];
  335|  3.76M|        if ((x << sbl2) >= f->bw) break;
  ------------------
  |  Branch (335:13): [True: 3.43M, False: 325k]
  ------------------
  336|   325k|        const int bx4 = x & is_sb64 ? 16 : 0, cbx4 = bx4 >> ss_hor;
  ------------------
  |  Branch (336:25): [True: 323k, False: 2.50k]
  ------------------
  337|   325k|        x >>= is_sb64;
  338|       |
  339|   325k|        uint16_t (*const y_hmask)[2] = lflvl[x].filter_y[0][bx4];
  340|  5.54M|        for (unsigned y = starty4, mask = 1 << y; y < endy4; y++, mask <<= 1) {
  ------------------
  |  Branch (340:51): [True: 5.21M, False: 325k]
  ------------------
  341|  5.21M|            const int sidx = mask >= 0x10000U;
  342|  5.21M|            const unsigned smask = mask >> (sidx << 4);
  343|  5.21M|            const int idx = 2 * !!(y_hmask[2][sidx] & smask) +
  344|  5.21M|                                !!(y_hmask[1][sidx] & smask);
  345|  5.21M|            y_hmask[2][sidx] &= ~smask;
  346|  5.21M|            y_hmask[1][sidx] &= ~smask;
  347|  5.21M|            y_hmask[0][sidx] &= ~smask;
  348|  5.21M|            y_hmask[imin(idx, lpf_y[y - starty4])][sidx] |= smask;
  349|  5.21M|        }
  350|       |
  351|   325k|        if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (351:13): [True: 2.88k, False: 322k]
  ------------------
  352|  2.88k|            uint16_t (*const uv_hmask)[2] = lflvl[x].filter_uv[0][cbx4];
  353|  55.6k|            for (unsigned y = starty4 >> ss_ver, uv_mask = 1 << y; y < uv_endy4;
  ------------------
  |  Branch (353:68): [True: 52.7k, False: 2.88k]
  ------------------
  354|  52.7k|                 y++, uv_mask <<= 1)
  355|  52.7k|            {
  356|  52.7k|                const int sidx = uv_mask >= vmax;
  357|  52.7k|                const unsigned smask = uv_mask >> (sidx << (4 - ss_ver));
  358|  52.7k|                const int idx = !!(uv_hmask[1][sidx] & smask);
  359|  52.7k|                uv_hmask[1][sidx] &= ~smask;
  360|  52.7k|                uv_hmask[0][sidx] &= ~smask;
  361|  52.7k|                uv_hmask[imin(idx, lpf_uv[y - (starty4 >> ss_ver)])][sidx] |= smask;
  362|  52.7k|            }
  363|  2.88k|        }
  364|   325k|        lpf_y  += halign;
  365|   325k|        lpf_uv += halign >> ss_ver;
  366|   325k|    }
  367|       |
  368|       |    // fix lpf strength at tile row boundaries
  369|  3.44M|    if (start_of_tile_row) {
  ------------------
  |  Branch (369:9): [True: 1.55k, False: 3.44M]
  ------------------
  370|  1.55k|        const BlockContext *a;
  371|  1.55k|        for (x = 0, a = &f->a[f->sb128w * (start_of_tile_row - 1)];
  372|  5.11k|             x < f->sb128w; x++, a++)
  ------------------
  |  Branch (372:14): [True: 3.56k, False: 1.55k]
  ------------------
  373|  3.56k|        {
  374|  3.56k|            uint16_t (*const y_vmask)[2] = lflvl[x].filter_y[1][starty4];
  375|  3.56k|            const unsigned w = imin(32, f->w4 - (x << 5));
  376|   107k|            for (unsigned mask = 1, i = 0; i < w; mask <<= 1, i++) {
  ------------------
  |  Branch (376:44): [True: 104k, False: 3.56k]
  ------------------
  377|   104k|                const int sidx = mask >= 0x10000U;
  378|   104k|                const unsigned smask = mask >> (sidx << 4);
  379|   104k|                const int idx = 2 * !!(y_vmask[2][sidx] & smask) +
  380|   104k|                                    !!(y_vmask[1][sidx] & smask);
  381|   104k|                y_vmask[2][sidx] &= ~smask;
  382|   104k|                y_vmask[1][sidx] &= ~smask;
  383|   104k|                y_vmask[0][sidx] &= ~smask;
  384|   104k|                y_vmask[imin(idx, a->tx_lpf_y[i])][sidx] |= smask;
  385|   104k|            }
  386|       |
  387|  3.56k|            if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (387:17): [True: 2.04k, False: 1.51k]
  ------------------
  388|  2.04k|                const unsigned cw = (w + ss_hor) >> ss_hor;
  389|  2.04k|                uint16_t (*const uv_vmask)[2] = lflvl[x].filter_uv[1][starty4 >> ss_ver];
  390|  41.1k|                for (unsigned uv_mask = 1, i = 0; i < cw; uv_mask <<= 1, i++) {
  ------------------
  |  Branch (390:51): [True: 39.0k, False: 2.04k]
  ------------------
  391|  39.0k|                    const int sidx = uv_mask >= hmax;
  392|  39.0k|                    const unsigned smask = uv_mask >> (sidx << (4 - ss_hor));
  393|  39.0k|                    const int idx = !!(uv_vmask[1][sidx] & smask);
  394|  39.0k|                    uv_vmask[1][sidx] &= ~smask;
  395|  39.0k|                    uv_vmask[0][sidx] &= ~smask;
  396|  39.0k|                    uv_vmask[imin(idx, a->tx_lpf_uv[i])][sidx] |= smask;
  397|  39.0k|                }
  398|  2.04k|            }
  399|  3.56k|        }
  400|  1.55k|    }
  401|       |
  402|  3.44M|    pixel *ptr;
  403|  3.44M|    uint8_t (*level_ptr)[2] = f->lf.level[0] + f->b4_stride * sby * sbsz;
  404|  6.90M|    for (ptr = p[0], have_left = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (404:44): [True: 3.46M, False: 3.44M]
  ------------------
  405|  3.46M|         x++, have_left = 1, ptr += 128, level_ptr += 32)
  406|  3.46M|    {
  407|  3.46M|        filter_plane_cols_y(f, have_left, level_ptr, f->b4_stride,
  408|  3.46M|                            lflvl[x].filter_y[0], ptr, f->cur.stride[0],
  409|  3.46M|                            imin(32, f->w4 - x * 32), starty4, endy4);
  410|  3.46M|    }
  411|       |
  412|  3.44M|    if (!f->frame_hdr->loopfilter.level_u && !f->frame_hdr->loopfilter.level_v)
  ------------------
  |  Branch (412:9): [True: 3.38M, False: 53.6k]
  |  Branch (412:46): [True: 3.38M, False: 1.54k]
  ------------------
  413|  3.38M|        return;
  414|       |
  415|  55.2k|    ptrdiff_t uv_off;
  416|  55.2k|    level_ptr = f->lf.level[1] + f->b4_stride * (sby * sbsz >> ss_ver);
  417|   126k|    for (uv_off = 0, have_left = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (417:44): [True: 70.9k, False: 55.2k]
  ------------------
  418|  70.9k|         x++, have_left = 1, uv_off += 128 >> ss_hor, level_ptr += 32 >> ss_hor)
  419|  70.9k|    {
  420|  70.9k|        filter_plane_cols_uv(f, have_left, level_ptr, f->b4_stride,
  421|  70.9k|                             lflvl[x].filter_uv[0],
  422|  70.9k|                             &p[1][uv_off], &p[2][uv_off], f->cur.stride[1],
  423|  70.9k|                             (imin(32, f->w4 - x * 32) + ss_hor) >> ss_hor,
  424|  70.9k|                             starty4 >> ss_ver, uv_endy4, ss_ver);
  425|  70.9k|    }
  426|  55.2k|}
dav1d_loopfilter_sbrow_rows_16bpc:
  431|  3.44M|{
  432|  3.44M|    int x;
  433|       |    // Don't filter outside the frame
  434|  3.44M|    const int have_top = sby > 0;
  435|  3.44M|    const int is_sb64 = !f->seq_hdr->sb128;
  436|  3.44M|    const int starty4 = (sby & is_sb64) << 4;
  437|  3.44M|    const int sbsz = 32 >> is_sb64;
  438|  3.44M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  439|  3.44M|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  440|  3.44M|    const unsigned endy4 = starty4 + imin(f->h4 - sby * sbsz, sbsz);
  441|  3.44M|    const unsigned uv_endy4 = (endy4 + ss_ver) >> ss_ver;
  442|       |
  443|  3.44M|    pixel *ptr;
  444|  3.44M|    uint8_t (*level_ptr)[2] = f->lf.level[0] + f->b4_stride * sby * sbsz;
  445|  6.90M|    for (ptr = p[0], x = 0; x < f->sb128w; x++, ptr += 128, level_ptr += 32) {
  ------------------
  |  Branch (445:29): [True: 3.46M, False: 3.44M]
  ------------------
  446|  3.46M|        filter_plane_rows_y(f, have_top, level_ptr, f->b4_stride,
  447|  3.46M|                            lflvl[x].filter_y[1], ptr, f->cur.stride[0],
  448|  3.46M|                            imin(32, f->w4 - x * 32), starty4, endy4);
  449|  3.46M|    }
  450|       |
  451|  3.44M|    if (!f->frame_hdr->loopfilter.level_u && !f->frame_hdr->loopfilter.level_v)
  ------------------
  |  Branch (451:9): [True: 3.38M, False: 54.0k]
  |  Branch (451:46): [True: 3.38M, False: 1.84k]
  ------------------
  452|  3.38M|        return;
  453|       |
  454|  55.9k|    ptrdiff_t uv_off;
  455|  55.9k|    level_ptr = f->lf.level[1] + f->b4_stride * (sby * sbsz >> ss_ver);
  456|   126k|    for (uv_off = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (456:29): [True: 70.9k, False: 55.9k]
  ------------------
  457|  70.9k|         x++, uv_off += 128 >> ss_hor, level_ptr += 32 >> ss_hor)
  458|  70.9k|    {
  459|  70.9k|        filter_plane_rows_uv(f, have_top, level_ptr, f->b4_stride,
  460|  70.9k|                             lflvl[x].filter_uv[1],
  461|  70.9k|                             &p[1][uv_off], &p[2][uv_off], f->cur.stride[1],
  462|  70.9k|                             (imin(32, f->w4 - x * 32) + ss_hor) >> ss_hor,
  463|  70.9k|                             starty4 >> ss_ver, uv_endy4, ss_hor);
  464|  70.9k|    }
  465|  55.9k|}

dav1d_create_lf_mask_intra:
  298|  1.34M|{
  299|  1.34M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  300|  1.34M|    const int bw4 = imin(iw - bx, b_dim[0]);
  301|  1.34M|    const int bh4 = imin(ih - by, b_dim[1]);
  302|  1.34M|    const int bx4 = bx & 31;
  303|  1.34M|    const int by4 = by & 31;
  304|  1.34M|    assert(bw4 >= 0 && bh4 >= 0);
  ------------------
  |  Branch (304:5): [True: 1.34M, False: 1.06k]
  |  Branch (304:5): [True: 1.34M, False: 18.4E]
  ------------------
  305|       |
  306|  1.34M|    if (bw4 && bh4) {
  ------------------
  |  Branch (306:9): [True: 1.33M, False: 7.58k]
  |  Branch (306:16): [True: 1.27M, False: 60.2k]
  ------------------
  307|  1.27M|        uint8_t (*level_cache_ptr)[2] = level_cache[0] + by * b4_stride + bx;
  308|       |
  309|  1.27M|        dsp->fill_levelcache_block(level_cache_ptr, b4_stride, bw4, bh4,
  310|  1.27M|                                   filter_level[0][0][0], filter_level[1][0][0]);
  311|  1.27M|        mask_edges_intra(lflvl->filter_y, by4, bx4, bw4, bh4, ytx, ay, ly);
  312|  1.27M|    }
  313|       |
  314|  1.34M|    if (!auv) return;
  ------------------
  |  Branch (314:9): [True: 367k, False: 976k]
  ------------------
  315|       |
  316|   976k|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
  317|   976k|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
  318|   976k|    const int cbw4 = imin(((iw + ss_hor) >> ss_hor) - (bx >> ss_hor),
  319|   976k|                          (b_dim[0] + ss_hor) >> ss_hor);
  320|   976k|    const int cbh4 = imin(((ih + ss_ver) >> ss_ver) - (by >> ss_ver),
  321|   976k|                          (b_dim[1] + ss_ver) >> ss_ver);
  322|   976k|    assert(cbw4 >= 0 && cbh4 >= 0);
  ------------------
  |  Branch (322:5): [True: 989k, False: 18.4E]
  |  Branch (322:5): [True: 989k, False: 18.4E]
  ------------------
  323|       |
  324|   989k|    if (!cbw4 || !cbh4) return;
  ------------------
  |  Branch (324:9): [True: 5.62k, False: 983k]
  |  Branch (324:18): [True: 20.8k, False: 963k]
  ------------------
  325|       |
  326|   962k|    const int cbx4 = bx4 >> ss_hor;
  327|   962k|    const int cby4 = by4 >> ss_ver;
  328|       |
  329|   962k|    uint8_t (*level_cache_ptr)[2] =
  330|   962k|        level_cache[1] + (by >> ss_ver) * b4_stride + (bx >> ss_hor);
  331|       |
  332|   962k|    dsp->fill_levelcache_block(level_cache_ptr, b4_stride, cbw4, cbh4,
  333|   962k|                               filter_level[2][0][0], filter_level[3][0][0]);
  334|   962k|    mask_edges_chroma(lflvl->filter_uv, cby4, cbx4, cbw4, cbh4, 0, uvtx,
  335|   962k|                      auv, luv, ss_hor, ss_ver);
  336|   962k|}
dav1d_create_lf_mask_inter:
  350|  6.05M|{
  351|  6.05M|    const Dav1dLfMaskDSPContext *const dsp = &t->c->lf_mask_dsp;
  352|  6.05M|    Av1Filter *const lflvl = t->lf_mask;
  353|  6.05M|    const int bx = t->bx, by = t->by;
  354|  6.05M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  355|  6.05M|    const int bw4 = imin(iw - bx, b_dim[0]);
  356|  6.05M|    const int bh4 = imin(ih - by, b_dim[1]);
  357|  6.05M|    const int bx4 = bx & 31;
  358|  6.05M|    const int by4 = by & 31;
  359|  6.05M|    assert(bw4 >= 0 && bh4 >= 0);
  ------------------
  |  Branch (359:5): [True: 6.05M, False: 698]
  |  Branch (359:5): [True: 6.05M, False: 18.4E]
  ------------------
  360|       |
  361|  6.05M|    if (bw4 && bh4) {
  ------------------
  |  Branch (361:9): [True: 6.04M, False: 9.84k]
  |  Branch (361:16): [True: 6.03M, False: 7.91k]
  ------------------
  362|  6.03M|        uint8_t (*level_cache_ptr)[2] = level_cache[0] + by * b4_stride + bx;
  363|       |
  364|  6.03M|        dsp->fill_levelcache_block(level_cache_ptr, b4_stride, bw4, bh4,
  365|  6.03M|                                   filter_level[0][0][0], filter_level[1][0][0]);
  366|       |
  367|  6.03M|        const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[max_ytx];
  368|  6.03M|        uint8_t (*const txa)[2][32][32] = t->scratch.txa;
  369|  15.6M|        for (int y_off = 0, y = 0; y < bh4; y += t_dim->h, y_off++)
  ------------------
  |  Branch (369:36): [True: 9.61M, False: 6.03M]
  ------------------
  370|  31.4M|            for (int x_off = 0, x = 0; x < bw4; x += t_dim->w, x_off++)
  ------------------
  |  Branch (370:40): [True: 21.8M, False: 9.61M]
  ------------------
  371|  21.8M|                decomp_tx((uint8_t(*)[2][32][32]) &txa[0][0][y][x],
  372|  21.8M|                          max_ytx, 0, y_off, x_off, tx_masks);
  373|       |
  374|  6.03M|        dsp->mask_edges_inter_outer(ay, ly, by4, bx4, bw4, bh4, lflvl->filter_y, txa);
  375|  6.03M|        if (!skip)
  ------------------
  |  Branch (375:13): [True: 1.03M, False: 5.00M]
  ------------------
  376|  1.03M|            mask_edges_inter_inner(by4, bx4, bw4, bh4, lflvl->filter_y, txa);
  377|  6.03M|    }
  378|       |
  379|  6.05M|    if (!auv) return;
  ------------------
  |  Branch (379:9): [True: 5.00M, False: 1.04M]
  ------------------
  380|       |
  381|  1.04M|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
  382|  1.04M|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
  383|  1.04M|    const int cbw4 = imin(((iw + ss_hor) >> ss_hor) - (bx >> ss_hor),
  384|  1.04M|                          (b_dim[0] + ss_hor) >> ss_hor);
  385|  1.04M|    const int cbh4 = imin(((ih + ss_ver) >> ss_ver) - (by >> ss_ver),
  386|  1.04M|                          (b_dim[1] + ss_ver) >> ss_ver);
  387|  1.04M|    assert(cbw4 >= 0 && cbh4 >= 0);
  ------------------
  |  Branch (387:5): [True: 1.11M, False: 18.4E]
  |  Branch (387:5): [True: 1.11M, False: 18.4E]
  ------------------
  388|       |
  389|  1.11M|    if (!cbw4 || !cbh4) return;
  ------------------
  |  Branch (389:9): [True: 674, False: 1.11M]
  |  Branch (389:18): [True: 1.88k, False: 1.11M]
  ------------------
  390|       |
  391|  1.11M|    const int cbx4 = bx4 >> ss_hor;
  392|  1.11M|    const int cby4 = by4 >> ss_ver;
  393|       |
  394|  1.11M|    uint8_t (*level_cache_ptr)[2] =
  395|  1.11M|        level_cache[1] + (by >> ss_ver) * b4_stride + (bx >> ss_hor);
  396|       |
  397|  1.11M|    dsp->fill_levelcache_block(level_cache_ptr, b4_stride, cbw4, cbh4,
  398|  1.11M|                               filter_level[2][0][0], filter_level[3][0][0]);
  399|  1.11M|    mask_edges_chroma(lflvl->filter_uv, cby4, cbx4, cbw4, cbh4, skip, uvtx,
  400|  1.11M|                      auv, luv, ss_hor, ss_ver);
  401|  1.11M|}
dav1d_calc_eih:
  403|  40.3k|void dav1d_calc_eih(Av1FilterLUT *const lim_lut, const int filter_sharpness) {
  404|       |    // set E/I/H values from loopfilter level
  405|  40.3k|    const int sharp = filter_sharpness;
  406|  2.61M|    for (int level = 0; level < 64; level++) {
  ------------------
  |  Branch (406:25): [True: 2.57M, False: 40.3k]
  ------------------
  407|  2.57M|        int limit = level;
  408|       |
  409|  2.57M|        if (sharp > 0) {
  ------------------
  |  Branch (409:13): [True: 1.35M, False: 1.21M]
  ------------------
  410|  1.35M|            limit >>= (sharp + 3) >> 2;
  411|  1.35M|            limit = imin(limit, 9 - sharp);
  412|  1.35M|        }
  413|  2.57M|        limit = imax(limit, 1);
  414|       |
  415|  2.57M|        lim_lut->i[level] = limit;
  416|  2.57M|        lim_lut->e[level] = 2 * (level + 2) + limit;
  417|  2.57M|    }
  418|  40.3k|    lim_lut->sharp[0] = (sharp + 3) >> 2;
  419|  40.3k|    lim_lut->sharp[1] = sharp ? 9 - sharp : 0xff;
  ------------------
  |  Branch (419:25): [True: 21.2k, False: 19.0k]
  ------------------
  420|  40.3k|}
dav1d_calc_lf_values:
  459|   236k|{
  460|   236k|    const int n_seg = hdr->segmentation.enabled ? 8 : 1;
  ------------------
  |  Branch (460:23): [True: 36.7k, False: 199k]
  ------------------
  461|       |
  462|   236k|    if (!hdr->loopfilter.level_y[0] && !hdr->loopfilter.level_y[1]) {
  ------------------
  |  Branch (462:9): [True: 137k, False: 98.6k]
  |  Branch (462:40): [True: 127k, False: 9.78k]
  ------------------
  463|   127k|        memset(lflvl_values, 0, sizeof(*lflvl_values) * n_seg);
  464|   127k|        return;
  465|   127k|    }
  466|       |
  467|   108k|    const Dav1dLoopfilterModeRefDeltas *const mr_deltas =
  468|   108k|        hdr->loopfilter.mode_ref_delta_enabled ?
  ------------------
  |  Branch (468:9): [True: 70.7k, False: 37.7k]
  ------------------
  469|   108k|        &hdr->loopfilter.mode_ref_deltas : NULL;
  470|   447k|    for (int s = 0; s < n_seg; s++) {
  ------------------
  |  Branch (470:21): [True: 338k, False: 108k]
  ------------------
  471|   338k|        const Dav1dSegmentationData *const segd =
  472|   338k|            hdr->segmentation.enabled ? &hdr->segmentation.seg_data.d[s] : NULL;
  ------------------
  |  Branch (472:13): [True: 263k, False: 75.2k]
  ------------------
  473|       |
  474|   338k|        calc_lf_value(lflvl_values[s][0], hdr->loopfilter.level_y[0],
  475|   338k|                      lf_delta[0], segd ? segd->delta_lf_y_v : 0, mr_deltas);
  ------------------
  |  Branch (475:36): [True: 263k, False: 75.2k]
  ------------------
  476|   338k|        calc_lf_value(lflvl_values[s][1], hdr->loopfilter.level_y[1],
  477|   338k|                      lf_delta[hdr->delta.lf.multi ? 1 : 0],
  ------------------
  |  Branch (477:32): [True: 107k, False: 231k]
  ------------------
  478|   338k|                      segd ? segd->delta_lf_y_h : 0, mr_deltas);
  ------------------
  |  Branch (478:23): [True: 263k, False: 75.6k]
  ------------------
  479|   338k|        calc_lf_value_chroma(lflvl_values[s][2], hdr->loopfilter.level_u,
  480|   338k|                             lf_delta[hdr->delta.lf.multi ? 2 : 0],
  ------------------
  |  Branch (480:39): [True: 107k, False: 231k]
  ------------------
  481|   338k|                             segd ? segd->delta_lf_u : 0, mr_deltas);
  ------------------
  |  Branch (481:30): [True: 263k, False: 75.5k]
  ------------------
  482|   338k|        calc_lf_value_chroma(lflvl_values[s][3], hdr->loopfilter.level_v,
  483|   338k|                             lf_delta[hdr->delta.lf.multi ? 3 : 0],
  ------------------
  |  Branch (483:39): [True: 106k, False: 231k]
  ------------------
  484|   338k|                             segd ? segd->delta_lf_v : 0, mr_deltas);
  ------------------
  |  Branch (484:30): [True: 263k, False: 75.5k]
  ------------------
  485|   338k|    }
  486|   108k|}
dav1d_lf_mask_dsp_init:
  489|  15.1k|{
  490|  15.1k|    c->fill_levelcache_block = fill_levelcache_block_c;
  491|  15.1k|    c->mask_edges_inter_outer = mask_edges_inter_outer_c;
  492|  15.1k|#if HAVE_ASM
  493|  15.1k|#if ARCH_X86_64
  494|  15.1k|    lf_mask_dsp_init_x86(c);
  495|       |#elif ARCH_AARCH64
  496|       |    lf_mask_dsp_init_arm(c);
  497|       |#endif
  498|  15.1k|#endif
  499|  15.1k|}
lf_mask.c:mask_edges_intra:
  161|  1.28M|{
  162|  1.28M|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[tx];
  163|  1.28M|    const int twl4 = t_dim->lw, thl4 = t_dim->lh;
  164|  1.28M|    const int twl4c = imin(2, twl4), thl4c = imin(2, thl4);
  165|  1.28M|    int y, x;
  166|       |
  167|       |    // left block edge
  168|  1.28M|    unsigned mask = 1U << by4;
  169|  7.57M|    for (y = 0; y < h4; y++, mask <<= 1) {
  ------------------
  |  Branch (169:17): [True: 6.29M, False: 1.28M]
  ------------------
  170|  6.29M|        const int sidx = mask >= 0x10000;
  171|  6.29M|        const unsigned smask = mask >> (sidx << 4);
  172|  6.29M|        masks[0][bx4][imin(twl4c, l[y])][sidx] |= smask;
  173|  6.29M|    }
  174|       |
  175|       |    // top block edge
  176|  7.78M|    for (x = 0, mask = 1U << bx4; x < w4; x++, mask <<= 1) {
  ------------------
  |  Branch (176:35): [True: 6.50M, False: 1.28M]
  ------------------
  177|  6.50M|        const int sidx = mask >= 0x10000;
  178|  6.50M|        const unsigned smask = mask >> (sidx << 4);
  179|  6.50M|        masks[1][by4][imin(thl4c, a[x])][sidx] |= smask;
  180|  6.50M|    }
  181|       |
  182|       |    // inner (tx) left|right edges
  183|  1.28M|    const int hstep = t_dim->w;
  184|  1.28M|    unsigned t = 1U << by4;
  185|  1.28M|    unsigned inner = (unsigned) ((((uint64_t) t) << h4) - t);
  186|  1.28M|    unsigned inner1 = inner & 0xffff, inner2 = inner >> 16;
  187|  1.64M|    for (x = hstep; x < w4; x += hstep) {
  ------------------
  |  Branch (187:21): [True: 365k, False: 1.28M]
  ------------------
  188|   365k|        if (inner1) masks[0][bx4 + x][twl4c][0] |= inner1;
  ------------------
  |  Branch (188:13): [True: 270k, False: 94.9k]
  ------------------
  189|   365k|        if (inner2) masks[0][bx4 + x][twl4c][1] |= inner2;
  ------------------
  |  Branch (189:13): [True: 201k, False: 163k]
  ------------------
  190|   365k|    }
  191|       |
  192|       |    //            top
  193|       |    // inner (tx) --- edges
  194|       |    //           bottom
  195|  1.28M|    const int vstep = t_dim->h;
  196|  1.28M|    t = 1U << bx4;
  197|  1.28M|    inner = (unsigned) ((((uint64_t) t) << w4) - t);
  198|  1.28M|    inner1 = inner & 0xffff;
  199|  1.28M|    inner2 = inner >> 16;
  200|  1.69M|    for (y = vstep; y < h4; y += vstep) {
  ------------------
  |  Branch (200:21): [True: 416k, False: 1.28M]
  ------------------
  201|   416k|        if (inner1) masks[1][by4 + y][thl4c][0] |= inner1;
  ------------------
  |  Branch (201:13): [True: 305k, False: 110k]
  ------------------
  202|   416k|        if (inner2) masks[1][by4 + y][thl4c][1] |= inner2;
  ------------------
  |  Branch (202:13): [True: 272k, False: 143k]
  ------------------
  203|   416k|    }
  204|       |
  205|  1.28M|    dav1d_memset_likely_pow2(a, thl4c, w4);
  206|  1.28M|    dav1d_memset_likely_pow2(l, twl4c, h4);
  207|  1.28M|}
lf_mask.c:mask_edges_chroma:
  216|  2.07M|{
  217|  2.07M|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[tx];
  218|  2.07M|    const int twl4 = t_dim->lw, thl4 = t_dim->lh;
  219|  2.07M|    const int twl4c = !!twl4, thl4c = !!thl4;
  220|  2.07M|    int y, x;
  221|  2.07M|    const int vbits = 4 - ss_ver, hbits = 4 - ss_hor;
  222|  2.07M|    const int vmask = 16 >> ss_ver, hmask = 16 >> ss_hor;
  223|  2.07M|    const unsigned vmax = 1 << vmask, hmax = 1 << hmask;
  224|       |
  225|       |    // left block edge
  226|  2.07M|    unsigned mask = 1U << cby4;
  227|  9.35M|    for (y = 0; y < ch4; y++, mask <<= 1) {
  ------------------
  |  Branch (227:17): [True: 7.28M, False: 2.07M]
  ------------------
  228|  7.28M|        const int sidx = mask >= vmax;
  229|  7.28M|        const unsigned smask = mask >> (sidx << vbits);
  230|  7.28M|        masks[0][cbx4][imin(twl4c, l[y])][sidx] |= smask;
  231|  7.28M|    }
  232|       |
  233|       |    // top block edge
  234|  8.89M|    for (x = 0, mask = 1U << cbx4; x < cw4; x++, mask <<= 1) {
  ------------------
  |  Branch (234:36): [True: 6.82M, False: 2.07M]
  ------------------
  235|  6.82M|        const int sidx = mask >= hmax;
  236|  6.82M|        const unsigned smask = mask >> (sidx << hbits);
  237|  6.82M|        masks[1][cby4][imin(thl4c, a[x])][sidx] |= smask;
  238|  6.82M|    }
  239|       |
  240|  2.07M|    if (!skip_inter) {
  ------------------
  |  Branch (240:9): [True: 1.50M, False: 566k]
  ------------------
  241|       |        // inner (tx) left|right edges
  242|  1.50M|        const int hstep = t_dim->w;
  243|  1.50M|        unsigned t = 1U << cby4;
  244|  1.50M|        unsigned inner = (unsigned) ((((uint64_t) t) << ch4) - t);
  245|  1.50M|        unsigned inner1 = inner & ((1 << vmask) - 1), inner2 = inner >> vmask;
  246|  1.63M|        for (x = hstep; x < cw4; x += hstep) {
  ------------------
  |  Branch (246:25): [True: 133k, False: 1.50M]
  ------------------
  247|   133k|            if (inner1) masks[0][cbx4 + x][twl4c][0] |= inner1;
  ------------------
  |  Branch (247:17): [True: 113k, False: 20.2k]
  ------------------
  248|   133k|            if (inner2) masks[0][cbx4 + x][twl4c][1] |= inner2;
  ------------------
  |  Branch (248:17): [True: 99.8k, False: 33.8k]
  ------------------
  249|   133k|        }
  250|       |
  251|       |        //            top
  252|       |        // inner (tx) --- edges
  253|       |        //           bottom
  254|  1.50M|        const int vstep = t_dim->h;
  255|  1.50M|        t = 1U << cbx4;
  256|  1.50M|        inner = (unsigned) ((((uint64_t) t) << cw4) - t);
  257|  1.50M|        inner1 = inner & ((1 << hmask) - 1), inner2 = inner >> hmask;
  258|  1.76M|        for (y = vstep; y < ch4; y += vstep) {
  ------------------
  |  Branch (258:25): [True: 257k, False: 1.50M]
  ------------------
  259|   257k|            if (inner1) masks[1][cby4 + y][thl4c][0] |= inner1;
  ------------------
  |  Branch (259:17): [True: 222k, False: 34.3k]
  ------------------
  260|   257k|            if (inner2) masks[1][cby4 + y][thl4c][1] |= inner2;
  ------------------
  |  Branch (260:17): [True: 209k, False: 47.9k]
  ------------------
  261|   257k|        }
  262|  1.50M|    }
  263|       |
  264|  2.07M|    dav1d_memset_likely_pow2(a, thl4c, cw4);
  265|  2.07M|    dav1d_memset_likely_pow2(l, twl4c, ch4);
  266|  2.07M|}
lf_mask.c:decomp_tx:
   53|  22.4M|{
   54|  22.4M|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[from];
   55|  22.4M|    const int is_split = (from == (int) TX_4X4 || depth > 1) ? 0 :
  ------------------
  |  Branch (55:27): [True: 6.97M, False: 15.5M]
  |  Branch (55:51): [True: 140k, False: 15.3M]
  ------------------
   56|  22.4M|        (tx_masks[depth] >> (y_off * 4 + x_off)) & 1;
   57|       |
   58|  22.4M|    if (is_split) {
  ------------------
  |  Branch (58:9): [True: 199k, False: 22.2M]
  ------------------
   59|   199k|        const enum RectTxfmSize sub = t_dim->sub;
   60|   199k|        const int htw4 = t_dim->w >> 1, hth4 = t_dim->h >> 1;
   61|       |
   62|   199k|        decomp_tx(txa, sub, depth + 1, y_off * 2 + 0, x_off * 2 + 0, tx_masks);
   63|   199k|        if (t_dim->w >= t_dim->h)
  ------------------
  |  Branch (63:13): [True: 160k, False: 38.7k]
  ------------------
   64|   160k|            decomp_tx((uint8_t(*)[2][32][32]) &txa[0][0][0][htw4],
   65|   160k|                      sub, depth + 1, y_off * 2 + 0, x_off * 2 + 1, tx_masks);
   66|   199k|        if (t_dim->h >= t_dim->w) {
  ------------------
  |  Branch (66:13): [True: 138k, False: 60.2k]
  ------------------
   67|   138k|            decomp_tx((uint8_t(*)[2][32][32]) &txa[0][0][hth4][0],
   68|   138k|                      sub, depth + 1, y_off * 2 + 1, x_off * 2 + 0, tx_masks);
   69|   138k|            if (t_dim->w >= t_dim->h)
  ------------------
  |  Branch (69:17): [True: 99.9k, False: 38.7k]
  ------------------
   70|  99.9k|                decomp_tx((uint8_t(*)[2][32][32]) &txa[0][0][hth4][htw4],
   71|  99.9k|                          sub, depth + 1, y_off * 2 + 1, x_off * 2 + 1, tx_masks);
   72|   138k|        }
   73|  22.2M|    } else {
   74|  22.2M|        const int lw = imin(2, t_dim->lw), lh = imin(2, t_dim->lh);
   75|       |
   76|  22.2M|#define set_ctx(rep_macro) \
   77|  22.2M|        for (int y = 0; y < t_dim->h; y++) { \
   78|  22.2M|            rep_macro(txa[0][0][y], 0, lw); \
   79|  22.2M|            rep_macro(txa[1][0][y], 0, lh); \
   80|  22.2M|            txa[0][1][y][0] = t_dim->w; \
   81|  22.2M|        } \
   82|  22.2M|        rep_macro(txa[1][1][0], 0, t_dim->h);
   83|  22.3M|        case_set_upto16(t_dim->lw);
  ------------------
  |  |   80|  22.2M|    switch (var) { \
  |  |   81|  7.13M|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  |   77|  14.5M|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:25): [True: 7.40M, False: 7.13M]
  |  |  |  |  ------------------
  |  |  |  |   78|  7.40M|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  7.40M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  7.40M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   79|  7.40M|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  7.40M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  7.40M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   80|  7.40M|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   81|  7.40M|        } \
  |  |  |  |   82|  7.13M|        rep_macro(txa[1][1][0], 0, t_dim->h);
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  7.13M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  7.13M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:5): [True: 7.13M, False: 15.1M]
  |  |  ------------------
  |  |   82|   806k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  |   77|  2.75M|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:25): [True: 1.94M, False: 806k]
  |  |  |  |  ------------------
  |  |  |  |   78|  1.94M|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  1.94M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.94M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   79|  1.94M|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  1.94M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.94M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   80|  1.94M|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   81|  1.94M|        } \
  |  |  |  |   82|   806k|        rep_macro(txa[1][1][0], 0, t_dim->h);
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|   806k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   806k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (82:5): [True: 806k, False: 21.4M]
  |  |  ------------------
  |  |   83|   678k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  |   77|  3.60M|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:25): [True: 2.93M, False: 678k]
  |  |  |  |  ------------------
  |  |  |  |   78|  2.93M|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.93M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  2.93M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   79|  2.93M|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.93M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  2.93M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   80|  2.93M|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   81|  2.93M|        } \
  |  |  |  |   82|   678k|        rep_macro(txa[1][1][0], 0, t_dim->h);
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|   678k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   678k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (83:5): [True: 678k, False: 21.6M]
  |  |  ------------------
  |  |   84|   206k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  |   77|  1.38M|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:25): [True: 1.17M, False: 206k]
  |  |  |  |  ------------------
  |  |  |  |   78|  1.17M|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  1.17M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  1.17M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   79|  1.17M|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  1.17M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  1.17M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   80|  1.17M|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   81|  1.17M|        } \
  |  |  |  |   82|   206k|        rep_macro(txa[1][1][0], 0, t_dim->h);
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|   206k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   206k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (84:5): [True: 206k, False: 22.0M]
  |  |  ------------------
  |  |   85|  13.4M|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  |   77|   228M|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:25): [True: 214M, False: 13.4M]
  |  |  |  |  ------------------
  |  |  |  |   78|   214M|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|   214M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   214M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   214M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   214M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 214M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   79|   214M|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|   214M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   214M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   214M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   214M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 214M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   80|   214M|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   81|   214M|        } \
  |  |  |  |   82|  13.4M|        rep_macro(txa[1][1][0], 0, t_dim->h);
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  13.4M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  13.4M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  13.4M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  13.4M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 13.4M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (85:5): [True: 13.4M, False: 8.79M]
  |  |  ------------------
  |  |   86|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (86:5): [True: 0, False: 22.2M]
  |  |  ------------------
  |  |   87|  22.2M|    }
  ------------------
  |  Branch (83:9): [Folded, False: 0]
  ------------------
   84|  22.3M|#undef set_ctx
   85|  22.3M|    }
   86|  22.4M|}
lf_mask.c:mask_edges_inter_inner:
   93|  1.03M|{
   94|  1.03M|    unsigned mask;
   95|  1.03M|    int x, y;
   96|       |    // inner (tx) left|right edges
   97|  4.97M|    for (y = 0, mask = 1U << by4; y < h4; y++, mask <<= 1) {
  ------------------
  |  Branch (97:35): [True: 3.93M, False: 1.03M]
  ------------------
   98|  3.93M|        const int sidx = mask >= 0x10000U;
   99|  3.93M|        const unsigned smask = mask >> (sidx << 4);
  100|  3.93M|        int ltx = txa[0][0][y][0];
  101|  3.93M|        int step = txa[0][1][y][0];
  102|  4.82M|        for (x = step; x < w4; x += step) {
  ------------------
  |  Branch (102:24): [True: 890k, False: 3.93M]
  ------------------
  103|   890k|            const int rtx = txa[0][0][y][x];
  104|   890k|            masks[0][bx4 + x][imin(rtx, ltx)][sidx] |= smask;
  105|   890k|            ltx = rtx;
  106|   890k|            step = txa[0][1][y][x];
  107|   890k|        }
  108|  3.93M|    }
  109|       |
  110|       |    //            top
  111|       |    // inner (tx) --- edges
  112|       |    //           bottom
  113|  5.44M|    for (x = 0, mask = 1U << bx4; x < w4; x++, mask <<= 1) {
  ------------------
  |  Branch (113:35): [True: 4.40M, False: 1.03M]
  ------------------
  114|  4.40M|        const int sidx = mask >= 0x10000U;
  115|  4.40M|        const unsigned smask = mask >> (sidx << 4);
  116|  4.40M|        int ttx = txa[1][0][0][x];
  117|  4.40M|        int step = txa[1][1][0][x];
  118|  5.23M|        for (y = step; y < h4; y += step) {
  ------------------
  |  Branch (118:24): [True: 832k, False: 4.40M]
  ------------------
  119|   832k|            const int btx = txa[1][0][y][x];
  120|   832k|            masks[1][by4 + y][imin(ttx, btx)][sidx] |= smask;
  121|   832k|            ttx = btx;
  122|   832k|            step = txa[1][1][y][x];
  123|   832k|        }
  124|  4.40M|    }
  125|  1.03M|}
lf_mask.c:calc_lf_value:
  426|   848k|{
  427|   848k|    const int base = iclip(iclip(base_lvl + lf_delta, 0, 63) + seg_delta, 0, 63);
  428|       |
  429|   848k|    if (!mr_delta) {
  ------------------
  |  Branch (429:9): [True: 324k, False: 523k]
  ------------------
  430|   324k|        memset(lflvl_values, base, sizeof(*lflvl_values) * 8);
  431|   523k|    } else {
  432|   523k|        const int sh = base >= 32;
  433|   523k|        lflvl_values[0][0] = lflvl_values[0][1] =
  434|   523k|            iclip(base + (mr_delta->ref_delta[0] * (1 << sh)), 0, 63);
  435|  4.19M|        for (int r = 1; r < 8; r++) {
  ------------------
  |  Branch (435:25): [True: 3.66M, False: 523k]
  ------------------
  436|  10.9M|            for (int m = 0; m < 2; m++) {
  ------------------
  |  Branch (436:29): [True: 7.33M, False: 3.66M]
  ------------------
  437|  7.33M|                const int delta =
  438|  7.33M|                    mr_delta->mode_delta[m] + mr_delta->ref_delta[r];
  439|  7.33M|                lflvl_values[r][m] = iclip(base + (delta * (1 << sh)), 0, 63);
  440|  7.33M|            }
  441|  3.66M|        }
  442|   523k|    }
  443|   848k|}
lf_mask.c:calc_lf_value_chroma:
  449|   676k|{
  450|   676k|    if (!base_lvl)
  ------------------
  |  Branch (450:9): [True: 502k, False: 173k]
  ------------------
  451|   502k|        memset(lflvl_values, 0, sizeof(*lflvl_values) * 8);
  452|   173k|    else
  453|   173k|        calc_lf_value(lflvl_values, base_lvl, lf_delta, seg_delta, mr_delta);
  454|   676k|}

dav1d_version:
   61|  15.1k|COLD const char *dav1d_version(void) {
   62|  15.1k|    return DAV1D_VERSION;
  ------------------
  |  |    2|  15.1k|#define DAV1D_VERSION "ed06ba3"
  ------------------
   63|  15.1k|}
dav1d_default_settings:
   71|  15.1k|COLD void dav1d_default_settings(Dav1dSettings *const s) {
   72|  15.1k|    s->n_threads = 0;
   73|  15.1k|    s->max_frame_delay = 0;
   74|  15.1k|    s->apply_grain = 1;
   75|  15.1k|    s->allocator.cookie = NULL;
   76|  15.1k|    s->allocator.alloc_picture_callback = dav1d_default_picture_alloc;
   77|  15.1k|    s->allocator.release_picture_callback = dav1d_default_picture_release;
   78|  15.1k|    s->logger.cookie = NULL;
   79|       |    s->logger.callback = dav1d_log_default_callback;
  ------------------
  |  |   43|  15.1k|#define dav1d_log_default_callback NULL
  ------------------
   80|  15.1k|    s->operating_point = 0;
   81|  15.1k|    s->all_layers = 1; // just until the tests are adjusted
   82|  15.1k|    s->frame_size_limit = 0;
   83|  15.1k|    s->strict_std_compliance = 0;
   84|  15.1k|    s->output_invisible_frames = 0;
   85|  15.1k|    s->inloop_filters = DAV1D_INLOOPFILTER_ALL;
   86|  15.1k|    s->decode_frame_type = DAV1D_DECODEFRAMETYPE_ALL;
   87|  15.1k|}
dav1d_open:
  140|  15.1k|COLD int dav1d_open(Dav1dContext **const c_out, const Dav1dSettings *const s) {
  141|  15.1k|    static pthread_once_t initted = PTHREAD_ONCE_INIT;
  142|  15.1k|    pthread_once(&initted, init_internal);
  143|       |
  144|  15.1k|    validate_input_or_ret(c_out != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  15.1k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 15.1k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  145|  15.1k|    validate_input_or_ret(s != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  15.1k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 15.1k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  146|  15.1k|    validate_input_or_ret(s->n_threads >= 0 &&
  ------------------
  |  |   52|  30.2k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 15.1k, False: 0]
  |  |  |  Branch (52:11): [True: 15.1k, False: 0]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  147|  15.1k|                          s->n_threads <= DAV1D_MAX_THREADS, DAV1D_ERR(EINVAL));
  148|  15.1k|    validate_input_or_ret(s->max_frame_delay >= 0 &&
  ------------------
  |  |   52|  30.2k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 15.1k, False: 0]
  |  |  |  Branch (52:11): [True: 15.1k, False: 0]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  149|  15.1k|                          s->max_frame_delay <= DAV1D_MAX_FRAME_DELAY, DAV1D_ERR(EINVAL));
  150|  15.1k|    validate_input_or_ret(s->allocator.alloc_picture_callback != NULL,
  ------------------
  |  |   52|  15.1k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 15.1k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  151|  15.1k|                          DAV1D_ERR(EINVAL));
  152|  15.1k|    validate_input_or_ret(s->allocator.release_picture_callback != NULL,
  ------------------
  |  |   52|  15.1k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 15.1k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  153|  15.1k|                          DAV1D_ERR(EINVAL));
  154|  15.1k|    validate_input_or_ret(s->operating_point >= 0 &&
  ------------------
  |  |   52|  30.2k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 15.1k, False: 0]
  |  |  |  Branch (52:11): [True: 15.1k, False: 0]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  155|  15.1k|                          s->operating_point <= 31, DAV1D_ERR(EINVAL));
  156|  15.1k|    validate_input_or_ret(s->decode_frame_type >= DAV1D_DECODEFRAMETYPE_ALL &&
  ------------------
  |  |   52|  30.2k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 15.1k, False: 0]
  |  |  |  Branch (52:11): [True: 15.1k, False: 0]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  157|  15.1k|                          s->decode_frame_type <= DAV1D_DECODEFRAMETYPE_KEY, DAV1D_ERR(EINVAL));
  158|       |
  159|  15.1k|    pthread_attr_t thread_attr;
  160|  15.1k|    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: 15.1k]
  ------------------
  161|  15.1k|    size_t stack_size = 1024 * 1024 + get_stack_size_internal(&thread_attr);
  162|       |
  163|  15.1k|    pthread_attr_setstacksize(&thread_attr, stack_size);
  164|       |
  165|  15.1k|    Dav1dContext *const c = *c_out = dav1d_alloc_aligned(ALLOC_COMMON_CTX, sizeof(*c), 64);
  ------------------
  |  |  134|  15.1k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
  166|  15.1k|    if (!c) goto error;
  ------------------
  |  Branch (166:9): [True: 0, False: 15.1k]
  ------------------
  167|  15.1k|    memset(c, 0, sizeof(*c));
  168|       |
  169|  15.1k|    c->allocator = s->allocator;
  170|  15.1k|    c->logger = s->logger;
  171|  15.1k|    c->apply_grain = s->apply_grain;
  172|  15.1k|    c->operating_point = s->operating_point;
  173|  15.1k|    c->all_layers = s->all_layers;
  174|  15.1k|    c->frame_size_limit = s->frame_size_limit;
  175|  15.1k|    c->strict_std_compliance = s->strict_std_compliance;
  176|  15.1k|    c->output_invisible_frames = s->output_invisible_frames;
  177|  15.1k|    c->inloop_filters = s->inloop_filters;
  178|  15.1k|    c->decode_frame_type = s->decode_frame_type;
  179|       |
  180|  15.1k|    dav1d_data_props_set_defaults(&c->cached_error_props);
  181|       |
  182|  15.1k|    if (dav1d_mem_pool_init(ALLOC_OBU_HDR, &c->seq_hdr_pool) ||
  ------------------
  |  |  131|  30.2k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 15.1k]
  |  |  ------------------
  ------------------
  183|  15.1k|        dav1d_mem_pool_init(ALLOC_OBU_HDR, &c->frame_hdr_pool) ||
  ------------------
  |  |  131|  30.2k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 15.1k]
  |  |  ------------------
  ------------------
  184|  15.1k|        dav1d_mem_pool_init(ALLOC_SEGMAP, &c->segmap_pool) ||
  ------------------
  |  |  131|  30.2k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 15.1k]
  |  |  ------------------
  ------------------
  185|  15.1k|        dav1d_mem_pool_init(ALLOC_REFMVS, &c->refmvs_pool) ||
  ------------------
  |  |  131|  30.2k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 15.1k]
  |  |  ------------------
  ------------------
  186|  15.1k|        dav1d_mem_pool_init(ALLOC_PIC_CTX, &c->pic_ctx_pool) ||
  ------------------
  |  |  131|  30.2k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 15.1k]
  |  |  ------------------
  ------------------
  187|  15.1k|        dav1d_mem_pool_init(ALLOC_CDF, &c->cdf_pool))
  ------------------
  |  |  131|  15.1k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 15.1k]
  |  |  ------------------
  ------------------
  188|      0|    {
  189|      0|        goto error;
  190|      0|    }
  191|       |
  192|  15.1k|    if (c->allocator.alloc_picture_callback   == dav1d_default_picture_alloc &&
  ------------------
  |  Branch (192:9): [True: 15.1k, False: 0]
  ------------------
  193|  15.1k|        c->allocator.release_picture_callback == dav1d_default_picture_release)
  ------------------
  |  Branch (193:9): [True: 15.1k, False: 0]
  ------------------
  194|  15.1k|    {
  195|  15.1k|        if (c->allocator.cookie) goto error;
  ------------------
  |  Branch (195:13): [True: 0, False: 15.1k]
  ------------------
  196|  15.1k|        if (dav1d_mem_pool_init(ALLOC_PIC, &c->picture_pool)) goto error;
  ------------------
  |  |  131|  15.1k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 15.1k]
  |  |  ------------------
  ------------------
  197|  15.1k|        c->allocator.cookie = c->picture_pool;
  198|  15.1k|    } 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|  15.1k|    if (sizeof(size_t) < 8 && s->frame_size_limit - 1 >= 8192 * 8192) {
  ------------------
  |  Branch (208:9): [Folded, False: 15.1k]
  |  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",
  ------------------
  |  |   44|      0|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 0]
  |  |  ------------------
  ------------------
  212|      0|                      s->frame_size_limit, c->frame_size_limit);
  213|      0|    }
  214|       |
  215|  15.1k|    c->flush = &c->flush_mem;
  216|  15.1k|    atomic_init(c->flush, 0);
  217|       |
  218|  15.1k|    get_num_threads(c, s, &c->n_tc, &c->n_fc);
  219|       |
  220|  15.1k|    c->fc = dav1d_alloc_aligned(ALLOC_THREAD_CTX, sizeof(*c->fc) * c->n_fc, 32);
  ------------------
  |  |  134|  15.1k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
  221|  15.1k|    if (!c->fc) goto error;
  ------------------
  |  Branch (221:9): [True: 0, False: 15.1k]
  ------------------
  222|  15.1k|    memset(c->fc, 0, sizeof(*c->fc) * c->n_fc);
  223|       |
  224|  15.1k|    c->tc = dav1d_alloc_aligned(ALLOC_THREAD_CTX, sizeof(*c->tc) * c->n_tc, 64);
  ------------------
  |  |  134|  15.1k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
  225|  15.1k|    if (!c->tc) goto error;
  ------------------
  |  Branch (225:9): [True: 0, False: 15.1k]
  ------------------
  226|  15.1k|    memset(c->tc, 0, sizeof(*c->tc) * c->n_tc);
  227|  15.1k|    if (c->n_tc > 1) {
  ------------------
  |  Branch (227:9): [True: 15.1k, False: 0]
  ------------------
  228|  15.1k|        if (pthread_mutex_init(&c->task_thread.lock, NULL)) goto error;
  ------------------
  |  Branch (228:13): [True: 0, False: 15.1k]
  ------------------
  229|  15.1k|        if (pthread_cond_init(&c->task_thread.cond, NULL)) {
  ------------------
  |  Branch (229:13): [True: 0, False: 15.1k]
  ------------------
  230|      0|            pthread_mutex_destroy(&c->task_thread.lock);
  231|      0|            goto error;
  232|      0|        }
  233|  15.1k|        if (pthread_cond_init(&c->task_thread.delayed_fg.cond, NULL)) {
  ------------------
  |  Branch (233:13): [True: 0, False: 15.1k]
  ------------------
  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|  15.1k|        c->task_thread.cur = c->n_fc;
  239|  15.1k|        atomic_init(&c->task_thread.reset_task_cur, UINT_MAX);
  240|  15.1k|        atomic_init(&c->task_thread.cond_signaled, 0);
  241|  15.1k|        c->task_thread.inited = 1;
  242|  15.1k|    }
  243|       |
  244|  15.1k|    if (c->n_fc > 1) {
  ------------------
  |  Branch (244:9): [True: 15.1k, False: 0]
  ------------------
  245|  15.1k|        const size_t out_delayed_sz = sizeof(*c->frame_thread.out_delayed) * c->n_fc;
  246|  15.1k|        c->frame_thread.out_delayed =
  247|  15.1k|            dav1d_malloc(ALLOC_THREAD_CTX, out_delayed_sz);
  ------------------
  |  |  132|  15.1k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
  248|  15.1k|        if (!c->frame_thread.out_delayed) goto error;
  ------------------
  |  Branch (248:13): [True: 0, False: 15.1k]
  ------------------
  249|  15.1k|        memset(c->frame_thread.out_delayed, 0, out_delayed_sz);
  250|  15.1k|    }
  251|  75.5k|    for (unsigned n = 0; n < c->n_fc; n++) {
  ------------------
  |  Branch (251:26): [True: 60.4k, False: 15.1k]
  ------------------
  252|  60.4k|        Dav1dFrameContext *const f = &c->fc[n];
  253|  60.4k|        if (c->n_tc > 1) {
  ------------------
  |  Branch (253:13): [True: 60.4k, False: 0]
  ------------------
  254|  60.4k|            if (pthread_cond_init(&f->task_thread.cond, NULL)) goto error;
  ------------------
  |  Branch (254:17): [True: 0, False: 60.4k]
  ------------------
  255|  60.4k|        }
  256|  60.4k|        f->c = c;
  257|  60.4k|        f->task_thread.ttd = &c->task_thread;
  258|  60.4k|        f->lf.last_sharpness = -1;
  259|  60.4k|    }
  260|       |
  261|  75.5k|    for (unsigned m = 0; m < c->n_tc; m++) {
  ------------------
  |  Branch (261:26): [True: 60.4k, False: 15.1k]
  ------------------
  262|  60.4k|        Dav1dTaskContext *const t = &c->tc[m];
  263|  60.4k|        t->f = &c->fc[0];
  264|  60.4k|        t->task_thread.ttd = &c->task_thread;
  265|  60.4k|        t->c = c;
  266|  60.4k|        memset(t->cf_16bpc, 0, sizeof(t->cf_16bpc));
  267|  60.4k|        if (c->n_tc > 1) {
  ------------------
  |  Branch (267:13): [True: 60.4k, False: 0]
  ------------------
  268|  60.4k|            if (pthread_cond_init(&t->task_thread.td.cond, NULL)) goto error;
  ------------------
  |  Branch (268:17): [True: 0, False: 60.4k]
  ------------------
  269|  60.4k|            if (pthread_create(&t->task_thread.td.thread, &thread_attr, dav1d_worker_task, t)) {
  ------------------
  |  Branch (269:17): [True: 0, False: 60.4k]
  ------------------
  270|      0|                pthread_cond_destroy(&t->task_thread.td.cond);
  271|      0|                goto error;
  272|      0|            }
  273|  60.4k|            t->task_thread.td.inited = 1;
  274|  60.4k|        }
  275|  60.4k|    }
  276|  15.1k|    dav1d_lf_mask_dsp_init(&c->lf_mask_dsp);
  277|  15.1k|    dav1d_pal_dsp_init(&c->pal_dsp);
  278|  15.1k|    dav1d_refmvs_dsp_init(&c->refmvs_dsp);
  279|       |
  280|  15.1k|    pthread_attr_destroy(&thread_attr);
  281|       |
  282|  15.1k|    return 0;
  283|       |
  284|      0|error:
  285|      0|    if (c) close_internal(c_out, 0);
  ------------------
  |  Branch (285:9): [True: 0, False: 0]
  ------------------
  286|      0|    pthread_attr_destroy(&thread_attr);
  287|      0|    return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  288|  15.1k|}
dav1d_send_data:
  430|   295k|{
  431|   295k|    validate_input_or_ret(c != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|   295k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 295k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  432|   295k|    validate_input_or_ret(in != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|   295k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 295k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  433|       |
  434|   295k|    if (in->data) {
  ------------------
  |  Branch (434:9): [True: 295k, False: 0]
  ------------------
  435|   295k|        validate_input_or_ret(in->sz > 0 && in->sz <= SIZE_MAX / 2, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|   591k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 295k, False: 0]
  |  |  |  Branch (52:11): [True: 295k, False: 0]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  436|   295k|        c->drain = 0;
  437|   295k|    }
  438|   295k|    if (c->in.data)
  ------------------
  |  Branch (438:9): [True: 16.0k, False: 279k]
  ------------------
  439|  16.0k|        return DAV1D_ERR(EAGAIN);
  ------------------
  |  |   58|  16.0k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  440|   279k|    dav1d_data_ref(&c->in, in);
  441|       |
  442|   279k|    int res = gen_picture(c);
  443|   279k|    if (!res)
  ------------------
  |  Branch (443:9): [True: 231k, False: 48.0k]
  ------------------
  444|   231k|        dav1d_data_unref_internal(in);
  445|       |
  446|   279k|    return res;
  447|   295k|}
dav1d_get_picture:
  450|   279k|{
  451|   279k|    validate_input_or_ret(c != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|   279k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 279k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  452|   279k|    validate_input_or_ret(out != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|   279k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 279k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  453|       |
  454|   279k|    const int drain = c->drain;
  455|   279k|    c->drain = 1;
  456|       |
  457|   279k|    int res = gen_picture(c);
  458|   279k|    if (res < 0)
  ------------------
  |  Branch (458:9): [True: 3.08k, False: 275k]
  ------------------
  459|  3.08k|        return res;
  460|       |
  461|   275k|    if (c->cached_error) {
  ------------------
  |  Branch (461:9): [True: 147k, False: 128k]
  ------------------
  462|   147k|        const int res = c->cached_error;
  463|   147k|        c->cached_error = 0;
  464|   147k|        return res;
  465|   147k|    }
  466|       |
  467|   128k|    if (output_picture_ready(c, c->n_fc == 1))
  ------------------
  |  Branch (467:9): [True: 42.0k, False: 86.1k]
  ------------------
  468|  42.0k|        return output_image(c, out);
  469|       |
  470|  86.1k|    if (c->n_fc > 1 && drain)
  ------------------
  |  Branch (470:9): [True: 86.1k, False: 0]
  |  Branch (470:24): [True: 27.2k, False: 58.9k]
  ------------------
  471|  27.2k|        return drain_picture(c, out);
  472|       |
  473|  58.9k|    return DAV1D_ERR(EAGAIN);
  ------------------
  |  |   58|  58.9k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  474|  86.1k|}
dav1d_apply_grain:
  478|  4.01k|{
  479|  4.01k|    validate_input_or_ret(c != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  4.01k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 4.01k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  480|  4.01k|    validate_input_or_ret(out != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  4.01k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 4.01k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  481|  4.01k|    validate_input_or_ret(in != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  4.01k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 4.01k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  482|       |
  483|  4.01k|    if (!has_grain(in)) {
  ------------------
  |  Branch (483:9): [True: 0, False: 4.01k]
  ------------------
  484|      0|        dav1d_picture_ref(out, in);
  485|      0|        return 0;
  486|      0|    }
  487|       |
  488|  4.01k|    int res = dav1d_picture_alloc_copy(c, out, in->p.w, in);
  489|  4.01k|    if (res < 0) goto error;
  ------------------
  |  Branch (489:9): [True: 0, False: 4.01k]
  ------------------
  490|       |
  491|  4.01k|    if (c->n_tc > 1) {
  ------------------
  |  Branch (491:9): [True: 4.01k, False: 0]
  ------------------
  492|  4.01k|        dav1d_task_delayed_fg(c, out, in);
  493|  4.01k|    } else {
  494|      0|        switch (out->p.bpc) {
  495|      0|#if CONFIG_8BPC
  496|      0|        case 8:
  ------------------
  |  Branch (496:9): [True: 0, False: 0]
  ------------------
  497|      0|            dav1d_apply_grain_8bpc(&c->dsp[0].fg, out, in);
  498|      0|            break;
  499|      0|#endif
  500|      0|#if CONFIG_16BPC
  501|      0|        case 10:
  ------------------
  |  Branch (501:9): [True: 0, False: 0]
  ------------------
  502|      0|        case 12:
  ------------------
  |  Branch (502:9): [True: 0, False: 0]
  ------------------
  503|      0|            dav1d_apply_grain_16bpc(&c->dsp[(out->p.bpc >> 1) - 4].fg, out, in);
  504|      0|            break;
  505|      0|#endif
  506|      0|        default: abort();
  ------------------
  |  Branch (506:9): [True: 0, False: 0]
  ------------------
  507|      0|        }
  508|      0|    }
  509|       |
  510|  4.01k|    return 0;
  511|       |
  512|      0|error:
  513|      0|    dav1d_picture_unref_internal(out);
  514|      0|    return res;
  515|  4.01k|}
dav1d_flush:
  517|  15.1k|void dav1d_flush(Dav1dContext *const c) {
  518|  15.1k|    dav1d_data_unref_internal(&c->in);
  519|  15.1k|    if (c->out.p.frame_hdr)
  ------------------
  |  Branch (519:9): [True: 0, False: 15.1k]
  ------------------
  520|      0|        dav1d_thread_picture_unref(&c->out);
  521|  15.1k|    if (c->cache.p.frame_hdr)
  ------------------
  |  Branch (521:9): [True: 0, False: 15.1k]
  ------------------
  522|      0|        dav1d_thread_picture_unref(&c->cache);
  523|       |
  524|  15.1k|    c->drain = 0;
  525|  15.1k|    c->cached_error = 0;
  526|       |
  527|   135k|    for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (527:21): [True: 120k, False: 15.1k]
  ------------------
  528|   120k|        if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (528:13): [True: 106k, False: 14.7k]
  ------------------
  529|   106k|            dav1d_thread_picture_unref(&c->refs[i].p);
  530|   120k|        dav1d_ref_dec(&c->refs[i].segmap);
  531|   120k|        dav1d_ref_dec(&c->refs[i].refmvs);
  532|   120k|        dav1d_cdf_thread_unref(&c->cdf[i]);
  533|   120k|    }
  534|  15.1k|    c->frame_hdr = NULL;
  535|  15.1k|    c->seq_hdr = NULL;
  536|  15.1k|    dav1d_ref_dec(&c->seq_hdr_ref);
  537|       |
  538|  15.1k|    c->mastering_display = NULL;
  539|  15.1k|    c->content_light = NULL;
  540|  15.1k|    c->itut_t35 = NULL;
  541|  15.1k|    c->n_itut_t35 = 0;
  542|  15.1k|    dav1d_ref_dec(&c->mastering_display_ref);
  543|  15.1k|    dav1d_ref_dec(&c->content_light_ref);
  544|  15.1k|    dav1d_ref_dec(&c->itut_t35_ref);
  545|       |
  546|  15.1k|    dav1d_data_props_unref_internal(&c->cached_error_props);
  547|       |
  548|  15.1k|    if (c->n_fc == 1 && c->n_tc == 1) return;
  ------------------
  |  Branch (548:9): [True: 0, False: 15.1k]
  |  Branch (548:25): [True: 0, False: 0]
  ------------------
  549|  15.1k|    atomic_store_explicit(c->flush, 1, memory_order_relaxed);
  550|       |
  551|  15.1k|    if (c->n_tc > 1) {
  ------------------
  |  Branch (551:9): [True: 15.1k, False: 0]
  ------------------
  552|  15.1k|        pthread_mutex_lock(&c->task_thread.lock);
  553|       |        // stop running tasks in worker threads
  554|  75.5k|        for (unsigned i = 0; i < c->n_tc; i++) {
  ------------------
  |  Branch (554:30): [True: 60.4k, False: 15.1k]
  ------------------
  555|  60.4k|            Dav1dTaskContext *const tc = &c->tc[i];
  556|  64.2k|            while (!tc->task_thread.flushed) {
  ------------------
  |  Branch (556:20): [True: 3.81k, False: 60.4k]
  ------------------
  557|  3.81k|                pthread_cond_wait(&tc->task_thread.td.cond, &c->task_thread.lock);
  558|  3.81k|            }
  559|  60.4k|        }
  560|  75.5k|        for (unsigned i = 0; i < c->n_fc; i++) {
  ------------------
  |  Branch (560:30): [True: 60.4k, False: 15.1k]
  ------------------
  561|  60.4k|            c->fc[i].task_thread.task_head = NULL;
  562|  60.4k|            c->fc[i].task_thread.task_tail = NULL;
  563|  60.4k|            c->fc[i].task_thread.task_cur_prev = NULL;
  564|  60.4k|            atomic_init(&c->fc[i].task_thread.pending_tasks, 0);
  565|  60.4k|        }
  566|  15.1k|        atomic_init(&c->task_thread.first, 0);
  567|  15.1k|        c->task_thread.cur = c->n_fc;
  568|  15.1k|        atomic_store_explicit(&c->task_thread.reset_task_cur, UINT_MAX, memory_order_relaxed);
  569|  15.1k|        atomic_store_explicit(&c->task_thread.cond_signaled, 0, memory_order_relaxed);
  570|  15.1k|        pthread_mutex_unlock(&c->task_thread.lock);
  571|  15.1k|    }
  572|       |
  573|  15.1k|    if (c->n_fc > 1) {
  ------------------
  |  Branch (573:9): [True: 15.1k, False: 0]
  ------------------
  574|  75.5k|        for (unsigned n = 0, next = c->frame_thread.next; n < c->n_fc; n++, next++) {
  ------------------
  |  Branch (574:59): [True: 60.4k, False: 15.1k]
  ------------------
  575|  60.4k|            if (next == c->n_fc) next = 0;
  ------------------
  |  Branch (575:17): [True: 12.7k, False: 47.6k]
  ------------------
  576|  60.4k|            Dav1dFrameContext *const f = &c->fc[next];
  577|  60.4k|            dav1d_decode_frame_exit(f, -1);
  578|  60.4k|            f->n_tile_data = 0;
  579|  60.4k|            f->task_thread.retval = 0;
  580|  60.4k|            atomic_store_explicit(&f->task_thread.error, 0, memory_order_relaxed);
  581|  60.4k|            Dav1dThreadPicture *out_delayed = &c->frame_thread.out_delayed[next];
  582|  60.4k|            if (out_delayed->p.frame_hdr) {
  ------------------
  |  Branch (582:17): [True: 4.25k, False: 56.1k]
  ------------------
  583|  4.25k|                dav1d_thread_picture_unref(out_delayed);
  584|  4.25k|            }
  585|  60.4k|        }
  586|  15.1k|        c->frame_thread.next = 0;
  587|  15.1k|    }
  588|       |    atomic_store_explicit(c->flush, 0, memory_order_relaxed);
  589|  15.1k|}
dav1d_close:
  591|  15.1k|COLD void dav1d_close(Dav1dContext **const c_out) {
  592|  15.1k|    validate_input(c_out != NULL);
  ------------------
  |  |   59|  15.1k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|  15.1k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 15.1k]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |   54|      0|                    #x, __func__); \
  |  |  |  |   55|      0|        debug_abort(); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|      0|#define debug_abort abort
  |  |  |  |  ------------------
  |  |  |  |   56|      0|        return r; \
  |  |  |  |   57|      0|    }
  |  |  ------------------
  ------------------
  593|       |#if TRACK_HEAP_ALLOCATIONS
  594|       |    dav1d_log_alloc_stats(*c_out);
  595|       |#endif
  596|  15.1k|    close_internal(c_out, 1);
  597|  15.1k|}
dav1d_picture_unref:
  713|  53.9k|void dav1d_picture_unref(Dav1dPicture *const p) {
  714|  53.9k|    dav1d_picture_unref_internal(p);
  715|  53.9k|}
dav1d_data_create:
  717|   283k|uint8_t *dav1d_data_create(Dav1dData *const buf, const size_t sz) {
  718|   283k|    return dav1d_data_create_internal(buf, sz);
  719|   283k|}
dav1d_data_unref:
  742|  51.8k|void dav1d_data_unref(Dav1dData *const buf) {
  743|  51.8k|    dav1d_data_unref_internal(buf);
  744|  51.8k|}
lib.c:get_num_threads:
  111|  15.1k|{
  112|       |    /* ceil(sqrt(n)) */
  113|  15.1k|    static const uint8_t fc_lut[49] = {
  114|  15.1k|        1,                                     /*     1 */
  115|  15.1k|        2, 2, 2,                               /*  2- 4 */
  116|  15.1k|        3, 3, 3, 3, 3,                         /*  5- 9 */
  117|  15.1k|        4, 4, 4, 4, 4, 4, 4,                   /* 10-16 */
  118|  15.1k|        5, 5, 5, 5, 5, 5, 5, 5, 5,             /* 17-25 */
  119|  15.1k|        6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,       /* 26-36 */
  120|  15.1k|        7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, /* 37-49 */
  121|  15.1k|    };
  122|  15.1k|    *n_tc = s->n_threads ? s->n_threads :
  ------------------
  |  Branch (122:13): [True: 15.1k, False: 0]
  ------------------
  123|  15.1k|        iclip(dav1d_num_logical_processors(c), 1, DAV1D_MAX_THREADS);
  ------------------
  |  |   46|      0|#define DAV1D_MAX_THREADS 256
  ------------------
  124|  15.1k|    *n_fc = s->max_frame_delay ? umin(s->max_frame_delay, *n_tc) :
  ------------------
  |  Branch (124:13): [True: 15.1k, False: 0]
  ------------------
  125|  15.1k|            *n_tc < 50 ? fc_lut[*n_tc - 1] : 8; // min(8, ceil(sqrt(n)))
  ------------------
  |  Branch (125:13): [True: 0, False: 0]
  ------------------
  126|  15.1k|}
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();
  ------------------
  |  |  148|      1|#define dav1d_init_thread() do {} while (0)
  |  |  ------------------
  |  |  |  Branch (148:42): [Folded, False: 1]
  |  |  ------------------
  ------------------
   59|      1|}
lib.c:get_stack_size_internal:
   93|  15.1k|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|  15.1k|    size_t (*const get_minstack)(const pthread_attr_t*) =
  100|  15.1k|        dlsym(RTLD_DEFAULT, "__pthread_get_minstack");
  101|  15.1k|    if (get_minstack)
  ------------------
  |  Branch (101:9): [True: 15.1k, False: 0]
  ------------------
  102|  15.1k|        return get_minstack(thread_attr) - PTHREAD_STACK_MIN;
  103|      0|    return 0;
  104|  15.1k|}
lib.c:gen_picture:
  404|   558k|{
  405|   558k|    Dav1dData *const in = &c->in;
  406|       |
  407|   558k|    if (output_picture_ready(c, 0))
  ------------------
  |  Branch (407:9): [True: 184k, False: 374k]
  ------------------
  408|   184k|        return 0;
  409|       |
  410|   524k|    while (in->sz > 0) {
  ------------------
  |  Branch (410:12): [True: 391k, False: 133k]
  ------------------
  411|   391k|        const ptrdiff_t res = dav1d_parse_obus(c, in);
  412|   391k|        if (res < 0) {
  ------------------
  |  Branch (412:13): [True: 51.7k, False: 339k]
  ------------------
  413|  51.7k|            dav1d_data_unref_internal(in);
  414|   339k|        } else {
  415|   339k|            assert((size_t)res <= in->sz);
  ------------------
  |  Branch (415:13): [True: 339k, False: 0]
  ------------------
  416|   339k|            in->sz -= res;
  417|   339k|            in->data += res;
  418|   339k|            if (!in->sz) dav1d_data_unref_internal(in);
  ------------------
  |  Branch (418:17): [True: 228k, False: 111k]
  ------------------
  419|   339k|        }
  420|   391k|        if (output_picture_ready(c, 0))
  ------------------
  |  Branch (420:13): [True: 189k, False: 201k]
  ------------------
  421|   189k|            break;
  422|   201k|        if (res < 0)
  ------------------
  |  Branch (422:13): [True: 51.1k, False: 150k]
  ------------------
  423|  51.1k|            return (int)res;
  424|   201k|    }
  425|       |
  426|   323k|    return 0;
  427|   374k|}
lib.c:output_picture_ready:
  319|  1.10M|static int output_picture_ready(Dav1dContext *const c, const int drain) {
  320|  1.10M|    if (c->cached_error) return 1;
  ------------------
  |  Branch (320:9): [True: 294k, False: 806k]
  ------------------
  321|   806k|    if (!c->all_layers && c->max_spatial_id) {
  ------------------
  |  Branch (321:9): [True: 0, False: 806k]
  |  Branch (321:27): [True: 0, False: 0]
  ------------------
  322|      0|        if (c->out.p.data[0] && c->cache.p.data[0]) {
  ------------------
  |  Branch (322:13): [True: 0, False: 0]
  |  Branch (322:33): [True: 0, False: 0]
  ------------------
  323|      0|            if (c->max_spatial_id == c->cache.p.frame_hdr->spatial_id ||
  ------------------
  |  Branch (323:17): [True: 0, False: 0]
  ------------------
  324|      0|                c->out.flags & PICTURE_FLAG_NEW_TEMPORAL_UNIT)
  ------------------
  |  Branch (324:17): [True: 0, False: 0]
  ------------------
  325|      0|                return 1;
  326|      0|            dav1d_thread_picture_unref(&c->cache);
  327|      0|            dav1d_thread_picture_move_ref(&c->cache, &c->out);
  328|      0|            return 0;
  329|      0|        } else if (c->cache.p.data[0] && drain) {
  ------------------
  |  Branch (329:20): [True: 0, False: 0]
  |  Branch (329:42): [True: 0, False: 0]
  ------------------
  330|      0|            return 1;
  331|      0|        } else if (c->out.p.data[0]) {
  ------------------
  |  Branch (331:20): [True: 0, False: 0]
  ------------------
  332|      0|            dav1d_thread_picture_move_ref(&c->cache, &c->out);
  333|      0|            return 0;
  334|      0|        }
  335|      0|    }
  336|       |
  337|   806k|    return !!c->out.p.data[0];
  338|   806k|}
lib.c:output_image:
  299|  53.9k|{
  300|  53.9k|    int res = 0;
  301|       |
  302|  53.9k|    Dav1dThreadPicture *const in = (c->all_layers || !c->max_spatial_id)
  ------------------
  |  Branch (302:37): [True: 53.9k, False: 0]
  |  Branch (302:54): [True: 0, False: 0]
  ------------------
  303|  53.9k|                                   ? &c->out : &c->cache;
  304|  53.9k|    if (!c->apply_grain || !has_grain(&in->p)) {
  ------------------
  |  Branch (304:9): [True: 0, False: 53.9k]
  |  Branch (304:28): [True: 49.9k, False: 4.01k]
  ------------------
  305|  49.9k|        dav1d_picture_move_ref(out, &in->p);
  306|  49.9k|        dav1d_thread_picture_unref(in);
  307|  49.9k|        goto end;
  308|  49.9k|    }
  309|       |
  310|  4.01k|    res = dav1d_apply_grain(c, out, &in->p);
  311|  4.01k|    dav1d_thread_picture_unref(in);
  312|  53.9k|end:
  313|  53.9k|    if (!c->all_layers && c->max_spatial_id && c->out.p.data[0]) {
  ------------------
  |  Branch (313:9): [True: 0, False: 53.9k]
  |  Branch (313:27): [True: 0, False: 0]
  |  Branch (313:48): [True: 0, False: 0]
  ------------------
  314|      0|        dav1d_thread_picture_move_ref(in, &c->out);
  315|      0|    }
  316|  53.9k|    return res;
  317|  4.01k|}
lib.c:drain_picture:
  340|  27.2k|static int drain_picture(Dav1dContext *const c, Dav1dPicture *const out) {
  341|  27.2k|    unsigned drain_count = 0;
  342|  27.2k|    int drained = 0;
  343|  83.5k|    do {
  344|  83.5k|        const unsigned next = c->frame_thread.next;
  345|  83.5k|        Dav1dFrameContext *const f = &c->fc[next];
  346|  83.5k|        pthread_mutex_lock(&c->task_thread.lock);
  347|   100k|        while (f->n_tile_data > 0)
  ------------------
  |  Branch (347:16): [True: 16.7k, False: 83.5k]
  ------------------
  348|  16.7k|            pthread_cond_wait(&f->task_thread.cond,
  349|  16.7k|                              &f->task_thread.ttd->lock);
  350|  83.5k|        Dav1dThreadPicture *const out_delayed =
  351|  83.5k|            &c->frame_thread.out_delayed[next];
  352|  83.5k|        if (out_delayed->p.data[0] ||
  ------------------
  |  Branch (352:13): [True: 19.3k, False: 64.1k]
  ------------------
  353|  83.5k|            atomic_load_explicit(&f->task_thread.error, memory_order_relaxed))
  ------------------
  |  Branch (353:13): [True: 95, False: 64.0k]
  ------------------
  354|  19.4k|        {
  355|  19.4k|            unsigned first = atomic_load_explicit(&c->task_thread.first, memory_order_relaxed);
  356|  19.4k|            if (first + 1U < c->n_fc)
  ------------------
  |  Branch (356:17): [True: 18.3k, False: 1.10k]
  ------------------
  357|  19.4k|                atomic_fetch_add_explicit(&c->task_thread.first, 1U, memory_order_relaxed);
  358|  1.10k|            else
  359|  19.4k|                atomic_store_explicit(&c->task_thread.first, 0, memory_order_relaxed);
  360|  19.4k|            atomic_compare_exchange_strong_explicit(&c->task_thread.reset_task_cur,
  361|  19.4k|                                                    &first, UINT_MAX,
  362|  19.4k|                                                    memory_order_relaxed,
  363|  19.4k|                                                    memory_order_relaxed);
  364|  19.4k|            if (c->task_thread.cur && c->task_thread.cur < c->n_fc)
  ------------------
  |  Branch (364:17): [True: 19.3k, False: 39]
  |  Branch (364:39): [True: 2.21k, False: 17.1k]
  ------------------
  365|  2.21k|                c->task_thread.cur--;
  366|  19.4k|            drained = 1;
  367|  64.0k|        } else if (drained) {
  ------------------
  |  Branch (367:20): [True: 489, False: 63.5k]
  ------------------
  368|    489|            pthread_mutex_unlock(&c->task_thread.lock);
  369|    489|            break;
  370|    489|        }
  371|  83.0k|        if (++c->frame_thread.next == c->n_fc)
  ------------------
  |  Branch (371:13): [True: 20.7k, False: 62.2k]
  ------------------
  372|  20.7k|            c->frame_thread.next = 0;
  373|  83.0k|        pthread_mutex_unlock(&c->task_thread.lock);
  374|  83.0k|        const int error = f->task_thread.retval;
  375|  83.0k|        if (error) {
  ------------------
  |  Branch (375:13): [True: 5.98k, False: 77.0k]
  ------------------
  376|  5.98k|            f->task_thread.retval = 0;
  377|  5.98k|            dav1d_data_props_copy(&c->cached_error_props, &out_delayed->p.m);
  378|  5.98k|            dav1d_thread_picture_unref(out_delayed);
  379|  5.98k|            return error;
  380|  5.98k|        }
  381|  77.0k|        if (out_delayed->p.data[0]) {
  ------------------
  |  Branch (381:13): [True: 13.3k, False: 63.6k]
  ------------------
  382|  13.3k|            const unsigned progress =
  383|  13.3k|                atomic_load_explicit(&out_delayed->progress[1],
  384|  13.3k|                                     memory_order_relaxed);
  385|  13.3k|            if ((out_delayed->visible || c->output_invisible_frames) &&
  ------------------
  |  Branch (385:18): [True: 12.0k, False: 1.24k]
  |  Branch (385:42): [True: 0, False: 1.24k]
  ------------------
  386|  12.0k|                progress != FRAME_ERROR)
  ------------------
  |  |   35|  12.0k|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  |  Branch (386:17): [True: 11.9k, False: 157]
  ------------------
  387|  11.9k|            {
  388|  11.9k|                dav1d_thread_picture_ref(&c->out, out_delayed);
  389|  11.9k|                c->event_flags |= dav1d_picture_get_event_flags(out_delayed);
  390|  11.9k|            }
  391|  13.3k|            dav1d_thread_picture_unref(out_delayed);
  392|  13.3k|            if (output_picture_ready(c, 0))
  ------------------
  |  Branch (392:17): [True: 11.9k, False: 1.40k]
  ------------------
  393|  11.9k|                return output_image(c, out);
  394|  13.3k|        }
  395|  77.0k|    } while (++drain_count < c->n_fc);
  ------------------
  |  Branch (395:14): [True: 56.2k, False: 8.85k]
  ------------------
  396|       |
  397|  9.34k|    if (output_picture_ready(c, 1))
  ------------------
  |  Branch (397:9): [True: 0, False: 9.34k]
  ------------------
  398|      0|        return output_image(c, out);
  399|       |
  400|  9.34k|    return DAV1D_ERR(EAGAIN);
  ------------------
  |  |   58|  9.34k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  401|  9.34k|}
lib.c:has_grain:
  291|  57.9k|{
  292|  57.9k|    const Dav1dFilmGrainData *fgdata = &pic->frame_hdr->film_grain.data;
  293|  57.9k|    return fgdata->num_y_points || fgdata->num_uv_points[0] ||
  ------------------
  |  Branch (293:12): [True: 4.20k, False: 53.7k]
  |  Branch (293:36): [True: 1.16k, False: 52.5k]
  ------------------
  294|  52.5k|           fgdata->num_uv_points[1] || (fgdata->clip_to_restricted_range &&
  ------------------
  |  Branch (294:12): [True: 190, False: 52.4k]
  |  Branch (294:41): [True: 2.81k, False: 49.5k]
  ------------------
  295|  2.81k|                                        fgdata->chroma_scaling_from_luma);
  ------------------
  |  Branch (295:41): [True: 2.47k, False: 348]
  ------------------
  296|  57.9k|}
lib.c:close_internal:
  599|  15.1k|static COLD void close_internal(Dav1dContext **const c_out, int flush) {
  600|  15.1k|    Dav1dContext *const c = *c_out;
  601|  15.1k|    if (!c) return;
  ------------------
  |  Branch (601:9): [True: 0, False: 15.1k]
  ------------------
  602|       |
  603|  15.1k|    if (flush) dav1d_flush(c);
  ------------------
  |  Branch (603:9): [True: 15.1k, False: 0]
  ------------------
  604|       |
  605|  15.1k|    if (c->tc) {
  ------------------
  |  Branch (605:9): [True: 15.1k, False: 0]
  ------------------
  606|  15.1k|        struct TaskThreadData *ttd = &c->task_thread;
  607|  15.1k|        if (ttd->inited) {
  ------------------
  |  Branch (607:13): [True: 15.1k, False: 0]
  ------------------
  608|  15.1k|            pthread_mutex_lock(&ttd->lock);
  609|  75.5k|            for (unsigned n = 0; n < c->n_tc && c->tc[n].task_thread.td.inited; n++)
  ------------------
  |  Branch (609:34): [True: 60.4k, False: 15.1k]
  |  Branch (609:49): [True: 60.4k, False: 0]
  ------------------
  610|  60.4k|                c->tc[n].task_thread.die = 1;
  611|  15.1k|            pthread_cond_broadcast(&ttd->cond);
  612|  15.1k|            pthread_mutex_unlock(&ttd->lock);
  613|  75.5k|            for (unsigned n = 0; n < c->n_tc; n++) {
  ------------------
  |  Branch (613:34): [True: 60.4k, False: 15.1k]
  ------------------
  614|  60.4k|                Dav1dTaskContext *const pf = &c->tc[n];
  615|  60.4k|                if (!pf->task_thread.td.inited) break;
  ------------------
  |  Branch (615:21): [True: 0, False: 60.4k]
  ------------------
  616|  60.4k|                pthread_join(pf->task_thread.td.thread, NULL);
  617|  60.4k|                pthread_cond_destroy(&pf->task_thread.td.cond);
  618|  60.4k|            }
  619|  15.1k|            pthread_cond_destroy(&ttd->delayed_fg.cond);
  620|  15.1k|            pthread_cond_destroy(&ttd->cond);
  621|  15.1k|            pthread_mutex_destroy(&ttd->lock);
  622|  15.1k|        }
  623|  15.1k|        dav1d_free_aligned(c->tc);
  ------------------
  |  |  136|  15.1k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  624|  15.1k|    }
  625|       |
  626|  75.5k|    for (unsigned n = 0; c->fc && n < c->n_fc; n++) {
  ------------------
  |  Branch (626:26): [True: 75.5k, False: 0]
  |  Branch (626:35): [True: 60.4k, False: 15.1k]
  ------------------
  627|  60.4k|        Dav1dFrameContext *const f = &c->fc[n];
  628|       |
  629|       |        // clean-up threading stuff
  630|  60.4k|        if (c->n_fc > 1) {
  ------------------
  |  Branch (630:13): [True: 60.4k, False: 0]
  ------------------
  631|  60.4k|            dav1d_free(f->tile_thread.lowest_pixel_mem);
  ------------------
  |  |  135|  60.4k|#define dav1d_free(ptr) free(ptr)
  ------------------
  632|  60.4k|            dav1d_free(f->frame_thread.b);
  ------------------
  |  |  135|  60.4k|#define dav1d_free(ptr) free(ptr)
  ------------------
  633|  60.4k|            dav1d_free_aligned(f->frame_thread.cbi);
  ------------------
  |  |  136|  60.4k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  634|  60.4k|            dav1d_free_aligned(f->frame_thread.pal_idx);
  ------------------
  |  |  136|  60.4k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  635|  60.4k|            dav1d_free_aligned(f->frame_thread.cf);
  ------------------
  |  |  136|  60.4k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  636|  60.4k|            dav1d_free(f->frame_thread.tile_start_off);
  ------------------
  |  |  135|  60.4k|#define dav1d_free(ptr) free(ptr)
  ------------------
  637|  60.4k|            dav1d_free_aligned(f->frame_thread.pal);
  ------------------
  |  |  136|  60.4k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  638|  60.4k|        }
  639|  60.4k|        if (c->n_tc > 1) {
  ------------------
  |  Branch (639:13): [True: 60.4k, False: 0]
  ------------------
  640|  60.4k|            pthread_cond_destroy(&f->task_thread.cond);
  641|  60.4k|        }
  642|  60.4k|        dav1d_free(f->frame_thread.frame_progress);
  ------------------
  |  |  135|  60.4k|#define dav1d_free(ptr) free(ptr)
  ------------------
  643|  60.4k|        dav1d_free(f->task_thread.tasks);
  ------------------
  |  |  135|  60.4k|#define dav1d_free(ptr) free(ptr)
  ------------------
  644|  60.4k|        dav1d_free(f->task_thread.tile_tasks[0]);
  ------------------
  |  |  135|  60.4k|#define dav1d_free(ptr) free(ptr)
  ------------------
  645|  60.4k|        dav1d_free_aligned(f->ts);
  ------------------
  |  |  136|  60.4k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  646|  60.4k|        dav1d_free_aligned(f->ipred_edge[0]);
  ------------------
  |  |  136|  60.4k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  647|  60.4k|        dav1d_free_aligned(f->a);
  ------------------
  |  |  136|  60.4k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  648|  60.4k|        dav1d_free(f->tile);
  ------------------
  |  |  135|  60.4k|#define dav1d_free(ptr) free(ptr)
  ------------------
  649|  60.4k|        dav1d_free(f->lf.mask);
  ------------------
  |  |  135|  60.4k|#define dav1d_free(ptr) free(ptr)
  ------------------
  650|  60.4k|        dav1d_free_aligned(f->lf.level[0]);
  ------------------
  |  |  136|  60.4k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  651|  60.4k|        dav1d_free(f->lf.lr_mask);
  ------------------
  |  |  135|  60.4k|#define dav1d_free(ptr) free(ptr)
  ------------------
  652|  60.4k|        dav1d_free(f->lf.tx_lpf_right_edge[0]);
  ------------------
  |  |  135|  60.4k|#define dav1d_free(ptr) free(ptr)
  ------------------
  653|  60.4k|        dav1d_free(f->lf.start_of_tile_row);
  ------------------
  |  |  135|  60.4k|#define dav1d_free(ptr) free(ptr)
  ------------------
  654|  60.4k|        dav1d_free_aligned(f->rf.r);
  ------------------
  |  |  136|  60.4k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  655|  60.4k|        dav1d_free_aligned(f->lf.cdef_line_buf);
  ------------------
  |  |  136|  60.4k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  656|  60.4k|        dav1d_free_aligned(f->lf.lr_line_buf);
  ------------------
  |  |  136|  60.4k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  657|  60.4k|    }
  658|  15.1k|    dav1d_free_aligned(c->fc);
  ------------------
  |  |  136|  15.1k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  659|  15.1k|    if (c->n_fc > 1 && c->frame_thread.out_delayed) {
  ------------------
  |  Branch (659:9): [True: 15.1k, False: 0]
  |  Branch (659:24): [True: 15.1k, False: 0]
  ------------------
  660|  75.5k|        for (unsigned n = 0; n < c->n_fc; n++)
  ------------------
  |  Branch (660:30): [True: 60.4k, False: 15.1k]
  ------------------
  661|  60.4k|            if (c->frame_thread.out_delayed[n].p.frame_hdr)
  ------------------
  |  Branch (661:17): [True: 0, False: 60.4k]
  ------------------
  662|      0|                dav1d_thread_picture_unref(&c->frame_thread.out_delayed[n]);
  663|  15.1k|        dav1d_free(c->frame_thread.out_delayed);
  ------------------
  |  |  135|  15.1k|#define dav1d_free(ptr) free(ptr)
  ------------------
  664|  15.1k|    }
  665|  15.2k|    for (int n = 0; n < c->n_tile_data; n++)
  ------------------
  |  Branch (665:21): [True: 133, False: 15.1k]
  ------------------
  666|    133|        dav1d_data_unref_internal(&c->tile[n].data);
  667|  15.1k|    dav1d_free(c->tile);
  ------------------
  |  |  135|  15.1k|#define dav1d_free(ptr) free(ptr)
  ------------------
  668|   135k|    for (int n = 0; n < 8; n++) {
  ------------------
  |  Branch (668:21): [True: 120k, False: 15.1k]
  ------------------
  669|   120k|        dav1d_cdf_thread_unref(&c->cdf[n]);
  670|   120k|        if (c->refs[n].p.p.frame_hdr)
  ------------------
  |  Branch (670:13): [True: 0, False: 120k]
  ------------------
  671|      0|            dav1d_thread_picture_unref(&c->refs[n].p);
  672|   120k|        dav1d_ref_dec(&c->refs[n].refmvs);
  673|   120k|        dav1d_ref_dec(&c->refs[n].segmap);
  674|   120k|    }
  675|  15.1k|    dav1d_ref_dec(&c->seq_hdr_ref);
  676|  15.1k|    dav1d_ref_dec(&c->frame_hdr_ref);
  677|       |
  678|  15.1k|    dav1d_ref_dec(&c->mastering_display_ref);
  679|  15.1k|    dav1d_ref_dec(&c->content_light_ref);
  680|  15.1k|    dav1d_ref_dec(&c->itut_t35_ref);
  681|       |
  682|  15.1k|    dav1d_mem_pool_end(c->seq_hdr_pool);
  683|  15.1k|    dav1d_mem_pool_end(c->frame_hdr_pool);
  684|  15.1k|    dav1d_mem_pool_end(c->segmap_pool);
  685|  15.1k|    dav1d_mem_pool_end(c->refmvs_pool);
  686|  15.1k|    dav1d_mem_pool_end(c->cdf_pool);
  687|  15.1k|    dav1d_mem_pool_end(c->picture_pool);
  688|  15.1k|    dav1d_mem_pool_end(c->pic_ctx_pool);
  689|       |
  690|  15.1k|    dav1d_freep_aligned(c_out);
  691|  15.1k|}

dav1d_loop_filter_dsp_init_8bpc:
  259|  5.08k|COLD void bitfn(dav1d_loop_filter_dsp_init)(Dav1dLoopFilterDSPContext *const c) {
  260|  5.08k|    c->loop_filter_sb[0][0] = loop_filter_h_sb128y_c;
  261|  5.08k|    c->loop_filter_sb[0][1] = loop_filter_v_sb128y_c;
  262|  5.08k|    c->loop_filter_sb[1][0] = loop_filter_h_sb128uv_c;
  263|  5.08k|    c->loop_filter_sb[1][1] = loop_filter_v_sb128uv_c;
  264|       |
  265|  5.08k|#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|  5.08k|#endif
  275|  5.08k|#endif
  276|  5.08k|}
dav1d_loop_filter_dsp_init_16bpc:
  259|  8.47k|COLD void bitfn(dav1d_loop_filter_dsp_init)(Dav1dLoopFilterDSPContext *const c) {
  260|  8.47k|    c->loop_filter_sb[0][0] = loop_filter_h_sb128y_c;
  261|  8.47k|    c->loop_filter_sb[0][1] = loop_filter_v_sb128y_c;
  262|  8.47k|    c->loop_filter_sb[1][0] = loop_filter_h_sb128uv_c;
  263|  8.47k|    c->loop_filter_sb[1][1] = loop_filter_v_sb128uv_c;
  264|       |
  265|  8.47k|#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.47k|#endif
  275|  8.47k|#endif
  276|  8.47k|}

dav1d_loop_restoration_dsp_init_8bpc:
 1361|  5.08k|{
 1362|  5.08k|    c->wiener[0] = c->wiener[1] = wiener_c;
 1363|  5.08k|    c->sgr[0] = sgr_5x5_c;
 1364|  5.08k|    c->sgr[1] = sgr_3x3_c;
 1365|  5.08k|    c->sgr[2] = sgr_mix_c;
 1366|       |
 1367|  5.08k|#if HAVE_ASM
 1368|       |#if ARCH_AARCH64 || ARCH_ARM
 1369|       |    loop_restoration_dsp_init_arm(c, bpc);
 1370|       |#elif ARCH_LOONGARCH64
 1371|       |    loop_restoration_dsp_init_loongarch(c, bpc);
 1372|       |#elif ARCH_PPC64LE
 1373|       |    loop_restoration_dsp_init_ppc(c, bpc);
 1374|       |#elif ARCH_X86
 1375|       |    loop_restoration_dsp_init_x86(c, bpc);
 1376|  5.08k|#endif
 1377|  5.08k|#endif
 1378|  5.08k|}
looprestoration_tmpl.c:sgr_5x5_c:
  824|  5.90k|{
  825|  5.90k|    ALIGN_STK_16(int32_t, sumsq_buf, BUF_STRIDE * 5 + 16,);
  ------------------
  |  |  100|  5.90k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  5.90k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  826|  5.90k|    ALIGN_STK_16(coef, sum_buf, BUF_STRIDE * 5 + 16,);
  ------------------
  |  |  100|  5.90k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  5.90k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  827|  5.90k|    int32_t *sumsq_ptrs[5], *sumsq_rows[5];
  828|  5.90k|    coef *sum_ptrs[5], *sum_rows[5];
  829|  35.4k|    for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (829:21): [True: 29.5k, False: 5.90k]
  ------------------
  830|  29.5k|        sumsq_rows[i] = &sumsq_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  29.5k|#define BUF_STRIDE (384 + 16)
  ------------------
  831|  29.5k|        sum_rows[i] = &sum_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  29.5k|#define BUF_STRIDE (384 + 16)
  ------------------
  832|  29.5k|    }
  833|       |
  834|  5.90k|    ALIGN_STK_16(int32_t, A_buf, BUF_STRIDE * 2 + 16,);
  ------------------
  |  |  100|  5.90k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  5.90k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  835|  5.90k|    ALIGN_STK_16(coef, B_buf, BUF_STRIDE * 2 + 16,);
  ------------------
  |  |  100|  5.90k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  5.90k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  836|  5.90k|    int32_t *A_ptrs[2];
  837|  5.90k|    coef *B_ptrs[2];
  838|  17.7k|    for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (838:21): [True: 11.8k, False: 5.90k]
  ------------------
  839|  11.8k|        A_ptrs[i] = &A_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  11.8k|#define BUF_STRIDE (384 + 16)
  ------------------
  840|  11.8k|        B_ptrs[i] = &B_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  11.8k|#define BUF_STRIDE (384 + 16)
  ------------------
  841|  11.8k|    }
  842|  5.90k|    const pixel *src = dst;
  843|  5.90k|    const pixel *lpf_bottom = lpf + 6*PXSTRIDE(stride);
  ------------------
  |  |   53|  5.90k|#define PXSTRIDE(x) (x)
  ------------------
  844|       |
  845|  5.90k|    if (edges & LR_HAVE_TOP) {
  ------------------
  |  Branch (845:9): [True: 2.32k, False: 3.57k]
  ------------------
  846|  2.32k|        sumsq_ptrs[0] = sumsq_rows[0];
  847|  2.32k|        sumsq_ptrs[1] = sumsq_rows[0];
  848|  2.32k|        sumsq_ptrs[2] = sumsq_rows[1];
  849|  2.32k|        sumsq_ptrs[3] = sumsq_rows[2];
  850|  2.32k|        sumsq_ptrs[4] = sumsq_rows[3];
  851|  2.32k|        sum_ptrs[0] = sum_rows[0];
  852|  2.32k|        sum_ptrs[1] = sum_rows[0];
  853|  2.32k|        sum_ptrs[2] = sum_rows[1];
  854|  2.32k|        sum_ptrs[3] = sum_rows[2];
  855|  2.32k|        sum_ptrs[4] = sum_rows[3];
  856|       |
  857|  2.32k|        sgr_box5_row_h(sumsq_rows[0], sum_rows[0], NULL, lpf, w, edges);
  858|  2.32k|        lpf += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.32k|#define PXSTRIDE(x) (x)
  ------------------
  859|  2.32k|        sgr_box5_row_h(sumsq_rows[1], sum_rows[1], NULL, lpf, w, edges);
  860|       |
  861|  2.32k|        sgr_box5_row_h(sumsq_rows[2], sum_rows[2], left, src, w, edges);
  862|  2.32k|        left++;
  863|  2.32k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.32k|#define PXSTRIDE(x) (x)
  ------------------
  864|       |
  865|  2.32k|        if (--h <= 0)
  ------------------
  |  Branch (865:13): [True: 199, False: 2.12k]
  ------------------
  866|    199|            goto vert_1;
  867|       |
  868|  2.12k|        sgr_box5_row_h(sumsq_rows[3], sum_rows[3], left, src, w, edges);
  869|  2.12k|        left++;
  870|  2.12k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.12k|#define PXSTRIDE(x) (x)
  ------------------
  871|  2.12k|        sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
  872|  2.12k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.12k|#define BITDEPTH_MAX 0xff
  ------------------
  873|  2.12k|        rotate(A_ptrs, B_ptrs, 2);
  874|       |
  875|  2.12k|        if (--h <= 0)
  ------------------
  |  Branch (875:13): [True: 421, False: 1.70k]
  ------------------
  876|    421|            goto vert_2;
  877|       |
  878|       |        // ptrs are rotated by 2; both [3] and [4] now point at rows[0]; set
  879|       |        // one of them to point at the previously unused rows[4].
  880|  1.70k|        sumsq_ptrs[3] = sumsq_rows[4];
  881|  1.70k|        sum_ptrs[3] = sum_rows[4];
  882|  3.57k|    } else {
  883|  3.57k|        sumsq_ptrs[0] = sumsq_rows[0];
  884|  3.57k|        sumsq_ptrs[1] = sumsq_rows[0];
  885|  3.57k|        sumsq_ptrs[2] = sumsq_rows[0];
  886|  3.57k|        sumsq_ptrs[3] = sumsq_rows[0];
  887|  3.57k|        sumsq_ptrs[4] = sumsq_rows[0];
  888|  3.57k|        sum_ptrs[0] = sum_rows[0];
  889|  3.57k|        sum_ptrs[1] = sum_rows[0];
  890|  3.57k|        sum_ptrs[2] = sum_rows[0];
  891|  3.57k|        sum_ptrs[3] = sum_rows[0];
  892|  3.57k|        sum_ptrs[4] = sum_rows[0];
  893|       |
  894|  3.57k|        sgr_box5_row_h(sumsq_rows[0], sum_rows[0], left, src, w, edges);
  895|  3.57k|        left++;
  896|  3.57k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  3.57k|#define PXSTRIDE(x) (x)
  ------------------
  897|       |
  898|  3.57k|        if (--h <= 0)
  ------------------
  |  Branch (898:13): [True: 862, False: 2.71k]
  ------------------
  899|    862|            goto vert_1;
  900|       |
  901|  2.71k|        sumsq_ptrs[4] = sumsq_rows[1];
  902|  2.71k|        sum_ptrs[4] = sum_rows[1];
  903|       |
  904|  2.71k|        sgr_box5_row_h(sumsq_rows[1], sum_rows[1], left, src, w, edges);
  905|  2.71k|        left++;
  906|  2.71k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.71k|#define PXSTRIDE(x) (x)
  ------------------
  907|       |
  908|  2.71k|        sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
  909|  2.71k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.71k|#define BITDEPTH_MAX 0xff
  ------------------
  910|  2.71k|        rotate(A_ptrs, B_ptrs, 2);
  911|       |
  912|  2.71k|        if (--h <= 0)
  ------------------
  |  Branch (912:13): [True: 641, False: 2.07k]
  ------------------
  913|    641|            goto vert_2;
  914|       |
  915|  2.07k|        sumsq_ptrs[3] = sumsq_rows[2];
  916|  2.07k|        sumsq_ptrs[4] = sumsq_rows[3];
  917|  2.07k|        sum_ptrs[3] = sum_rows[2];
  918|  2.07k|        sum_ptrs[4] = sum_rows[3];
  919|       |
  920|  2.07k|        sgr_box5_row_h(sumsq_rows[2], sum_rows[2], left, src, w, edges);
  921|  2.07k|        left++;
  922|  2.07k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.07k|#define PXSTRIDE(x) (x)
  ------------------
  923|       |
  924|  2.07k|        if (--h <= 0)
  ------------------
  |  Branch (924:13): [True: 316, False: 1.75k]
  ------------------
  925|    316|            goto odd;
  926|       |
  927|  1.75k|        sgr_box5_row_h(sumsq_rows[3], sum_rows[3], left, src, w, edges);
  928|  1.75k|        left++;
  929|  1.75k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  1.75k|#define PXSTRIDE(x) (x)
  ------------------
  930|       |
  931|  1.75k|        sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
  932|  1.75k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.75k|#define BITDEPTH_MAX 0xff
  ------------------
  933|  1.75k|        sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
  934|  1.75k|                    w, 2, params->sgr.w0 HIGHBD_TAIL_SUFFIX);
  935|       |
  936|  1.75k|        if (--h <= 0)
  ------------------
  |  Branch (936:13): [True: 103, False: 1.65k]
  ------------------
  937|    103|            goto vert_2;
  938|       |
  939|       |        // ptrs are rotated by 2; both [3] and [4] now point at rows[0]; set
  940|       |        // one of them to point at the previously unused rows[4].
  941|  1.65k|        sumsq_ptrs[3] = sumsq_rows[4];
  942|  1.65k|        sum_ptrs[3] = sum_rows[4];
  943|  1.65k|    }
  944|       |
  945|  74.5k|    do {
  946|  74.5k|        sgr_box5_row_h(sumsq_ptrs[3], sum_ptrs[3], left, src, w, edges);
  947|  74.5k|        left++;
  948|  74.5k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  74.5k|#define PXSTRIDE(x) (x)
  ------------------
  949|       |
  950|  74.5k|        if (--h <= 0)
  ------------------
  |  Branch (950:13): [True: 680, False: 73.8k]
  ------------------
  951|    680|            goto odd;
  952|       |
  953|  73.8k|        sgr_box5_row_h(sumsq_ptrs[4], sum_ptrs[4], left, src, w, edges);
  954|  73.8k|        left++;
  955|  73.8k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  73.8k|#define PXSTRIDE(x) (x)
  ------------------
  956|       |
  957|  73.8k|        sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
  958|  73.8k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  73.8k|#define BITDEPTH_MAX 0xff
  ------------------
  959|  73.8k|        sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
  960|  73.8k|                    w, 2, params->sgr.w0 HIGHBD_TAIL_SUFFIX);
  961|  73.8k|    } while (--h > 0);
  ------------------
  |  Branch (961:14): [True: 71.1k, False: 2.68k]
  ------------------
  962|       |
  963|  2.68k|    if (!(edges & LR_HAVE_BOTTOM))
  ------------------
  |  Branch (963:9): [True: 327, False: 2.35k]
  ------------------
  964|    327|        goto vert_2;
  965|       |
  966|  2.35k|    sgr_box5_row_h(sumsq_ptrs[3], sum_ptrs[3], NULL, lpf_bottom, w, edges);
  967|  2.35k|    lpf_bottom += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.35k|#define PXSTRIDE(x) (x)
  ------------------
  968|  2.35k|    sgr_box5_row_h(sumsq_ptrs[4], sum_ptrs[4], NULL, lpf_bottom, w, edges);
  969|       |
  970|  3.84k|output_2:
  971|  3.84k|    sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
  972|  3.84k|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  3.84k|#define BITDEPTH_MAX 0xff
  ------------------
  973|  3.84k|    sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
  974|  3.84k|                w, 2, params->sgr.w0 HIGHBD_TAIL_SUFFIX);
  975|  3.84k|    return;
  976|       |
  977|  1.49k|vert_2:
  978|       |    // Duplicate the last row twice more
  979|  1.49k|    sumsq_ptrs[3] = sumsq_ptrs[2];
  980|  1.49k|    sumsq_ptrs[4] = sumsq_ptrs[2];
  981|  1.49k|    sum_ptrs[3] = sum_ptrs[2];
  982|  1.49k|    sum_ptrs[4] = sum_ptrs[2];
  983|  1.49k|    goto output_2;
  984|       |
  985|    996|odd:
  986|       |    // Copy the last row as padding once
  987|    996|    sumsq_ptrs[4] = sumsq_ptrs[3];
  988|    996|    sum_ptrs[4] = sum_ptrs[3];
  989|       |
  990|    996|    sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
  991|    996|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|    996|#define BITDEPTH_MAX 0xff
  ------------------
  992|    996|    sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
  993|    996|                w, 2, params->sgr.w0 HIGHBD_TAIL_SUFFIX);
  994|       |
  995|  2.05k|output_1:
  996|       |    // Duplicate the last row twice more
  997|  2.05k|    sumsq_ptrs[3] = sumsq_ptrs[2];
  998|  2.05k|    sumsq_ptrs[4] = sumsq_ptrs[2];
  999|  2.05k|    sum_ptrs[3] = sum_ptrs[2];
 1000|  2.05k|    sum_ptrs[4] = sum_ptrs[2];
 1001|       |
 1002|  2.05k|    sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
 1003|  2.05k|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.05k|#define BITDEPTH_MAX 0xff
  ------------------
 1004|       |    // Output only one row
 1005|  2.05k|    sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
 1006|  2.05k|                w, 1, params->sgr.w0 HIGHBD_TAIL_SUFFIX);
 1007|  2.05k|    return;
 1008|       |
 1009|  1.06k|vert_1:
 1010|       |    // Copy the last row as padding once
 1011|  1.06k|    sumsq_ptrs[4] = sumsq_ptrs[3];
 1012|  1.06k|    sum_ptrs[4] = sum_ptrs[3];
 1013|       |
 1014|  1.06k|    sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
 1015|  1.06k|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.06k|#define BITDEPTH_MAX 0xff
  ------------------
 1016|  1.06k|    rotate(A_ptrs, B_ptrs, 2);
 1017|       |
 1018|  1.06k|    goto output_1;
 1019|    996|}
looprestoration_tmpl.c:sgr_box5_row_h:
  435|   717k|{
  436|   717k|    sumsq++;
  437|   717k|    sum++;
  438|   717k|    int a = edges & LR_HAVE_LEFT ? (left ? left[0][1] : src[-3]) : src[0];
  ------------------
  |  Branch (438:13): [True: 535k, False: 181k]
  |  Branch (438:37): [True: 505k, False: 30.5k]
  ------------------
  439|   717k|    int b = edges & LR_HAVE_LEFT ? (left ? left[0][2] : src[-2]) : src[0];
  ------------------
  |  Branch (439:13): [True: 535k, False: 181k]
  |  Branch (439:37): [True: 505k, False: 30.5k]
  ------------------
  440|   717k|    int c = edges & LR_HAVE_LEFT ? (left ? left[0][3] : src[-1]) : src[0];
  ------------------
  |  Branch (440:13): [True: 535k, False: 181k]
  |  Branch (440:37): [True: 505k, False: 30.5k]
  ------------------
  441|   717k|    int d = src[0];
  442|  87.9M|    for (int x = -1; x < w + 1; x++) {
  ------------------
  |  Branch (442:22): [True: 87.2M, False: 717k]
  ------------------
  443|  87.2M|        int e = (x + 2 < w || (edges & LR_HAVE_RIGHT)) ? src[x + 2] : src[w - 1];
  ------------------
  |  Branch (443:18): [True: 85.0M, False: 2.18M]
  |  Branch (443:31): [True: 1.64M, False: 534k]
  ------------------
  444|  87.2M|        sum[x] = a + b + c + d + e;
  445|  87.2M|        sumsq[x] = a * a + b * b + c * c + d * d + e * e;
  446|  87.2M|        a = b;
  447|  87.2M|        b = c;
  448|  87.2M|        c = d;
  449|  87.2M|        d = e;
  450|  87.2M|    }
  451|   717k|}
looprestoration_tmpl.c:sgr_box5_vert:
  531|   366k|{
  532|   366k|    sgr_box5_row_v(sumsq, sum, sumsq_out, sum_out, w);
  533|   366k|    sgr_calc_row_ab(sumsq_out, sum_out, w, s, bitdepth_max, 25, 164);
  534|   366k|    rotate5_x2(sumsq, sum);
  535|   366k|}
looprestoration_tmpl.c:sgr_box5_row_v:
  482|   365k|{
  483|  44.6M|    for (int x = 0; x < w + 2; x++) {
  ------------------
  |  Branch (483:21): [True: 44.2M, False: 365k]
  ------------------
  484|  44.2M|        int sq_a = sumsq[0][x];
  485|  44.2M|        int sq_b = sumsq[1][x];
  486|  44.2M|        int sq_c = sumsq[2][x];
  487|  44.2M|        int sq_d = sumsq[3][x];
  488|  44.2M|        int sq_e = sumsq[4][x];
  489|  44.2M|        int s_a = sum[0][x];
  490|  44.2M|        int s_b = sum[1][x];
  491|  44.2M|        int s_c = sum[2][x];
  492|  44.2M|        int s_d = sum[3][x];
  493|  44.2M|        int s_e = sum[4][x];
  494|  44.2M|        sumsq_out[x] = sq_a + sq_b + sq_c + sq_d + sq_e;
  495|  44.2M|        sum_out[x] = s_a + s_b + s_c + s_d + s_e;
  496|  44.2M|    }
  497|   365k|}
looprestoration_tmpl.c:sgr_calc_row_ab:
  501|  1.16M|{
  502|  1.16M|    const int bitdepth_min_8 = bitdepth_from_max(bitdepth_max) - 8;
  ------------------
  |  |   58|  1.16M|#define bitdepth_from_max(x) 8
  ------------------
  503|  96.2M|    for (int i = 0; i < w + 2; i++) {
  ------------------
  |  Branch (503:21): [True: 95.0M, False: 1.16M]
  ------------------
  504|  95.0M|        const int a =
  505|  95.0M|            (AA[i] + ((1 << (2 * bitdepth_min_8)) >> 1)) >> (2 * bitdepth_min_8);
  506|  95.0M|        const int b =
  507|  95.0M|            (BB[i] + ((1 << bitdepth_min_8) >> 1)) >> bitdepth_min_8;
  508|       |
  509|  95.0M|        const unsigned p = imax(a * n - b * b, 0);
  510|  95.0M|        const unsigned z = (p * s + (1 << 19)) >> 20;
  511|  95.0M|        const unsigned x = dav1d_sgr_x_by_x[umin(z, 255)];
  512|       |
  513|       |        // This is where we invert A and B, so that B is of size coef.
  514|  95.0M|        AA[i] = (x * BB[i] * sgr_one_by_x + (1 << 11)) >> 12;
  515|  95.0M|        BB[i] = x;
  516|  95.0M|    }
  517|  1.16M|}
looprestoration_tmpl.c:rotate5_x2:
  402|   350k|{
  403|   350k|    int32_t *tmp32[2];
  404|   350k|    coef *tmpc[2];
  405|   350k|    memcpy(tmp32, sumsq_ptrs, 2 * sizeof(int32_t*));
  406|   350k|    memcpy(tmpc, sum_ptrs, 2 * sizeof(coef*));
  407|   350k|    memmove(&sumsq_ptrs[0], &sumsq_ptrs[2], 3 * sizeof(int32_t*));
  408|   350k|    memmove(&sum_ptrs[0], &sum_ptrs[2], 3 * sizeof(coef*));
  409|   350k|    memcpy(&sumsq_ptrs[3], tmp32, 2 * sizeof(int32_t*));
  410|   350k|    memcpy(&sum_ptrs[3], tmpc, 2 * sizeof(coef*));
  411|   350k|}
looprestoration_tmpl.c:rotate:
  390|  1.79M|{
  391|  1.79M|    int32_t *tmp32 = sumsq_ptrs[0];
  392|  1.79M|    coef *tmpc = sum_ptrs[0];
  393|  5.55M|    for (int i = 0; i < n - 1; i++) {
  ------------------
  |  Branch (393:21): [True: 3.75M, False: 1.79M]
  ------------------
  394|  3.75M|        sumsq_ptrs[i] = sumsq_ptrs[i + 1];
  395|  3.75M|        sum_ptrs[i] = sum_ptrs[i + 1];
  396|  3.75M|    }
  397|  1.79M|    sumsq_ptrs[n - 1] = tmp32;
  398|  1.79M|    sum_ptrs[n - 1] = tmpc;
  399|  1.79M|}
looprestoration_tmpl.c:sgr_finish2:
  639|  82.3k|{
  640|  82.3k|    ALIGN_STK_16(coef, tmp, 2*FILTER_OUT_STRIDE,);
  ------------------
  |  |  100|  82.3k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  82.3k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  641|       |
  642|  82.3k|    sgr_finish_filter2(tmp, *dst, stride, A_ptrs, B_ptrs, w, h);
  643|  82.3k|    sgr_weighted_row1(*dst, tmp, w, w1 HIGHBD_TAIL_SUFFIX);
  644|  82.3k|    *dst += PXSTRIDE(stride);
  ------------------
  |  |   53|  82.3k|#define PXSTRIDE(x) (x)
  ------------------
  645|  82.3k|    if (h > 1) {
  ------------------
  |  Branch (645:9): [True: 80.3k, False: 1.97k]
  ------------------
  646|  80.3k|        sgr_weighted_row1(*dst, tmp + FILTER_OUT_STRIDE, w, w1 HIGHBD_TAIL_SUFFIX);
  ------------------
  |  |  566|  80.3k|#define FILTER_OUT_STRIDE (384)
  ------------------
  647|  80.3k|        *dst += PXSTRIDE(stride);
  ------------------
  |  |   53|  80.3k|#define PXSTRIDE(x) (x)
  ------------------
  648|  80.3k|    }
  649|  82.3k|    rotate(A_ptrs, B_ptrs, 2);
  650|  82.3k|}
looprestoration_tmpl.c:sgr_finish_filter2:
  573|   339k|{
  574|   339k|#define SIX_NEIGHBORS(P, i)\
  575|   339k|    ((P[0][i]     + P[1][i]) * 6 +   \
  576|   339k|     (P[0][i - 1] + P[1][i - 1] +    \
  577|   339k|      P[0][i + 1] + P[1][i + 1]) * 5)
  578|  41.6M|    for (int i = 0; i < w; i++) {
  ------------------
  |  Branch (578:21): [True: 41.3M, False: 339k]
  ------------------
  579|  41.3M|        const int a = SIX_NEIGHBORS(B_ptrs, i + 1);
  ------------------
  |  |  575|  41.3M|    ((P[0][i]     + P[1][i]) * 6 +   \
  |  |  576|  41.3M|     (P[0][i - 1] + P[1][i - 1] +    \
  |  |  577|  41.3M|      P[0][i + 1] + P[1][i + 1]) * 5)
  ------------------
  580|  41.3M|        const int b = SIX_NEIGHBORS(A_ptrs, i + 1);
  ------------------
  |  |  575|  41.3M|    ((P[0][i]     + P[1][i]) * 6 +   \
  |  |  576|  41.3M|     (P[0][i - 1] + P[1][i - 1] +    \
  |  |  577|  41.3M|      P[0][i + 1] + P[1][i + 1]) * 5)
  ------------------
  581|  41.3M|        tmp[i] = (b - a * src[i] + (1 << 8)) >> 9;
  582|  41.3M|    }
  583|   339k|    if (h <= 1)
  ------------------
  |  Branch (583:9): [True: 5.17k, False: 334k]
  ------------------
  584|  5.17k|        return;
  585|   334k|    tmp += FILTER_OUT_STRIDE;
  ------------------
  |  |  566|   334k|#define FILTER_OUT_STRIDE (384)
  ------------------
  586|   334k|    src += PXSTRIDE(src_stride);
  ------------------
  |  |   53|   334k|#define PXSTRIDE(x) (x)
  ------------------
  587|   334k|    const int32_t *A = &A_ptrs[1][1];
  588|   334k|    const coef *B = &B_ptrs[1][1];
  589|  41.5M|    for (int i = 0; i < w; i++) {
  ------------------
  |  Branch (589:21): [True: 41.2M, False: 334k]
  ------------------
  590|  41.2M|        const int a = B[i] * 6 + (B[i - 1] + B[i + 1]) * 5;
  591|  41.2M|        const int b = A[i] * 6 + (A[i - 1] + A[i + 1]) * 5;
  592|  41.2M|        tmp[i] = (b - a * src[i] + (1 << 7)) >> 8;
  593|  41.2M|    }
  594|   334k|#undef SIX_NEIGHBORS
  595|   334k|}
looprestoration_tmpl.c:sgr_weighted_row1:
  599|   403k|{
  600|  52.4M|    for (int i = 0; i < w; i++) {
  ------------------
  |  Branch (600:21): [True: 52.0M, False: 403k]
  ------------------
  601|  52.0M|        const int v = w1 * t1[i];
  602|  52.0M|        dst[i] = iclip_pixel(dst[i] + ((v + (1 << 10)) >> 11));
  ------------------
  |  |   49|  52.0M|#define iclip_pixel iclip_u8
  ------------------
  603|  52.0M|    }
  604|   403k|}
looprestoration_tmpl.c:sgr_3x3_c:
  678|  7.01k|{
  679|  7.01k|#define BUF_STRIDE (384 + 16)
  680|  7.01k|    ALIGN_STK_16(int32_t, sumsq_buf, BUF_STRIDE * 3 + 16,);
  ------------------
  |  |  100|  7.01k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  7.01k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  681|  7.01k|    ALIGN_STK_16(coef, sum_buf, BUF_STRIDE * 3 + 16,);
  ------------------
  |  |  100|  7.01k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  7.01k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  682|  7.01k|    int32_t *sumsq_ptrs[3], *sumsq_rows[3];
  683|  7.01k|    coef *sum_ptrs[3], *sum_rows[3];
  684|  28.0k|    for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (684:21): [True: 21.0k, False: 7.01k]
  ------------------
  685|  21.0k|        sumsq_rows[i] = &sumsq_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  21.0k|#define BUF_STRIDE (384 + 16)
  ------------------
  686|  21.0k|        sum_rows[i] = &sum_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  21.0k|#define BUF_STRIDE (384 + 16)
  ------------------
  687|  21.0k|    }
  688|       |
  689|  7.01k|    ALIGN_STK_16(int32_t, A_buf, BUF_STRIDE * 3 + 16,);
  ------------------
  |  |  100|  7.01k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  7.01k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  690|  7.01k|    ALIGN_STK_16(coef, B_buf, BUF_STRIDE * 3 + 16,);
  ------------------
  |  |  100|  7.01k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  7.01k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  691|  7.01k|    int32_t *A_ptrs[3];
  692|  7.01k|    coef *B_ptrs[3];
  693|  28.0k|    for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (693:21): [True: 21.0k, False: 7.01k]
  ------------------
  694|  21.0k|        A_ptrs[i] = &A_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  21.0k|#define BUF_STRIDE (384 + 16)
  ------------------
  695|  21.0k|        B_ptrs[i] = &B_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  21.0k|#define BUF_STRIDE (384 + 16)
  ------------------
  696|  21.0k|    }
  697|  7.01k|    const pixel *src = dst;
  698|  7.01k|    const pixel *lpf_bottom = lpf + 6*PXSTRIDE(stride);
  ------------------
  |  |   53|  7.01k|#define PXSTRIDE(x) (x)
  ------------------
  699|       |
  700|  7.01k|    if (edges & LR_HAVE_TOP) {
  ------------------
  |  Branch (700:9): [True: 3.84k, False: 3.16k]
  ------------------
  701|  3.84k|        sumsq_ptrs[0] = sumsq_rows[0];
  702|  3.84k|        sumsq_ptrs[1] = sumsq_rows[1];
  703|  3.84k|        sumsq_ptrs[2] = sumsq_rows[2];
  704|  3.84k|        sum_ptrs[0] = sum_rows[0];
  705|  3.84k|        sum_ptrs[1] = sum_rows[1];
  706|  3.84k|        sum_ptrs[2] = sum_rows[2];
  707|       |
  708|  3.84k|        sgr_box3_row_h(sumsq_rows[0], sum_rows[0], NULL, lpf, w, edges);
  709|  3.84k|        lpf += PXSTRIDE(stride);
  ------------------
  |  |   53|  3.84k|#define PXSTRIDE(x) (x)
  ------------------
  710|  3.84k|        sgr_box3_row_h(sumsq_rows[1], sum_rows[1], NULL, lpf, w, edges);
  711|       |
  712|  3.84k|        sgr_box3_hv(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  713|  3.84k|                    left, src, w, params->sgr.s1, edges, BITDEPTH_MAX);
  ------------------
  |  |   59|  3.84k|#define BITDEPTH_MAX 0xff
  ------------------
  714|  3.84k|        left++;
  715|  3.84k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  3.84k|#define PXSTRIDE(x) (x)
  ------------------
  716|  3.84k|        rotate(A_ptrs, B_ptrs, 3);
  717|       |
  718|  3.84k|        if (--h <= 0)
  ------------------
  |  Branch (718:13): [True: 198, False: 3.65k]
  ------------------
  719|    198|            goto vert_1;
  720|       |
  721|  3.65k|        sgr_box3_hv(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  722|  3.65k|                    left, src, w, params->sgr.s1, edges, BITDEPTH_MAX);
  ------------------
  |  |   59|  3.65k|#define BITDEPTH_MAX 0xff
  ------------------
  723|  3.65k|        left++;
  724|  3.65k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  3.65k|#define PXSTRIDE(x) (x)
  ------------------
  725|  3.65k|        rotate(A_ptrs, B_ptrs, 3);
  726|       |
  727|  3.65k|        if (--h <= 0)
  ------------------
  |  Branch (727:13): [True: 757, False: 2.89k]
  ------------------
  728|    757|            goto vert_2;
  729|  3.65k|    } else {
  730|  3.16k|        sumsq_ptrs[0] = sumsq_rows[0];
  731|  3.16k|        sumsq_ptrs[1] = sumsq_rows[0];
  732|  3.16k|        sumsq_ptrs[2] = sumsq_rows[0];
  733|  3.16k|        sum_ptrs[0] = sum_rows[0];
  734|  3.16k|        sum_ptrs[1] = sum_rows[0];
  735|  3.16k|        sum_ptrs[2] = sum_rows[0];
  736|       |
  737|  3.16k|        sgr_box3_row_h(sumsq_rows[0], sum_rows[0], left, src, w, edges);
  738|  3.16k|        left++;
  739|  3.16k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  3.16k|#define PXSTRIDE(x) (x)
  ------------------
  740|       |
  741|  3.16k|        sgr_box3_vert(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  742|  3.16k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  3.16k|#define BITDEPTH_MAX 0xff
  ------------------
  743|  3.16k|        rotate(A_ptrs, B_ptrs, 3);
  744|       |
  745|  3.16k|        if (--h <= 0)
  ------------------
  |  Branch (745:13): [True: 790, False: 2.37k]
  ------------------
  746|    790|            goto vert_1;
  747|       |
  748|  2.37k|        sumsq_ptrs[2] = sumsq_rows[1];
  749|  2.37k|        sum_ptrs[2] = sum_rows[1];
  750|       |
  751|  2.37k|        sgr_box3_hv(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  752|  2.37k|                    left, src, w, params->sgr.s1, edges, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.37k|#define BITDEPTH_MAX 0xff
  ------------------
  753|  2.37k|        left++;
  754|  2.37k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.37k|#define PXSTRIDE(x) (x)
  ------------------
  755|  2.37k|        rotate(A_ptrs, B_ptrs, 3);
  756|       |
  757|  2.37k|        if (--h <= 0)
  ------------------
  |  Branch (757:13): [True: 324, False: 2.05k]
  ------------------
  758|    324|            goto vert_2;
  759|       |
  760|  2.05k|        sumsq_ptrs[2] = sumsq_rows[2];
  761|  2.05k|        sum_ptrs[2] = sum_rows[2];
  762|  2.05k|    }
  763|       |
  764|   227k|    do {
  765|   227k|        sgr_box3_hv(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  766|   227k|                    left, src, w, params->sgr.s1, edges, BITDEPTH_MAX);
  ------------------
  |  |   59|   227k|#define BITDEPTH_MAX 0xff
  ------------------
  767|   227k|        left++;
  768|   227k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|   227k|#define PXSTRIDE(x) (x)
  ------------------
  769|       |
  770|   227k|        sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
  771|   227k|                    w, params->sgr.w1 HIGHBD_TAIL_SUFFIX);
  772|   227k|    } while (--h > 0);
  ------------------
  |  Branch (772:14): [True: 222k, False: 4.94k]
  ------------------
  773|       |
  774|  4.94k|    if (!(edges & LR_HAVE_BOTTOM))
  ------------------
  |  Branch (774:9): [True: 1.08k, False: 3.86k]
  ------------------
  775|  1.08k|        goto vert_2;
  776|       |
  777|  3.86k|    sgr_box3_hv(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  778|  3.86k|                NULL, lpf_bottom, w, params->sgr.s1, edges, BITDEPTH_MAX);
  ------------------
  |  |   59|  3.86k|#define BITDEPTH_MAX 0xff
  ------------------
  779|  3.86k|    lpf_bottom += PXSTRIDE(stride);
  ------------------
  |  |   53|  3.86k|#define PXSTRIDE(x) (x)
  ------------------
  780|       |
  781|  3.86k|    sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
  782|  3.86k|                w, params->sgr.w1 HIGHBD_TAIL_SUFFIX);
  783|       |
  784|  3.86k|    sgr_box3_hv(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  785|  3.86k|                NULL, lpf_bottom, w, params->sgr.s1, edges, BITDEPTH_MAX);
  ------------------
  |  |   59|  3.86k|#define BITDEPTH_MAX 0xff
  ------------------
  786|       |
  787|  3.86k|    sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
  788|  3.86k|                w, params->sgr.w1 HIGHBD_TAIL_SUFFIX);
  789|  3.86k|    return;
  790|       |
  791|  2.16k|vert_2:
  792|  2.16k|    sumsq_ptrs[2] = sumsq_ptrs[1];
  793|  2.16k|    sum_ptrs[2] = sum_ptrs[1];
  794|  2.16k|    sgr_box3_vert(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  795|  2.16k|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.16k|#define BITDEPTH_MAX 0xff
  ------------------
  796|       |
  797|  2.16k|    sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
  798|  2.16k|                w, params->sgr.w1 HIGHBD_TAIL_SUFFIX);
  799|       |
  800|  3.15k|output_1:
  801|  3.15k|    sumsq_ptrs[2] = sumsq_ptrs[1];
  802|  3.15k|    sum_ptrs[2] = sum_ptrs[1];
  803|  3.15k|    sgr_box3_vert(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  804|  3.15k|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  3.15k|#define BITDEPTH_MAX 0xff
  ------------------
  805|       |
  806|  3.15k|    sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
  807|  3.15k|                w, params->sgr.w1 HIGHBD_TAIL_SUFFIX);
  808|  3.15k|    return;
  809|       |
  810|    988|vert_1:
  811|    988|    sumsq_ptrs[2] = sumsq_ptrs[1];
  812|    988|    sum_ptrs[2] = sum_ptrs[1];
  813|    988|    sgr_box3_vert(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  814|    988|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|    988|#define BITDEPTH_MAX 0xff
  ------------------
  815|    988|    rotate(A_ptrs, B_ptrs, 3);
  816|    988|    goto output_1;
  817|  2.16k|}
looprestoration_tmpl.c:sgr_box3_row_h:
  417|   778k|{
  418|   778k|    sumsq++;
  419|   778k|    sum++;
  420|   778k|    int a = edges & LR_HAVE_LEFT ? (left ? left[0][2] : src[-2]) : src[0];
  ------------------
  |  Branch (420:13): [True: 608k, False: 169k]
  |  Branch (420:37): [True: 573k, False: 35.2k]
  ------------------
  421|   778k|    int b = edges & LR_HAVE_LEFT ? (left ? left[0][3] : src[-1]) : src[0];
  ------------------
  |  Branch (421:13): [True: 609k, False: 169k]
  |  Branch (421:37): [True: 573k, False: 35.2k]
  ------------------
  422|  92.2M|    for (int x = -1; x < w + 1; x++) {
  ------------------
  |  Branch (422:22): [True: 91.5M, False: 778k]
  ------------------
  423|  91.5M|        int c = (x + 1 < w || (edges & LR_HAVE_RIGHT)) ? src[x + 1] : src[w - 1];
  ------------------
  |  Branch (423:18): [True: 89.9M, False: 1.60M]
  |  Branch (423:31): [True: 1.22M, False: 379k]
  ------------------
  424|  91.5M|        sum[x] = a + b + c;
  425|  91.5M|        sumsq[x] = a * a + b * b + c * c;
  426|  91.5M|        a = b;
  427|  91.5M|        b = c;
  428|  91.5M|    }
  429|   778k|}
looprestoration_tmpl.c:sgr_box3_hv:
  544|   244k|{
  545|   244k|    sgr_box3_row_h(sumsq[2], sum[2], left, src, w, edges);
  546|   244k|    sgr_box3_vert(sumsq, sum, AA, BB, w, s, bitdepth_max);
  547|   244k|}
looprestoration_tmpl.c:sgr_box3_vert:
  522|   780k|{
  523|   780k|    sgr_box3_row_v(sumsq, sum, sumsq_out, sum_out, w);
  524|   780k|    sgr_calc_row_ab(sumsq_out, sum_out, w, s, bitdepth_max, 9, 455);
  525|   780k|    rotate(sumsq, sum, 3);
  526|   780k|}
looprestoration_tmpl.c:sgr_box3_row_v:
  466|   780k|{
  467|  92.8M|    for (int x = 0; x < w + 2; x++) {
  ------------------
  |  Branch (467:21): [True: 92.0M, False: 780k]
  ------------------
  468|  92.0M|        int sq_a = sumsq[0][x];
  469|  92.0M|        int sq_b = sumsq[1][x];
  470|  92.0M|        int sq_c = sumsq[2][x];
  471|  92.0M|        int s_a = sum[0][x];
  472|  92.0M|        int s_b = sum[1][x];
  473|  92.0M|        int s_c = sum[2][x];
  474|  92.0M|        sumsq_out[x] = sq_a + sq_b + sq_c;
  475|  92.0M|        sum_out[x] = s_a + s_b + s_c;
  476|  92.0M|    }
  477|   780k|}
looprestoration_tmpl.c:sgr_finish1:
  625|   238k|{
  626|       |    // Only one single row, no stride needed
  627|   238k|    ALIGN_STK_16(coef, tmp, 384,);
  ------------------
  |  |  100|   238k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|   238k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  628|       |
  629|   238k|    sgr_finish_filter_row1(tmp, *dst, A_ptrs, B_ptrs, w);
  630|   238k|    sgr_weighted_row1(*dst, tmp, w, w1 HIGHBD_TAIL_SUFFIX);
  631|   238k|    *dst += PXSTRIDE(stride);
  ------------------
  |  |   53|   238k|#define PXSTRIDE(x) (x)
  ------------------
  632|   238k|    rotate(A_ptrs, B_ptrs, 3);
  633|   238k|}
looprestoration_tmpl.c:sgr_finish_filter_row1:
  553|   752k|{
  554|   752k|#define EIGHT_NEIGHBORS(P, i)\
  555|   752k|    ((P[1][i] + P[1][i - 1] + P[1][i + 1] + P[0][i] + P[2][i]) * 4 + \
  556|   752k|     (P[0][i - 1] + P[2][i - 1] +                           \
  557|   752k|      P[0][i + 1] + P[2][i + 1]) * 3)
  558|  86.6M|    for (int i = 0; i < w; i++) {
  ------------------
  |  Branch (558:21): [True: 85.9M, False: 752k]
  ------------------
  559|  85.9M|        const int a = EIGHT_NEIGHBORS(B_ptrs, i + 1);
  ------------------
  |  |  555|  85.9M|    ((P[1][i] + P[1][i - 1] + P[1][i + 1] + P[0][i] + P[2][i]) * 4 + \
  |  |  556|  85.9M|     (P[0][i - 1] + P[2][i - 1] +                           \
  |  |  557|  85.9M|      P[0][i + 1] + P[2][i + 1]) * 3)
  ------------------
  560|  85.9M|        const int b = EIGHT_NEIGHBORS(A_ptrs, i + 1);
  ------------------
  |  |  555|  85.9M|    ((P[1][i] + P[1][i - 1] + P[1][i + 1] + P[0][i] + P[2][i]) * 4 + \
  |  |  556|  85.9M|     (P[0][i - 1] + P[2][i - 1] +                           \
  |  |  557|  85.9M|      P[0][i + 1] + P[2][i + 1]) * 3)
  ------------------
  561|  85.9M|        tmp[i] = (b - a * src[i] + (1 << 8)) >> 9;
  562|  85.9M|    }
  563|   752k|#undef EIGHT_NEIGHBORS
  564|   752k|}
looprestoration_tmpl.c:sgr_mix_c:
 1026|  14.2k|{
 1027|  14.2k|    ALIGN_STK_16(int32_t, sumsq5_buf, BUF_STRIDE * 5 + 16,);
  ------------------
  |  |  100|  14.2k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  14.2k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1028|  14.2k|    ALIGN_STK_16(coef, sum5_buf, BUF_STRIDE * 5 + 16,);
  ------------------
  |  |  100|  14.2k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  14.2k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1029|  14.2k|    int32_t *sumsq5_ptrs[5], *sumsq5_rows[5];
 1030|  14.2k|    coef *sum5_ptrs[5], *sum5_rows[5];
 1031|  85.3k|    for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1031:21): [True: 71.1k, False: 14.2k]
  ------------------
 1032|  71.1k|        sumsq5_rows[i] = &sumsq5_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  71.1k|#define BUF_STRIDE (384 + 16)
  ------------------
 1033|  71.1k|        sum5_rows[i] = &sum5_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  71.1k|#define BUF_STRIDE (384 + 16)
  ------------------
 1034|  71.1k|    }
 1035|  14.2k|    ALIGN_STK_16(int32_t, sumsq3_buf, BUF_STRIDE * 3 + 16,);
  ------------------
  |  |  100|  14.2k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  14.2k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1036|  14.2k|    ALIGN_STK_16(coef, sum3_buf, BUF_STRIDE * 3 + 16,);
  ------------------
  |  |  100|  14.2k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  14.2k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1037|  14.2k|    int32_t *sumsq3_ptrs[3], *sumsq3_rows[3];
 1038|  14.2k|    coef *sum3_ptrs[3], *sum3_rows[3];
 1039|  56.8k|    for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (1039:21): [True: 42.6k, False: 14.2k]
  ------------------
 1040|  42.6k|        sumsq3_rows[i] = &sumsq3_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  42.6k|#define BUF_STRIDE (384 + 16)
  ------------------
 1041|  42.6k|        sum3_rows[i] = &sum3_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  42.6k|#define BUF_STRIDE (384 + 16)
  ------------------
 1042|  42.6k|    }
 1043|       |
 1044|  14.2k|    ALIGN_STK_16(int32_t, A5_buf, BUF_STRIDE * 2 + 16,);
  ------------------
  |  |  100|  14.2k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  14.2k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1045|  14.2k|    ALIGN_STK_16(coef, B5_buf, BUF_STRIDE * 2 + 16,);
  ------------------
  |  |  100|  14.2k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  14.2k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1046|  14.2k|    int32_t *A5_ptrs[2];
 1047|  14.2k|    coef *B5_ptrs[2];
 1048|  42.6k|    for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1048:21): [True: 28.4k, False: 14.2k]
  ------------------
 1049|  28.4k|        A5_ptrs[i] = &A5_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  28.4k|#define BUF_STRIDE (384 + 16)
  ------------------
 1050|  28.4k|        B5_ptrs[i] = &B5_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  28.4k|#define BUF_STRIDE (384 + 16)
  ------------------
 1051|  28.4k|    }
 1052|  14.2k|    ALIGN_STK_16(int32_t, A3_buf, BUF_STRIDE * 4 + 16,);
  ------------------
  |  |  100|  14.2k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  14.2k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1053|  14.2k|    ALIGN_STK_16(coef, B3_buf, BUF_STRIDE * 4 + 16,);
  ------------------
  |  |  100|  14.2k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  14.2k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1054|  14.2k|    int32_t *A3_ptrs[4];
 1055|  14.2k|    coef *B3_ptrs[4];
 1056|  71.1k|    for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (1056:21): [True: 56.8k, False: 14.2k]
  ------------------
 1057|  56.8k|        A3_ptrs[i] = &A3_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  56.8k|#define BUF_STRIDE (384 + 16)
  ------------------
 1058|  56.8k|        B3_ptrs[i] = &B3_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  56.8k|#define BUF_STRIDE (384 + 16)
  ------------------
 1059|  56.8k|    }
 1060|  14.2k|    const pixel *src = dst;
 1061|  14.2k|    const pixel *lpf_bottom = lpf + 6*PXSTRIDE(stride);
  ------------------
  |  |   53|  14.2k|#define PXSTRIDE(x) (x)
  ------------------
 1062|       |
 1063|  14.2k|    if (edges & LR_HAVE_TOP) {
  ------------------
  |  Branch (1063:9): [True: 8.01k, False: 6.20k]
  ------------------
 1064|  8.01k|        sumsq5_ptrs[0] = sumsq5_rows[0];
 1065|  8.01k|        sumsq5_ptrs[1] = sumsq5_rows[0];
 1066|  8.01k|        sumsq5_ptrs[2] = sumsq5_rows[1];
 1067|  8.01k|        sumsq5_ptrs[3] = sumsq5_rows[2];
 1068|  8.01k|        sumsq5_ptrs[4] = sumsq5_rows[3];
 1069|  8.01k|        sum5_ptrs[0] = sum5_rows[0];
 1070|  8.01k|        sum5_ptrs[1] = sum5_rows[0];
 1071|  8.01k|        sum5_ptrs[2] = sum5_rows[1];
 1072|  8.01k|        sum5_ptrs[3] = sum5_rows[2];
 1073|  8.01k|        sum5_ptrs[4] = sum5_rows[3];
 1074|       |
 1075|  8.01k|        sumsq3_ptrs[0] = sumsq3_rows[0];
 1076|  8.01k|        sumsq3_ptrs[1] = sumsq3_rows[1];
 1077|  8.01k|        sumsq3_ptrs[2] = sumsq3_rows[2];
 1078|  8.01k|        sum3_ptrs[0] = sum3_rows[0];
 1079|  8.01k|        sum3_ptrs[1] = sum3_rows[1];
 1080|  8.01k|        sum3_ptrs[2] = sum3_rows[2];
 1081|       |
 1082|  8.01k|        sgr_box35_row_h(sumsq3_rows[0], sum3_rows[0],
 1083|  8.01k|                        sumsq5_rows[0], sum5_rows[0],
 1084|  8.01k|                        NULL, lpf, w, edges);
 1085|  8.01k|        lpf += PXSTRIDE(stride);
  ------------------
  |  |   53|  8.01k|#define PXSTRIDE(x) (x)
  ------------------
 1086|  8.01k|        sgr_box35_row_h(sumsq3_rows[1], sum3_rows[1],
 1087|  8.01k|                        sumsq5_rows[1], sum5_rows[1],
 1088|  8.01k|                        NULL, lpf, w, edges);
 1089|       |
 1090|  8.01k|        sgr_box35_row_h(sumsq3_rows[2], sum3_rows[2],
 1091|  8.01k|                        sumsq5_rows[2], sum5_rows[2],
 1092|  8.01k|                        left, src, w, edges);
 1093|  8.01k|        left++;
 1094|  8.01k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  8.01k|#define PXSTRIDE(x) (x)
  ------------------
 1095|       |
 1096|  8.01k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1097|  8.01k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  8.01k|#define BITDEPTH_MAX 0xff
  ------------------
 1098|  8.01k|        rotate(A3_ptrs, B3_ptrs, 4);
 1099|       |
 1100|  8.01k|        if (--h <= 0)
  ------------------
  |  Branch (1100:13): [True: 503, False: 7.51k]
  ------------------
 1101|    503|            goto vert_1;
 1102|       |
 1103|  7.51k|        sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
 1104|  7.51k|                        sumsq5_rows[3], sum5_rows[3],
 1105|  7.51k|                        left, src, w, edges);
 1106|  7.51k|        left++;
 1107|  7.51k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  7.51k|#define PXSTRIDE(x) (x)
  ------------------
 1108|  7.51k|        sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1109|  7.51k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  7.51k|#define BITDEPTH_MAX 0xff
  ------------------
 1110|  7.51k|        rotate(A5_ptrs, B5_ptrs, 2);
 1111|  7.51k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1112|  7.51k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  7.51k|#define BITDEPTH_MAX 0xff
  ------------------
 1113|  7.51k|        rotate(A3_ptrs, B3_ptrs, 4);
 1114|       |
 1115|  7.51k|        if (--h <= 0)
  ------------------
  |  Branch (1115:13): [True: 1.34k, False: 6.16k]
  ------------------
 1116|  1.34k|            goto vert_2;
 1117|       |
 1118|       |        // ptrs are rotated by 2; both [3] and [4] now point at rows[0]; set
 1119|       |        // one of them to point at the previously unused rows[4].
 1120|  6.16k|        sumsq5_ptrs[3] = sumsq5_rows[4];
 1121|  6.16k|        sum5_ptrs[3] = sum5_rows[4];
 1122|  6.20k|    } else {
 1123|  6.20k|        sumsq5_ptrs[0] = sumsq5_rows[0];
 1124|  6.20k|        sumsq5_ptrs[1] = sumsq5_rows[0];
 1125|  6.20k|        sumsq5_ptrs[2] = sumsq5_rows[0];
 1126|  6.20k|        sumsq5_ptrs[3] = sumsq5_rows[0];
 1127|  6.20k|        sumsq5_ptrs[4] = sumsq5_rows[0];
 1128|  6.20k|        sum5_ptrs[0] = sum5_rows[0];
 1129|  6.20k|        sum5_ptrs[1] = sum5_rows[0];
 1130|  6.20k|        sum5_ptrs[2] = sum5_rows[0];
 1131|  6.20k|        sum5_ptrs[3] = sum5_rows[0];
 1132|  6.20k|        sum5_ptrs[4] = sum5_rows[0];
 1133|       |
 1134|  6.20k|        sumsq3_ptrs[0] = sumsq3_rows[0];
 1135|  6.20k|        sumsq3_ptrs[1] = sumsq3_rows[0];
 1136|  6.20k|        sumsq3_ptrs[2] = sumsq3_rows[0];
 1137|  6.20k|        sum3_ptrs[0] = sum3_rows[0];
 1138|  6.20k|        sum3_ptrs[1] = sum3_rows[0];
 1139|  6.20k|        sum3_ptrs[2] = sum3_rows[0];
 1140|       |
 1141|  6.20k|        sgr_box35_row_h(sumsq3_rows[0], sum3_rows[0],
 1142|  6.20k|                        sumsq5_rows[0], sum5_rows[0],
 1143|  6.20k|                        left, src, w, edges);
 1144|  6.20k|        left++;
 1145|  6.20k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  6.20k|#define PXSTRIDE(x) (x)
  ------------------
 1146|       |
 1147|  6.20k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1148|  6.20k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  6.20k|#define BITDEPTH_MAX 0xff
  ------------------
 1149|  6.20k|        rotate(A3_ptrs, B3_ptrs, 4);
 1150|       |
 1151|  6.20k|        if (--h <= 0)
  ------------------
  |  Branch (1151:13): [True: 805, False: 5.40k]
  ------------------
 1152|    805|            goto vert_1;
 1153|       |
 1154|  5.40k|        sumsq5_ptrs[4] = sumsq5_rows[1];
 1155|  5.40k|        sum5_ptrs[4] = sum5_rows[1];
 1156|       |
 1157|  5.40k|        sumsq3_ptrs[2] = sumsq3_rows[1];
 1158|  5.40k|        sum3_ptrs[2] = sum3_rows[1];
 1159|       |
 1160|  5.40k|        sgr_box35_row_h(sumsq3_rows[1], sum3_rows[1],
 1161|  5.40k|                        sumsq5_rows[1], sum5_rows[1],
 1162|  5.40k|                        left, src, w, edges);
 1163|  5.40k|        left++;
 1164|  5.40k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  5.40k|#define PXSTRIDE(x) (x)
  ------------------
 1165|       |
 1166|  5.40k|        sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1167|  5.40k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  5.40k|#define BITDEPTH_MAX 0xff
  ------------------
 1168|  5.40k|        rotate(A5_ptrs, B5_ptrs, 2);
 1169|  5.40k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1170|  5.40k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  5.40k|#define BITDEPTH_MAX 0xff
  ------------------
 1171|  5.40k|        rotate(A3_ptrs, B3_ptrs, 4);
 1172|       |
 1173|  5.40k|        if (--h <= 0)
  ------------------
  |  Branch (1173:13): [True: 763, False: 4.63k]
  ------------------
 1174|    763|            goto vert_2;
 1175|       |
 1176|  4.63k|        sumsq5_ptrs[3] = sumsq5_rows[2];
 1177|  4.63k|        sumsq5_ptrs[4] = sumsq5_rows[3];
 1178|  4.63k|        sum5_ptrs[3] = sum5_rows[2];
 1179|  4.63k|        sum5_ptrs[4] = sum5_rows[3];
 1180|       |
 1181|  4.63k|        sumsq3_ptrs[2] = sumsq3_rows[2];
 1182|  4.63k|        sum3_ptrs[2] = sum3_rows[2];
 1183|       |
 1184|  4.63k|        sgr_box35_row_h(sumsq3_rows[2], sum3_rows[2],
 1185|  4.63k|                        sumsq5_rows[2], sum5_rows[2],
 1186|  4.63k|                        left, src, w, edges);
 1187|  4.63k|        left++;
 1188|  4.63k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  4.63k|#define PXSTRIDE(x) (x)
  ------------------
 1189|       |
 1190|  4.63k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1191|  4.63k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  4.63k|#define BITDEPTH_MAX 0xff
  ------------------
 1192|  4.63k|        rotate(A3_ptrs, B3_ptrs, 4);
 1193|       |
 1194|  4.63k|        if (--h <= 0)
  ------------------
  |  Branch (1194:13): [True: 431, False: 4.20k]
  ------------------
 1195|    431|            goto odd;
 1196|       |
 1197|  4.20k|        sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
 1198|  4.20k|                        sumsq5_rows[3], sum5_rows[3],
 1199|  4.20k|                        left, src, w, edges);
 1200|  4.20k|        left++;
 1201|  4.20k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  4.20k|#define PXSTRIDE(x) (x)
  ------------------
 1202|       |
 1203|  4.20k|        sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1204|  4.20k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  4.20k|#define BITDEPTH_MAX 0xff
  ------------------
 1205|  4.20k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1206|  4.20k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  4.20k|#define BITDEPTH_MAX 0xff
  ------------------
 1207|  4.20k|        sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
 1208|  4.20k|                       w, 2, params->sgr.w0, params->sgr.w1
 1209|  4.20k|                       HIGHBD_TAIL_SUFFIX);
 1210|       |
 1211|  4.20k|        if (--h <= 0)
  ------------------
  |  Branch (1211:13): [True: 295, False: 3.91k]
  ------------------
 1212|    295|            goto vert_2;
 1213|       |
 1214|       |        // ptrs are rotated by 2; both [3] and [4] now point at rows[0]; set
 1215|       |        // one of them to point at the previously unused rows[4].
 1216|  3.91k|        sumsq5_ptrs[3] = sumsq5_rows[4];
 1217|  3.91k|        sum5_ptrs[3] = sum5_rows[4];
 1218|  3.91k|    }
 1219|       |
 1220|   240k|    do {
 1221|   240k|        sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
 1222|   240k|                        sumsq5_ptrs[3], sum5_ptrs[3],
 1223|   240k|                        left, src, w, edges);
 1224|   240k|        left++;
 1225|   240k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|   240k|#define PXSTRIDE(x) (x)
  ------------------
 1226|       |
 1227|   240k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1228|   240k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|   240k|#define BITDEPTH_MAX 0xff
  ------------------
 1229|   240k|        rotate(A3_ptrs, B3_ptrs, 4);
 1230|       |
 1231|   240k|        if (--h <= 0)
  ------------------
  |  Branch (1231:13): [True: 1.37k, False: 239k]
  ------------------
 1232|  1.37k|            goto odd;
 1233|       |
 1234|   239k|        sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
 1235|   239k|                        sumsq5_ptrs[4], sum5_ptrs[4],
 1236|   239k|                        left, src, w, edges);
 1237|   239k|        left++;
 1238|   239k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|   239k|#define PXSTRIDE(x) (x)
  ------------------
 1239|       |
 1240|   239k|        sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1241|   239k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|   239k|#define BITDEPTH_MAX 0xff
  ------------------
 1242|   239k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1243|   239k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|   239k|#define BITDEPTH_MAX 0xff
  ------------------
 1244|   239k|        sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
 1245|   239k|                       w, 2, params->sgr.w0, params->sgr.w1
 1246|   239k|                       HIGHBD_TAIL_SUFFIX);
 1247|   239k|    } while (--h > 0);
  ------------------
  |  Branch (1247:14): [True: 230k, False: 8.69k]
  ------------------
 1248|       |
 1249|  8.69k|    if (!(edges & LR_HAVE_BOTTOM))
  ------------------
  |  Branch (1249:9): [True: 676, False: 8.02k]
  ------------------
 1250|    676|        goto vert_2;
 1251|       |
 1252|  8.02k|    sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
 1253|  8.02k|                    sumsq5_ptrs[3], sum5_ptrs[3],
 1254|  8.02k|                    NULL, lpf_bottom, w, edges);
 1255|  8.02k|    lpf_bottom += PXSTRIDE(stride);
  ------------------
  |  |   53|  8.02k|#define PXSTRIDE(x) (x)
  ------------------
 1256|  8.02k|    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1257|  8.02k|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  8.02k|#define BITDEPTH_MAX 0xff
  ------------------
 1258|  8.02k|    rotate(A3_ptrs, B3_ptrs, 4);
 1259|       |
 1260|  8.02k|    sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
 1261|  8.02k|                    sumsq5_ptrs[4], sum5_ptrs[4],
 1262|  8.02k|                    NULL, lpf_bottom, w, edges);
 1263|       |
 1264|  11.0k|output_2:
 1265|  11.0k|    sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1266|  11.0k|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  11.0k|#define BITDEPTH_MAX 0xff
  ------------------
 1267|  11.0k|    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1268|  11.0k|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  11.0k|#define BITDEPTH_MAX 0xff
  ------------------
 1269|  11.0k|    sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
 1270|  11.0k|                   w, 2, params->sgr.w0, params->sgr.w1
 1271|  11.0k|                   HIGHBD_TAIL_SUFFIX);
 1272|  11.0k|    return;
 1273|       |
 1274|  3.08k|vert_2:
 1275|       |    // Duplicate the last row twice more
 1276|  3.08k|    sumsq5_ptrs[3] = sumsq5_ptrs[2];
 1277|  3.08k|    sumsq5_ptrs[4] = sumsq5_ptrs[2];
 1278|  3.08k|    sum5_ptrs[3] = sum5_ptrs[2];
 1279|  3.08k|    sum5_ptrs[4] = sum5_ptrs[2];
 1280|       |
 1281|  3.08k|    sumsq3_ptrs[2] = sumsq3_ptrs[1];
 1282|  3.08k|    sum3_ptrs[2] = sum3_ptrs[1];
 1283|  3.08k|    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1284|  3.08k|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  3.08k|#define BITDEPTH_MAX 0xff
  ------------------
 1285|  3.08k|    rotate(A3_ptrs, B3_ptrs, 4);
 1286|       |
 1287|  3.08k|    sumsq3_ptrs[2] = sumsq3_ptrs[1];
 1288|  3.08k|    sum3_ptrs[2] = sum3_ptrs[1];
 1289|       |
 1290|  3.08k|    goto output_2;
 1291|       |
 1292|  1.80k|odd:
 1293|       |    // Copy the last row as padding once
 1294|  1.80k|    sumsq5_ptrs[4] = sumsq5_ptrs[3];
 1295|  1.80k|    sum5_ptrs[4] = sum5_ptrs[3];
 1296|       |
 1297|  1.80k|    sumsq3_ptrs[2] = sumsq3_ptrs[1];
 1298|  1.80k|    sum3_ptrs[2] = sum3_ptrs[1];
 1299|       |
 1300|  1.80k|    sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1301|  1.80k|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.80k|#define BITDEPTH_MAX 0xff
  ------------------
 1302|  1.80k|    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1303|  1.80k|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.80k|#define BITDEPTH_MAX 0xff
  ------------------
 1304|  1.80k|    sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
 1305|  1.80k|                   w, 2, params->sgr.w0, params->sgr.w1
 1306|  1.80k|                   HIGHBD_TAIL_SUFFIX);
 1307|       |
 1308|  3.11k|output_1:
 1309|       |    // Duplicate the last row twice more
 1310|  3.11k|    sumsq5_ptrs[3] = sumsq5_ptrs[2];
 1311|  3.11k|    sumsq5_ptrs[4] = sumsq5_ptrs[2];
 1312|  3.11k|    sum5_ptrs[3] = sum5_ptrs[2];
 1313|  3.11k|    sum5_ptrs[4] = sum5_ptrs[2];
 1314|       |
 1315|  3.11k|    sumsq3_ptrs[2] = sumsq3_ptrs[1];
 1316|  3.11k|    sum3_ptrs[2] = sum3_ptrs[1];
 1317|       |
 1318|  3.11k|    sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1319|  3.11k|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  3.11k|#define BITDEPTH_MAX 0xff
  ------------------
 1320|  3.11k|    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1321|  3.11k|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  3.11k|#define BITDEPTH_MAX 0xff
  ------------------
 1322|  3.11k|    rotate(A3_ptrs, B3_ptrs, 4);
 1323|       |    // Output only one row
 1324|  3.11k|    sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
 1325|  3.11k|                   w, 1, params->sgr.w0, params->sgr.w1
 1326|  3.11k|                   HIGHBD_TAIL_SUFFIX);
 1327|  3.11k|    return;
 1328|       |
 1329|  1.30k|vert_1:
 1330|       |    // Copy the last row as padding once
 1331|  1.30k|    sumsq5_ptrs[4] = sumsq5_ptrs[3];
 1332|  1.30k|    sum5_ptrs[4] = sum5_ptrs[3];
 1333|       |
 1334|  1.30k|    sumsq3_ptrs[2] = sumsq3_ptrs[1];
 1335|  1.30k|    sum3_ptrs[2] = sum3_ptrs[1];
 1336|       |
 1337|  1.30k|    sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1338|  1.30k|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.30k|#define BITDEPTH_MAX 0xff
  ------------------
 1339|  1.30k|    rotate(A5_ptrs, B5_ptrs, 2);
 1340|  1.30k|    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1341|  1.30k|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.30k|#define BITDEPTH_MAX 0xff
  ------------------
 1342|  1.30k|    rotate(A3_ptrs, B3_ptrs, 4);
 1343|       |
 1344|  1.30k|    goto output_1;
 1345|  1.80k|}
looprestoration_tmpl.c:sgr_box35_row_h:
  458|   531k|{
  459|   531k|    sgr_box3_row_h(sumsq3, sum3, left, src, w, edges);
  460|   531k|    sgr_box5_row_h(sumsq5, sum5, left, src, w, edges);
  461|   531k|}
looprestoration_tmpl.c:sgr_finish_mix:
  657|   257k|{
  658|   257k|    ALIGN_STK_16(coef, tmp5, 2*FILTER_OUT_STRIDE,);
  ------------------
  |  |  100|   257k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|   257k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  659|   257k|    ALIGN_STK_16(coef, tmp3, 2*FILTER_OUT_STRIDE,);
  ------------------
  |  |  100|   257k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|   257k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  660|       |
  661|   257k|    sgr_finish_filter2(tmp5, *dst, stride, A5_ptrs, B5_ptrs, w, h);
  662|   257k|    sgr_finish_filter_row1(tmp3, *dst, A3_ptrs, B3_ptrs, w);
  663|   257k|    if (h > 1)
  ------------------
  |  Branch (663:9): [True: 262k, False: 18.4E]
  ------------------
  664|   262k|        sgr_finish_filter_row1(tmp3 + FILTER_OUT_STRIDE, *dst + PXSTRIDE(stride),
  ------------------
  |  |  566|   262k|#define FILTER_OUT_STRIDE (384)
  ------------------
                      sgr_finish_filter_row1(tmp3 + FILTER_OUT_STRIDE, *dst + PXSTRIDE(stride),
  ------------------
  |  |   53|   262k|#define PXSTRIDE(x) (x)
  ------------------
  665|   262k|                               &A3_ptrs[1], &B3_ptrs[1], w);
  666|   257k|    sgr_weighted2(*dst, stride, tmp5, tmp3, w, h, w0, w1 HIGHBD_TAIL_SUFFIX);
  667|   257k|    *dst += h*PXSTRIDE(stride);
  ------------------
  |  |   53|   257k|#define PXSTRIDE(x) (x)
  ------------------
  668|   257k|    rotate(A5_ptrs, B5_ptrs, 2);
  669|   257k|    rotate(A3_ptrs, B3_ptrs, 4);
  670|   257k|}
looprestoration_tmpl.c:sgr_weighted2:
  610|   264k|{
  611|   776k|    for (int j = 0; j < h; j++) {
  ------------------
  |  Branch (611:21): [True: 511k, False: 264k]
  ------------------
  612|  56.8M|        for (int i = 0; i < w; i++) {
  ------------------
  |  Branch (612:25): [True: 56.3M, False: 511k]
  ------------------
  613|  56.3M|            const int v = w0 * t1[i] + w1 * t2[i];
  614|  56.3M|            dst[i] = iclip_pixel(dst[i] + ((v + (1 << 10)) >> 11));
  ------------------
  |  |   49|  56.3M|#define iclip_pixel iclip_u8
  ------------------
  615|  56.3M|        }
  616|   511k|        dst += PXSTRIDE(dst_stride);
  ------------------
  |  |   53|   511k|#define PXSTRIDE(x) (x)
  ------------------
  617|   511k|        t1 += FILTER_OUT_STRIDE;
  ------------------
  |  |  566|   511k|#define FILTER_OUT_STRIDE (384)
  ------------------
  618|   511k|        t2 += FILTER_OUT_STRIDE;
  ------------------
  |  |  566|   511k|#define FILTER_OUT_STRIDE (384)
  ------------------
  619|   511k|    }
  620|   264k|}
dav1d_loop_restoration_dsp_init_16bpc:
 1361|  8.47k|{
 1362|  8.47k|    c->wiener[0] = c->wiener[1] = wiener_c;
 1363|  8.47k|    c->sgr[0] = sgr_5x5_c;
 1364|  8.47k|    c->sgr[1] = sgr_3x3_c;
 1365|  8.47k|    c->sgr[2] = sgr_mix_c;
 1366|       |
 1367|  8.47k|#if HAVE_ASM
 1368|       |#if ARCH_AARCH64 || ARCH_ARM
 1369|       |    loop_restoration_dsp_init_arm(c, bpc);
 1370|       |#elif ARCH_LOONGARCH64
 1371|       |    loop_restoration_dsp_init_loongarch(c, bpc);
 1372|       |#elif ARCH_PPC64LE
 1373|       |    loop_restoration_dsp_init_ppc(c, bpc);
 1374|       |#elif ARCH_X86
 1375|       |    loop_restoration_dsp_init_x86(c, bpc);
 1376|  8.47k|#endif
 1377|  8.47k|#endif
 1378|  8.47k|}

dav1d_lr_sbrow_8bpc:
  171|   106k|{
  172|   106k|    const int offset_y = 8 * !!sby;
  173|   106k|    const ptrdiff_t *const dst_stride = f->sr_cur.p.stride;
  174|   106k|    const int restore_planes = f->lf.restore_planes;
  175|   106k|    const int sb128 = f->seq_hdr->sb128;
  176|   106k|    const int not_last = sby + 1 < f->sbh;
  177|       |
  178|   106k|    if (restore_planes & LR_RESTORE_Y) {
  ------------------
  |  Branch (178:9): [True: 104k, False: 1.94k]
  ------------------
  179|   104k|        const int h = f->sr_cur.p.p.h;
  180|   104k|        const int w = f->sr_cur.p.p.w;
  181|   104k|        const int next_row_y = (sby + 1) << (6 + sb128);
  182|   104k|        const int row_h = imin(next_row_y - 8 * not_last, h);
  183|   104k|        const int y_stripe = (sby << (6 + sb128)) - offset_y;
  184|   104k|        lr_sbrow(f, dst[0] - offset_y * PXSTRIDE(dst_stride[0]), y_stripe, w,
  ------------------
  |  |   53|   104k|#define PXSTRIDE(x) (x)
  ------------------
  185|   104k|                 h, row_h, 0);
  186|   104k|    }
  187|   106k|    if (restore_planes & (LR_RESTORE_U | LR_RESTORE_V)) {
  ------------------
  |  Branch (187:9): [True: 6.29k, False: 100k]
  ------------------
  188|  6.29k|        const int ss_ver = f->sr_cur.p.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  189|  6.29k|        const int ss_hor = f->sr_cur.p.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  190|  6.29k|        const int h = (f->sr_cur.p.p.h + ss_ver) >> ss_ver;
  191|  6.29k|        const int w = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
  192|  6.29k|        const int next_row_y = (sby + 1) << ((6 - ss_ver) + sb128);
  193|  6.29k|        const int row_h = imin(next_row_y - (8 >> ss_ver) * not_last, h);
  194|  6.29k|        const int offset_uv = offset_y >> ss_ver;
  195|  6.29k|        const int y_stripe = (sby << ((6 - ss_ver) + sb128)) - offset_uv;
  196|  6.29k|        if (restore_planes & LR_RESTORE_U)
  ------------------
  |  Branch (196:13): [True: 4.69k, False: 1.60k]
  ------------------
  197|  4.69k|            lr_sbrow(f, dst[1] - offset_uv * PXSTRIDE(dst_stride[1]), y_stripe,
  ------------------
  |  |   53|  4.69k|#define PXSTRIDE(x) (x)
  ------------------
  198|  4.69k|                     w, h, row_h, 1);
  199|       |
  200|  6.29k|        if (restore_planes & LR_RESTORE_V)
  ------------------
  |  Branch (200:13): [True: 4.20k, False: 2.08k]
  ------------------
  201|  4.20k|            lr_sbrow(f, dst[2] - offset_uv * PXSTRIDE(dst_stride[1]), y_stripe,
  ------------------
  |  |   53|  4.20k|#define PXSTRIDE(x) (x)
  ------------------
  202|  4.20k|                     w, h, row_h, 2);
  203|  6.29k|    }
  204|   106k|}
lr_apply_tmpl.c:lr_sbrow:
  109|   274k|{
  110|   274k|    const int chroma = !!plane;
  111|   274k|    const int ss_ver = chroma & (f->sr_cur.p.p.layout == DAV1D_PIXEL_LAYOUT_I420);
  112|   274k|    const int ss_hor = chroma & (f->sr_cur.p.p.layout != DAV1D_PIXEL_LAYOUT_I444);
  113|   274k|    const ptrdiff_t p_stride = f->sr_cur.p.stride[chroma];
  114|       |
  115|   274k|    const int unit_size_log2 = f->frame_hdr->restoration.unit_size[!!plane];
  116|   274k|    const int unit_size = 1 << unit_size_log2;
  117|   274k|    const int half_unit_size = unit_size >> 1;
  118|   274k|    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|   274k|    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|   274k|    const int shift_hor = 7 - ss_hor;
  131|       |
  132|       |    /* maximum sbrow height is 128 + 8 rows offset */
  133|   274k|    ALIGN_STK_16(pixel, pre_lr_border, 2, [128 + 8][4]);
  ------------------
  |  |  100|   274k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|   274k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  134|   274k|    const Av1RestorationUnit *lr[2];
  135|       |
  136|   274k|    enum LrEdgeFlags edges = (y > 0 ? LR_HAVE_TOP : 0) | LR_HAVE_RIGHT;
  ------------------
  |  Branch (136:31): [True: 257k, False: 17.0k]
  ------------------
  137|       |
  138|   274k|    int aligned_unit_pos = row_y & ~(unit_size - 1);
  139|   274k|    if (aligned_unit_pos && aligned_unit_pos + half_unit_size > h)
  ------------------
  |  Branch (139:9): [True: 254k, False: 20.5k]
  |  Branch (139:29): [True: 2.10k, False: 252k]
  ------------------
  140|  2.10k|        aligned_unit_pos -= unit_size;
  141|   274k|    aligned_unit_pos <<= ss_ver;
  142|   274k|    const int sb_idx = (aligned_unit_pos >> 7) * f->sr_sb128w;
  143|   274k|    const int unit_idx = ((aligned_unit_pos >> 6) & 1) << 1;
  144|   274k|    lr[0] = &f->lf.lr_mask[sb_idx].lr[plane][unit_idx];
  145|   274k|    int restore = lr[0]->type != DAV1D_RESTORATION_NONE;
  146|   274k|    int x = 0, bit = 0;
  147|   274k|    const int backup_h = row_h - y;
  148|   321k|    for (; x + max_unit_size <= w; p += unit_size, edges |= LR_HAVE_LEFT, bit ^= 1) {
  ------------------
  |  Branch (148:12): [True: 46.6k, False: 274k]
  ------------------
  149|  46.6k|        const int next_x = x + unit_size;
  150|  46.6k|        const int next_u_idx = unit_idx + ((next_x >> (shift_hor - 1)) & 1);
  151|  46.6k|        lr[!bit] =
  152|  46.6k|            &f->lf.lr_mask[sb_idx + (next_x >> shift_hor)].lr[plane][next_u_idx];
  153|  46.6k|        const int restore_next = lr[!bit]->type != DAV1D_RESTORATION_NONE;
  154|  46.6k|        if (restore_next)
  ------------------
  |  Branch (154:13): [True: 25.2k, False: 21.4k]
  ------------------
  155|  25.2k|            backup4xU(pre_lr_border[bit], p + unit_size - 4, p_stride, backup_h);
  156|  46.6k|        if (restore)
  ------------------
  |  Branch (156:13): [True: 25.5k, False: 21.1k]
  ------------------
  157|  25.5k|            lr_stripe(f, p, pre_lr_border[!bit], x, y, plane, unit_size, row_h,
  158|  25.5k|                      lr[bit], edges);
  159|  46.6k|        x = next_x;
  160|  46.6k|        restore = restore_next;
  161|  46.6k|    }
  162|   274k|    if (restore) {
  ------------------
  |  Branch (162:9): [True: 15.0k, False: 259k]
  ------------------
  163|  15.0k|        edges &= ~LR_HAVE_RIGHT;
  164|  15.0k|        const int unit_w = w - x;
  165|  15.0k|        lr_stripe(f, p, pre_lr_border[!bit], x, y, plane, unit_w, row_h, lr[bit], edges);
  166|  15.0k|    }
  167|   274k|}
lr_apply_tmpl.c:backup4xU:
  102|  25.2k|{
  103|  2.09M|    for (; u > 0; u--, dst++, src += PXSTRIDE(src_stride))
  ------------------
  |  |   53|  2.06M|#define PXSTRIDE(x) (x)
  ------------------
  |  Branch (103:12): [True: 2.06M, False: 25.2k]
  ------------------
  104|  2.06M|        pixel_copy(dst, src, 4);
  ------------------
  |  |   47|  2.06M|#define pixel_copy memcpy
  ------------------
  105|  25.2k|}
lr_apply_tmpl.c:lr_stripe:
   40|  40.6k|{
   41|  40.6k|    const Dav1dDSPContext *const dsp = f->dsp;
   42|  40.6k|    const int chroma = !!plane;
   43|  40.6k|    const int ss_ver = chroma & (f->sr_cur.p.p.layout == DAV1D_PIXEL_LAYOUT_I420);
   44|  40.6k|    const ptrdiff_t stride = f->sr_cur.p.stride[chroma];
   45|  40.6k|    const int sby = (y + (y ? 8 << ss_ver : 0)) >> (6 - ss_ver + f->seq_hdr->sb128);
  ------------------
  |  Branch (45:27): [True: 23.8k, False: 16.7k]
  ------------------
   46|  40.6k|    const int have_tt = f->c->n_tc > 1;
   47|  40.6k|    const pixel *lpf = f->lf.lr_lpf_line[plane] +
   48|  40.6k|        have_tt * (sby * (4 << f->seq_hdr->sb128) - 4) * PXSTRIDE(stride) + x;
  ------------------
  |  |   53|  40.6k|#define PXSTRIDE(x) (x)
  ------------------
   49|       |
   50|       |    // The first stripe of the frame is shorter by 8 luma pixel rows.
   51|  40.6k|    int stripe_h = imin((64 - 8 * !y) >> ss_ver, row_h - y);
   52|       |
   53|  40.6k|    looprestorationfilter_fn lr_fn;
   54|  40.6k|    LooprestorationParams params;
   55|  40.6k|    if (lr->type == DAV1D_RESTORATION_WIENER) {
  ------------------
  |  Branch (55:9): [True: 17.1k, False: 23.4k]
  ------------------
   56|  17.1k|        int16_t (*const filter)[8] = params.filter;
   57|  17.1k|        filter[0][0] = filter[0][6] = lr->filter_h[0];
   58|  17.1k|        filter[0][1] = filter[0][5] = lr->filter_h[1];
   59|  17.1k|        filter[0][2] = filter[0][4] = lr->filter_h[2];
   60|  17.1k|        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|  17.1k|        filter[1][0] = filter[1][6] = lr->filter_v[0];
   68|  17.1k|        filter[1][1] = filter[1][5] = lr->filter_v[1];
   69|  17.1k|        filter[1][2] = filter[1][4] = lr->filter_v[2];
   70|  17.1k|        filter[1][3] = 128 - (filter[1][0] + filter[1][1] + filter[1][2]) * 2;
   71|       |
   72|  17.1k|        lr_fn = dsp->lr.wiener[!(filter[0][0] | filter[1][0])];
   73|  23.4k|    } else {
   74|  23.4k|        assert(lr->type >= DAV1D_RESTORATION_SGRPROJ);
  ------------------
  |  Branch (74:9): [True: 23.3k, False: 5]
  ------------------
   75|  23.3k|        const int sgr_idx = lr->type - DAV1D_RESTORATION_SGRPROJ;
   76|  23.3k|        const uint16_t *const sgr_params = dav1d_sgr_params[sgr_idx];
   77|  23.3k|        params.sgr.s0 = sgr_params[0];
   78|  23.3k|        params.sgr.s1 = sgr_params[1];
   79|  23.3k|        params.sgr.w0 = lr->sgr_weights[0];
   80|  23.3k|        params.sgr.w1 = 128 - (lr->sgr_weights[0] + lr->sgr_weights[1]);
   81|       |
   82|  23.3k|        lr_fn = dsp->lr.sgr[!!sgr_params[0] + !!sgr_params[1] * 2 - 1];
   83|  23.3k|    }
   84|       |
   85|  71.4k|    while (y + stripe_h <= row_h) {
  ------------------
  |  Branch (85:12): [True: 71.4k, False: 2]
  ------------------
   86|       |        // Change the HAVE_BOTTOM bit in edges to (sby + 1 != f->sbh || y + stripe_h != row_h)
   87|  71.4k|        edges ^= (-(sby + 1 != f->sbh || y + stripe_h != row_h) ^ edges) & LR_HAVE_BOTTOM;
  ------------------
  |  Branch (87:21): [True: 40.6k, False: 30.8k]
  |  Branch (87:42): [True: 14.1k, False: 16.6k]
  ------------------
   88|  71.4k|        lr_fn(p, stride, left, lpf, unit_w, stripe_h, &params, edges HIGHBD_CALL_SUFFIX);
   89|       |
   90|  71.4k|        left += stripe_h;
   91|  71.4k|        y += stripe_h;
   92|  71.4k|        p += stripe_h * PXSTRIDE(stride);
  ------------------
  |  |   53|  71.4k|#define PXSTRIDE(x) (x)
  ------------------
   93|  71.4k|        edges |= LR_HAVE_TOP;
   94|  71.4k|        stripe_h = imin(64 >> ss_ver, row_h - y);
   95|  71.4k|        if (stripe_h == 0) break;
  ------------------
  |  Branch (95:13): [True: 40.5k, False: 30.8k]
  ------------------
   96|  30.8k|        lpf += 4 * PXSTRIDE(stride);
  ------------------
  |  |   53|  30.8k|#define PXSTRIDE(x) (x)
  ------------------
   97|  30.8k|    }
   98|  40.5k|}
dav1d_lr_sbrow_16bpc:
  171|   150k|{
  172|   150k|    const int offset_y = 8 * !!sby;
  173|   150k|    const ptrdiff_t *const dst_stride = f->sr_cur.p.stride;
  174|   150k|    const int restore_planes = f->lf.restore_planes;
  175|   150k|    const int sb128 = f->seq_hdr->sb128;
  176|   150k|    const int not_last = sby + 1 < f->sbh;
  177|       |
  178|   150k|    if (restore_planes & LR_RESTORE_Y) {
  ------------------
  |  Branch (178:9): [True: 148k, False: 1.42k]
  ------------------
  179|   148k|        const int h = f->sr_cur.p.p.h;
  180|   148k|        const int w = f->sr_cur.p.p.w;
  181|   148k|        const int next_row_y = (sby + 1) << (6 + sb128);
  182|   148k|        const int row_h = imin(next_row_y - 8 * not_last, h);
  183|   148k|        const int y_stripe = (sby << (6 + sb128)) - offset_y;
  184|   148k|        lr_sbrow(f, dst[0] - offset_y * PXSTRIDE(dst_stride[0]), y_stripe, w,
  185|   148k|                 h, row_h, 0);
  186|   148k|    }
  187|   150k|    if (restore_planes & (LR_RESTORE_U | LR_RESTORE_V)) {
  ------------------
  |  Branch (187:9): [True: 7.09k, False: 143k]
  ------------------
  188|  7.09k|        const int ss_ver = f->sr_cur.p.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  189|  7.09k|        const int ss_hor = f->sr_cur.p.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  190|  7.09k|        const int h = (f->sr_cur.p.p.h + ss_ver) >> ss_ver;
  191|  7.09k|        const int w = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
  192|  7.09k|        const int next_row_y = (sby + 1) << ((6 - ss_ver) + sb128);
  193|  7.09k|        const int row_h = imin(next_row_y - (8 >> ss_ver) * not_last, h);
  194|  7.09k|        const int offset_uv = offset_y >> ss_ver;
  195|  7.09k|        const int y_stripe = (sby << ((6 - ss_ver) + sb128)) - offset_uv;
  196|  7.09k|        if (restore_planes & LR_RESTORE_U)
  ------------------
  |  Branch (196:13): [True: 5.71k, False: 1.38k]
  ------------------
  197|  5.71k|            lr_sbrow(f, dst[1] - offset_uv * PXSTRIDE(dst_stride[1]), y_stripe,
  198|  5.71k|                     w, h, row_h, 1);
  199|       |
  200|  7.09k|        if (restore_planes & LR_RESTORE_V)
  ------------------
  |  Branch (200:13): [True: 6.63k, False: 462]
  ------------------
  201|  6.63k|            lr_sbrow(f, dst[2] - offset_uv * PXSTRIDE(dst_stride[1]), y_stripe,
  202|  6.63k|                     w, h, row_h, 2);
  203|  7.09k|    }
  204|   150k|}

dav1d_mc_dsp_init_8bpc:
  960|  5.08k|COLD void bitfn(dav1d_mc_dsp_init)(Dav1dMCDSPContext *const c) {
  961|  5.08k|#define init_mc_fns(type, name) do { \
  962|  5.08k|    c->mc        [type] = put_##name##_c; \
  963|  5.08k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  964|  5.08k|    c->mct       [type] = prep_##name##_c; \
  965|  5.08k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  966|  5.08k|} while (0)
  967|       |
  968|  5.08k|    init_mc_fns(FILTER_2D_8TAP_REGULAR,        8tap_regular);
  ------------------
  |  |  961|  5.08k|#define init_mc_fns(type, name) do { \
  |  |  962|  5.08k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  5.08k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  5.08k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  5.08k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  5.08k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 5.08k]
  |  |  ------------------
  ------------------
  969|  5.08k|    init_mc_fns(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth);
  ------------------
  |  |  961|  5.08k|#define init_mc_fns(type, name) do { \
  |  |  962|  5.08k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  5.08k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  5.08k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  5.08k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  5.08k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 5.08k]
  |  |  ------------------
  ------------------
  970|  5.08k|    init_mc_fns(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp);
  ------------------
  |  |  961|  5.08k|#define init_mc_fns(type, name) do { \
  |  |  962|  5.08k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  5.08k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  5.08k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  5.08k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  5.08k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 5.08k]
  |  |  ------------------
  ------------------
  971|  5.08k|    init_mc_fns(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular);
  ------------------
  |  |  961|  5.08k|#define init_mc_fns(type, name) do { \
  |  |  962|  5.08k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  5.08k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  5.08k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  5.08k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  5.08k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 5.08k]
  |  |  ------------------
  ------------------
  972|  5.08k|    init_mc_fns(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth);
  ------------------
  |  |  961|  5.08k|#define init_mc_fns(type, name) do { \
  |  |  962|  5.08k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  5.08k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  5.08k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  5.08k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  5.08k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 5.08k]
  |  |  ------------------
  ------------------
  973|  5.08k|    init_mc_fns(FILTER_2D_8TAP_SHARP,          8tap_sharp);
  ------------------
  |  |  961|  5.08k|#define init_mc_fns(type, name) do { \
  |  |  962|  5.08k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  5.08k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  5.08k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  5.08k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  5.08k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 5.08k]
  |  |  ------------------
  ------------------
  974|  5.08k|    init_mc_fns(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular);
  ------------------
  |  |  961|  5.08k|#define init_mc_fns(type, name) do { \
  |  |  962|  5.08k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  5.08k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  5.08k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  5.08k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  5.08k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 5.08k]
  |  |  ------------------
  ------------------
  975|  5.08k|    init_mc_fns(FILTER_2D_8TAP_SMOOTH,         8tap_smooth);
  ------------------
  |  |  961|  5.08k|#define init_mc_fns(type, name) do { \
  |  |  962|  5.08k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  5.08k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  5.08k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  5.08k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  5.08k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 5.08k]
  |  |  ------------------
  ------------------
  976|  5.08k|    init_mc_fns(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp);
  ------------------
  |  |  961|  5.08k|#define init_mc_fns(type, name) do { \
  |  |  962|  5.08k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  5.08k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  5.08k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  5.08k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  5.08k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 5.08k]
  |  |  ------------------
  ------------------
  977|  5.08k|    init_mc_fns(FILTER_2D_BILINEAR,            bilin);
  ------------------
  |  |  961|  5.08k|#define init_mc_fns(type, name) do { \
  |  |  962|  5.08k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  5.08k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  5.08k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  5.08k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  5.08k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 5.08k]
  |  |  ------------------
  ------------------
  978|       |
  979|  5.08k|    c->avg      = avg_c;
  980|  5.08k|    c->w_avg    = w_avg_c;
  981|  5.08k|    c->mask     = mask_c;
  982|  5.08k|    c->blend    = blend_c;
  983|  5.08k|    c->blend_v  = blend_v_c;
  984|  5.08k|    c->blend_h  = blend_h_c;
  985|  5.08k|    c->w_mask[0] = w_mask_444_c;
  986|  5.08k|    c->w_mask[1] = w_mask_422_c;
  987|  5.08k|    c->w_mask[2] = w_mask_420_c;
  988|  5.08k|    c->warp8x8  = warp_affine_8x8_c;
  989|  5.08k|    c->warp8x8t = warp_affine_8x8t_c;
  990|  5.08k|    c->emu_edge = emu_edge_c;
  991|  5.08k|    c->resize   = resize_c;
  992|       |
  993|  5.08k|#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|  5.08k|#endif
 1005|  5.08k|#endif
 1006|  5.08k|}
dav1d_mc_dsp_init_16bpc:
  960|  8.47k|COLD void bitfn(dav1d_mc_dsp_init)(Dav1dMCDSPContext *const c) {
  961|  8.47k|#define init_mc_fns(type, name) do { \
  962|  8.47k|    c->mc        [type] = put_##name##_c; \
  963|  8.47k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  964|  8.47k|    c->mct       [type] = prep_##name##_c; \
  965|  8.47k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  966|  8.47k|} while (0)
  967|       |
  968|  8.47k|    init_mc_fns(FILTER_2D_8TAP_REGULAR,        8tap_regular);
  ------------------
  |  |  961|  8.47k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.47k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.47k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.47k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.47k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.47k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.47k]
  |  |  ------------------
  ------------------
  969|  8.47k|    init_mc_fns(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth);
  ------------------
  |  |  961|  8.47k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.47k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.47k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.47k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.47k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.47k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.47k]
  |  |  ------------------
  ------------------
  970|  8.47k|    init_mc_fns(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp);
  ------------------
  |  |  961|  8.47k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.47k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.47k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.47k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.47k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.47k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.47k]
  |  |  ------------------
  ------------------
  971|  8.47k|    init_mc_fns(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular);
  ------------------
  |  |  961|  8.47k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.47k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.47k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.47k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.47k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.47k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.47k]
  |  |  ------------------
  ------------------
  972|  8.47k|    init_mc_fns(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth);
  ------------------
  |  |  961|  8.47k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.47k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.47k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.47k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.47k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.47k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.47k]
  |  |  ------------------
  ------------------
  973|  8.47k|    init_mc_fns(FILTER_2D_8TAP_SHARP,          8tap_sharp);
  ------------------
  |  |  961|  8.47k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.47k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.47k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.47k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.47k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.47k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.47k]
  |  |  ------------------
  ------------------
  974|  8.47k|    init_mc_fns(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular);
  ------------------
  |  |  961|  8.47k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.47k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.47k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.47k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.47k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.47k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.47k]
  |  |  ------------------
  ------------------
  975|  8.47k|    init_mc_fns(FILTER_2D_8TAP_SMOOTH,         8tap_smooth);
  ------------------
  |  |  961|  8.47k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.47k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.47k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.47k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.47k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.47k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.47k]
  |  |  ------------------
  ------------------
  976|  8.47k|    init_mc_fns(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp);
  ------------------
  |  |  961|  8.47k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.47k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.47k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.47k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.47k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.47k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.47k]
  |  |  ------------------
  ------------------
  977|  8.47k|    init_mc_fns(FILTER_2D_BILINEAR,            bilin);
  ------------------
  |  |  961|  8.47k|#define init_mc_fns(type, name) do { \
  |  |  962|  8.47k|    c->mc        [type] = put_##name##_c; \
  |  |  963|  8.47k|    c->mc_scaled [type] = put_##name##_scaled_c; \
  |  |  964|  8.47k|    c->mct       [type] = prep_##name##_c; \
  |  |  965|  8.47k|    c->mct_scaled[type] = prep_##name##_scaled_c; \
  |  |  966|  8.47k|} while (0)
  |  |  ------------------
  |  |  |  Branch (966:10): [Folded, False: 8.47k]
  |  |  ------------------
  ------------------
  978|       |
  979|  8.47k|    c->avg      = avg_c;
  980|  8.47k|    c->w_avg    = w_avg_c;
  981|  8.47k|    c->mask     = mask_c;
  982|  8.47k|    c->blend    = blend_c;
  983|  8.47k|    c->blend_v  = blend_v_c;
  984|  8.47k|    c->blend_h  = blend_h_c;
  985|  8.47k|    c->w_mask[0] = w_mask_444_c;
  986|  8.47k|    c->w_mask[1] = w_mask_422_c;
  987|  8.47k|    c->w_mask[2] = w_mask_420_c;
  988|  8.47k|    c->warp8x8  = warp_affine_8x8_c;
  989|  8.47k|    c->warp8x8t = warp_affine_8x8t_c;
  990|  8.47k|    c->emu_edge = emu_edge_c;
  991|  8.47k|    c->resize   = resize_c;
  992|       |
  993|  8.47k|#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.47k|#endif
 1005|  8.47k|#endif
 1006|  8.47k|}

dav1d_mem_pool_push:
  224|  1.03M|void dav1d_mem_pool_push(Dav1dMemPool *const pool, void *const ptr) {
  225|  1.03M|    pthread_mutex_lock(&pool->lock);
  226|  1.03M|    Dav1dMemPoolBuffer *const buf = (Dav1dMemPoolBuffer*)((uintptr_t)ptr - 64);
  227|  1.03M|    const int ref_cnt = --pool->ref_cnt;
  228|  1.03M|    if (!pool->end) {
  ------------------
  |  Branch (228:9): [True: 1.00M, False: 35.3k]
  ------------------
  229|  1.00M|        buf->next = pool->buf;
  230|  1.00M|        pool->buf = buf;
  231|  1.00M|        pthread_mutex_unlock(&pool->lock);
  232|  1.00M|        assert(ref_cnt > 0);
  ------------------
  |  Branch (232:9): [True: 1.00M, False: 18.4E]
  ------------------
  233|  1.00M|    } else {
  234|  35.3k|        pthread_mutex_unlock(&pool->lock);
  235|  35.3k|        dav1d_free_aligned(buf);
  ------------------
  |  |  136|  35.3k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  236|  35.3k|        if (!ref_cnt) mem_pool_destroy(pool);
  ------------------
  |  Branch (236:13): [True: 35.3k, False: 18.4E]
  ------------------
  237|  35.3k|    }
  238|  1.03M|}
dav1d_mem_pool_pop:
  240|  1.03M|void *dav1d_mem_pool_pop(Dav1dMemPool *const pool, const size_t size) {
  241|  1.03M|    pthread_mutex_lock(&pool->lock);
  242|  1.03M|    Dav1dMemPoolBuffer *buf = pool->buf;
  243|  1.03M|    pool->ref_cnt++;
  244|       |
  245|  1.03M|    if (buf) {
  ------------------
  |  Branch (245:9): [True: 906k, False: 128k]
  ------------------
  246|   906k|        pool->buf = buf->next;
  247|   906k|        pthread_mutex_unlock(&pool->lock);
  248|   906k|        if (buf->size != size) {
  ------------------
  |  Branch (248:13): [True: 24.9k, False: 881k]
  ------------------
  249|       |            /* Reallocate if the size has changed */
  250|  24.9k|            dav1d_free_aligned(buf);
  ------------------
  |  |  136|  24.9k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  251|  24.9k|            goto alloc;
  252|  24.9k|        }
  253|       |#if TRACK_HEAP_ALLOCATIONS
  254|       |        dav1d_track_reuse(pool->type);
  255|       |#endif
  256|   906k|    } else {
  257|   128k|        pthread_mutex_unlock(&pool->lock);
  258|   153k|alloc:
  259|   153k|        buf = dav1d_alloc_aligned(pool->type, size + 64, 64);
  ------------------
  |  |  134|   153k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
  260|   153k|        if (!buf) {
  ------------------
  |  Branch (260:13): [True: 0, False: 153k]
  ------------------
  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|   153k|        buf->size = size;
  268|   153k|    }
  269|       |
  270|  1.03M|    return (void*)((uintptr_t)buf + 64);
  271|  1.03M|}
dav1d_mem_pool_init:
  275|   105k|{
  276|   105k|    Dav1dMemPool *const pool = dav1d_malloc(ALLOC_COMMON_CTX,
  ------------------
  |  |  132|   105k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
  277|   105k|                                            sizeof(Dav1dMemPool));
  278|   105k|    if (pool) {
  ------------------
  |  Branch (278:9): [True: 105k, False: 0]
  ------------------
  279|   105k|        if (!pthread_mutex_init(&pool->lock, NULL)) {
  ------------------
  |  Branch (279:13): [True: 105k, False: 0]
  ------------------
  280|   105k|            pool->buf = NULL;
  281|   105k|            pool->ref_cnt = 1;
  282|   105k|            pool->end = 0;
  283|       |#if TRACK_HEAP_ALLOCATIONS
  284|       |            pool->type = type;
  285|       |#endif
  286|   105k|            *ppool = pool;
  287|   105k|            return 0;
  288|   105k|        }
  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|   105k|}
dav1d_mem_pool_end:
  295|   105k|COLD void dav1d_mem_pool_end(Dav1dMemPool *const pool) {
  296|   105k|    if (pool) {
  ------------------
  |  Branch (296:9): [True: 105k, False: 0]
  ------------------
  297|   105k|        pthread_mutex_lock(&pool->lock);
  298|   105k|        Dav1dMemPoolBuffer *buf = pool->buf;
  299|   105k|        const int ref_cnt = --pool->ref_cnt;
  300|   105k|        pool->buf = NULL;
  301|   105k|        pool->end = 1;
  302|   105k|        pthread_mutex_unlock(&pool->lock);
  303|       |
  304|   199k|        while (buf) {
  ------------------
  |  Branch (304:16): [True: 93.5k, False: 105k]
  ------------------
  305|  93.5k|            void *const ptr = buf;
  306|  93.5k|            buf = buf->next;
  307|  93.5k|            dav1d_free_aligned(ptr);
  ------------------
  |  |  136|  93.5k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  308|  93.5k|        }
  309|   105k|        if (!ref_cnt) mem_pool_destroy(pool);
  ------------------
  |  Branch (309:13): [True: 70.3k, False: 35.3k]
  ------------------
  310|   105k|    }
  311|   105k|}
mem.c:mem_pool_destroy:
  219|   105k|static COLD void mem_pool_destroy(Dav1dMemPool *const pool) {
  220|   105k|    pthread_mutex_destroy(&pool->lock);
  221|   105k|    dav1d_free(pool);
  ------------------
  |  |  135|   105k|#define dav1d_free(ptr) free(ptr)
  ------------------
  222|   105k|}

lib.c:dav1d_alloc_aligned_internal:
   89|  45.3k|static inline void *dav1d_alloc_aligned_internal(const size_t sz, const size_t align) {
   90|  45.3k|    assert(!(align & (align - 1)));
  ------------------
  |  Branch (90:5): [True: 45.3k, False: 0]
  ------------------
   91|       |#ifdef _WIN32
   92|       |    return _aligned_malloc(sz, align);
   93|       |#elif HAVE_POSIX_MEMALIGN
   94|  45.3k|    void *ptr;
   95|  45.3k|    if (posix_memalign(&ptr, align, sz)) return NULL;
  ------------------
  |  Branch (95:9): [True: 0, False: 45.3k]
  ------------------
   96|  45.3k|    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|  45.3k|}
lib.c:dav1d_free_aligned_internal:
  113|   709k|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|   709k|}
lib.c:dav1d_freep_aligned:
  144|  15.1k|static inline void dav1d_freep_aligned(void *ptr) {
  145|  15.1k|    void **mem = (void **) ptr;
  146|  15.1k|    if (*mem) {
  ------------------
  |  Branch (146:9): [True: 15.1k, False: 0]
  ------------------
  147|  15.1k|        dav1d_free_aligned(*mem);
  ------------------
  |  |  136|  15.1k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  148|       |        *mem = NULL;
  149|  15.1k|    }
  150|  15.1k|}
mem.c:dav1d_free_aligned_internal:
  113|   153k|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|   153k|}
mem.c:dav1d_alloc_aligned_internal:
   89|   153k|static inline void *dav1d_alloc_aligned_internal(const size_t sz, const size_t align) {
   90|   153k|    assert(!(align & (align - 1)));
  ------------------
  |  Branch (90:5): [True: 153k, False: 0]
  ------------------
   91|       |#ifdef _WIN32
   92|       |    return _aligned_malloc(sz, align);
   93|       |#elif HAVE_POSIX_MEMALIGN
   94|   153k|    void *ptr;
   95|   153k|    if (posix_memalign(&ptr, align, sz)) return NULL;
  ------------------
  |  Branch (95:9): [True: 0, False: 153k]
  ------------------
   96|   153k|    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|   153k|}
ref.c:dav1d_alloc_aligned_internal:
   89|   285k|static inline void *dav1d_alloc_aligned_internal(const size_t sz, const size_t align) {
   90|   285k|    assert(!(align & (align - 1)));
  ------------------
  |  Branch (90:5): [True: 285k, False: 0]
  ------------------
   91|       |#ifdef _WIN32
   92|       |    return _aligned_malloc(sz, align);
   93|       |#elif HAVE_POSIX_MEMALIGN
   94|   285k|    void *ptr;
   95|   285k|    if (posix_memalign(&ptr, align, sz)) return NULL;
  ------------------
  |  Branch (95:9): [True: 0, False: 285k]
  ------------------
   96|   285k|    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|   285k|}
ref.c:dav1d_free_aligned_internal:
  113|   285k|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|   285k|}
refmvs.c:dav1d_free_aligned_internal:
  113|  28.3k|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|  28.3k|}
refmvs.c:dav1d_alloc_aligned_internal:
   89|  28.3k|static inline void *dav1d_alloc_aligned_internal(const size_t sz, const size_t align) {
   90|  28.3k|    assert(!(align & (align - 1)));
  ------------------
  |  Branch (90:5): [True: 28.3k, False: 0]
  ------------------
   91|       |#ifdef _WIN32
   92|       |    return _aligned_malloc(sz, align);
   93|       |#elif HAVE_POSIX_MEMALIGN
   94|  28.3k|    void *ptr;
   95|  28.3k|    if (posix_memalign(&ptr, align, sz)) return NULL;
  ------------------
  |  Branch (95:9): [True: 0, False: 28.3k]
  ------------------
   96|  28.3k|    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|  28.3k|}
decode.c:dav1d_free_aligned_internal:
  113|   307k|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|   307k|}
decode.c:dav1d_alloc_aligned_internal:
   89|   304k|static inline void *dav1d_alloc_aligned_internal(const size_t sz, const size_t align) {
   90|   304k|    assert(!(align & (align - 1)));
  ------------------
  |  Branch (90:5): [True: 304k, False: 18.4E]
  ------------------
   91|       |#ifdef _WIN32
   92|       |    return _aligned_malloc(sz, align);
   93|       |#elif HAVE_POSIX_MEMALIGN
   94|   304k|    void *ptr;
   95|   304k|    if (posix_memalign(&ptr, align, sz)) return NULL;
  ------------------
  |  Branch (95:9): [True: 0, False: 304k]
  ------------------
   96|   304k|    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|   304k|}
decode.c:dav1d_freep_aligned:
  144|  3.76k|static inline void dav1d_freep_aligned(void *ptr) {
  145|  3.76k|    void **mem = (void **) ptr;
  146|  3.76k|    if (*mem) {
  ------------------
  |  Branch (146:9): [True: 3.76k, False: 0]
  ------------------
  147|  3.76k|        dav1d_free_aligned(*mem);
  ------------------
  |  |  136|  3.76k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  148|       |        *mem = NULL;
  149|  3.76k|    }
  150|  3.76k|}

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

decode.c:dav1d_msac_decode_bools:
   94|  1.65M|static inline unsigned dav1d_msac_decode_bools(MsacContext *const s, unsigned n) {
   95|  1.65M|    unsigned v = 0;
   96|  3.25M|    while (n--)
  ------------------
  |  Branch (96:12): [True: 1.60M, False: 1.65M]
  ------------------
   97|  1.60M|        v = (v << 1) | dav1d_msac_decode_bool_equi(s);
  ------------------
  |  |   53|  1.60M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
   98|  1.65M|    return v;
   99|  1.65M|}
decode.c:dav1d_msac_decode_uniform:
  101|   268k|static inline int dav1d_msac_decode_uniform(MsacContext *const s, const unsigned n) {
  102|   268k|    assert(n > 0);
  ------------------
  |  Branch (102:5): [True: 268k, False: 6]
  ------------------
  103|   268k|    const int l = ulog2(n) + 1;
  104|   268k|    assert(l > 1);
  ------------------
  |  Branch (104:5): [True: 268k, False: 89]
  ------------------
  105|   268k|    const unsigned m = (1 << l) - n;
  106|   268k|    const unsigned v = dav1d_msac_decode_bools(s, l - 1);
  107|   268k|    return v < m ? v : (v << 1) - m + dav1d_msac_decode_bool_equi(s);
  ------------------
  |  |   53|  61.6k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (107:12): [True: 206k, False: 61.6k]
  ------------------
  108|   268k|}
msac.c:dav1d_msac_decode_bools:
   94|   266k|static inline unsigned dav1d_msac_decode_bools(MsacContext *const s, unsigned n) {
   95|   266k|    unsigned v = 0;
   96|  1.18M|    while (n--)
  ------------------
  |  Branch (96:12): [True: 919k, False: 266k]
  ------------------
   97|   919k|        v = (v << 1) | dav1d_msac_decode_bool_equi(s);
  ------------------
  |  |   53|   919k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
   98|   266k|    return v;
   99|   266k|}
recon_tmpl.c:dav1d_msac_decode_bools:
   94|  12.9M|static inline unsigned dav1d_msac_decode_bools(MsacContext *const s, unsigned n) {
   95|  12.9M|    unsigned v = 0;
   96|  43.3M|    while (n--)
  ------------------
  |  Branch (96:12): [True: 30.3M, False: 12.9M]
  ------------------
   97|  30.3M|        v = (v << 1) | dav1d_msac_decode_bool_equi(s);
  ------------------
  |  |   53|  30.3M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
   98|  12.9M|    return v;
   99|  12.9M|}

dav1d_parse_sequence_header:
  304|  18.5k|{
  305|  18.5k|    validate_input_or_ret(out != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  18.5k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 18.5k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  306|  18.5k|    validate_input_or_ret(ptr != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  18.5k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 18.5k]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  307|  18.5k|    validate_input_or_ret(sz > 0 && sz <= SIZE_MAX / 2, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  37.0k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 18.5k, False: 0]
  |  |  |  Branch (52:11): [True: 18.5k, False: 0]
  |  |  ------------------
  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  ------------------
  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  ------------------
  |  |   54|      0|                    #x, __func__); \
  |  |   55|      0|        debug_abort(); \
  |  |  ------------------
  |  |  |  |   39|      0|#define debug_abort abort
  |  |  ------------------
  |  |   56|      0|        return r; \
  |  |   57|      0|    }
  ------------------
  308|       |
  309|  18.5k|    GetBits gb;
  310|  18.5k|    dav1d_init_get_bits(&gb, ptr, sz);
  311|  18.5k|    int res = DAV1D_ERR(ENOENT);
  ------------------
  |  |   58|  18.5k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  312|       |
  313|  41.6k|    do {
  314|  41.6k|        dav1d_get_bit(&gb); // obu_forbidden_bit
  315|  41.6k|        const enum Dav1dObuType type = dav1d_get_bits(&gb, 4);
  316|  41.6k|        const int has_extension = dav1d_get_bit(&gb);
  317|  41.6k|        const int has_length_field = dav1d_get_bit(&gb);
  318|  41.6k|        dav1d_get_bits(&gb, 1 + 8 * has_extension); // ignore
  319|       |
  320|  41.6k|        const uint8_t *obu_end = gb.ptr_end;
  321|  41.6k|        if (has_length_field) {
  ------------------
  |  Branch (321:13): [True: 25.2k, False: 16.4k]
  ------------------
  322|  25.2k|            const size_t len = dav1d_get_uleb128(&gb);
  323|  25.2k|            if (len > (size_t)(obu_end - gb.ptr)) return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|    392|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (323:17): [True: 392, False: 24.8k]
  ------------------
  324|  24.8k|            obu_end = gb.ptr + len;
  325|  24.8k|        }
  326|       |
  327|  41.2k|        if (type == DAV1D_OBU_SEQ_HDR) {
  ------------------
  |  Branch (327:13): [True: 17.6k, False: 23.6k]
  ------------------
  328|  17.6k|            if ((res = parse_seq_hdr(out, &gb, 0)) < 0) return res;
  ------------------
  |  Branch (328:17): [True: 2.04k, False: 15.5k]
  ------------------
  329|  15.5k|            if (gb.ptr > obu_end) return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|    235|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (329:17): [True: 235, False: 15.3k]
  ------------------
  330|  15.3k|            dav1d_bytealign_get_bits(&gb);
  331|  15.3k|        }
  332|       |
  333|  38.9k|        if (gb.error) return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|    575|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (333:13): [True: 575, False: 38.4k]
  ------------------
  334|  38.9k|        assert(gb.state == 0 && gb.bits_left == 0);
  ------------------
  |  Branch (334:9): [True: 38.4k, False: 0]
  |  Branch (334:9): [True: 38.4k, False: 0]
  ------------------
  335|  38.4k|        gb.ptr = obu_end;
  336|  38.4k|    } while (gb.ptr < gb.ptr_end);
  ------------------
  |  Branch (336:14): [True: 23.1k, False: 15.2k]
  ------------------
  337|       |
  338|  15.2k|    return res;
  339|  18.5k|}
dav1d_parse_obus:
 1179|   391k|ptrdiff_t dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) {
 1180|   391k|    GetBits gb;
 1181|   391k|    int res;
 1182|       |
 1183|   391k|    dav1d_init_get_bits(&gb, in->data, in->sz);
 1184|       |
 1185|       |    // obu header
 1186|   391k|    const int obu_forbidden_bit = dav1d_get_bit(&gb);
 1187|   391k|    if (c->strict_std_compliance && obu_forbidden_bit) goto error;
  ------------------
  |  Branch (1187:9): [True: 0, False: 391k]
  |  Branch (1187:37): [True: 0, False: 0]
  ------------------
 1188|   391k|    const enum Dav1dObuType type = dav1d_get_bits(&gb, 4);
 1189|   391k|    const int has_extension = dav1d_get_bit(&gb);
 1190|   391k|    const int has_length_field = dav1d_get_bit(&gb);
 1191|   391k|    dav1d_get_bit(&gb); // reserved
 1192|       |
 1193|   391k|    int temporal_id = 0, spatial_id = 0;
 1194|   391k|    if (has_extension) {
  ------------------
  |  Branch (1194:9): [True: 17.7k, False: 373k]
  ------------------
 1195|  17.7k|        temporal_id = dav1d_get_bits(&gb, 3);
 1196|  17.7k|        spatial_id = dav1d_get_bits(&gb, 2);
 1197|  17.7k|        dav1d_get_bits(&gb, 3); // reserved
 1198|  17.7k|    }
 1199|       |
 1200|   391k|    if (has_length_field) {
  ------------------
  |  Branch (1200:9): [True: 138k, False: 253k]
  ------------------
 1201|   138k|        const size_t len = dav1d_get_uleb128(&gb);
 1202|   138k|        if (len > (size_t)(gb.ptr_end - gb.ptr)) goto error;
  ------------------
  |  Branch (1202:13): [True: 3.27k, False: 134k]
  ------------------
 1203|   134k|        gb.ptr_end = gb.ptr + len;
 1204|   134k|    }
 1205|   387k|    if (gb.error) goto error;
  ------------------
  |  Branch (1205:9): [True: 2.09k, False: 385k]
  ------------------
 1206|       |
 1207|       |    // We must have read a whole number of bytes at this point (1 byte
 1208|       |    // for the header and whole bytes at a time when reading the
 1209|       |    // leb128 length field).
 1210|   387k|    assert(gb.bits_left == 0);
  ------------------
  |  Branch (1210:5): [True: 385k, False: 0]
  ------------------
 1211|       |
 1212|       |    // skip obu not belonging to the selected temporal/spatial layer
 1213|   385k|    if (type != DAV1D_OBU_SEQ_HDR && type != DAV1D_OBU_TD &&
  ------------------
  |  Branch (1213:9): [True: 347k, False: 38.1k]
  |  Branch (1213:38): [True: 304k, False: 43.1k]
  ------------------
 1214|   304k|        has_extension && c->operating_point_idc != 0)
  ------------------
  |  Branch (1214:9): [True: 14.6k, False: 289k]
  |  Branch (1214:26): [True: 7.60k, False: 7.01k]
  ------------------
 1215|  7.60k|    {
 1216|  7.60k|        const int in_temporal_layer = (c->operating_point_idc >> temporal_id) & 1;
 1217|  7.60k|        const int in_spatial_layer = (c->operating_point_idc >> (spatial_id + 8)) & 1;
 1218|  7.60k|        if (!in_temporal_layer || !in_spatial_layer)
  ------------------
  |  Branch (1218:13): [True: 630, False: 6.97k]
  |  Branch (1218:35): [True: 1.87k, False: 5.09k]
  ------------------
 1219|  2.50k|            return gb.ptr_end - gb.ptr_start;
 1220|  7.60k|    }
 1221|       |
 1222|   383k|    switch (type) {
 1223|  38.1k|    case DAV1D_OBU_SEQ_HDR: {
  ------------------
  |  Branch (1223:5): [True: 38.1k, False: 345k]
  ------------------
 1224|  38.1k|        Dav1dRef *ref = dav1d_ref_create_using_pool(c->seq_hdr_pool,
 1225|  38.1k|                                                    sizeof(Dav1dSequenceHeader));
 1226|  38.1k|        if (!ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (1226:13): [True: 0, False: 38.1k]
  ------------------
 1227|  38.1k|        Dav1dSequenceHeader *seq_hdr = ref->data;
 1228|  38.1k|        if ((res = parse_seq_hdr(seq_hdr, &gb, c->strict_std_compliance)) < 0) {
  ------------------
  |  Branch (1228:13): [True: 3.88k, False: 34.2k]
  ------------------
 1229|  3.88k|            dav1d_log(c, "Error parsing sequence header\n");
  ------------------
  |  |   44|  3.88k|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 3.88k]
  |  |  ------------------
  ------------------
 1230|  3.88k|            dav1d_ref_dec(&ref);
 1231|  3.88k|            goto error;
 1232|  3.88k|        }
 1233|       |
 1234|  34.2k|        const int op_idx =
 1235|  34.2k|            c->operating_point < seq_hdr->num_operating_points ? c->operating_point : 0;
  ------------------
  |  Branch (1235:13): [True: 34.2k, False: 0]
  ------------------
 1236|  34.2k|        c->operating_point_idc = seq_hdr->operating_points[op_idx].idc;
 1237|  34.2k|        const unsigned spatial_mask = c->operating_point_idc >> 8;
 1238|  34.2k|        c->max_spatial_id = spatial_mask ? ulog2(spatial_mask) : 0;
  ------------------
  |  Branch (1238:29): [True: 9.67k, False: 24.6k]
  ------------------
 1239|       |
 1240|       |        // If we have read a sequence header which is different from
 1241|       |        // the old one, this is a new video sequence and can't use any
 1242|       |        // previous state. Free that state.
 1243|       |
 1244|  34.2k|        if (!c->seq_hdr) {
  ------------------
  |  Branch (1244:13): [True: 14.6k, False: 19.6k]
  ------------------
 1245|  14.6k|            c->frame_hdr = NULL;
 1246|  14.6k|            c->frame_flags |= PICTURE_FLAG_NEW_SEQUENCE;
 1247|       |        // see 7.5, operating_parameter_info is allowed to change in
 1248|       |        // sequence headers of a single sequence
 1249|  19.6k|        } else if (memcmp(seq_hdr, c->seq_hdr, offsetof(Dav1dSequenceHeader, operating_parameter_info))) {
  ------------------
  |  Branch (1249:20): [True: 7.09k, False: 12.5k]
  ------------------
 1250|  7.09k|            c->frame_hdr = NULL;
 1251|  7.09k|            c->mastering_display = NULL;
 1252|  7.09k|            c->content_light = NULL;
 1253|  7.09k|            dav1d_ref_dec(&c->mastering_display_ref);
 1254|  7.09k|            dav1d_ref_dec(&c->content_light_ref);
 1255|  63.8k|            for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (1255:29): [True: 56.7k, False: 7.09k]
  ------------------
 1256|  56.7k|                if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (1256:21): [True: 33.8k, False: 22.9k]
  ------------------
 1257|  33.8k|                    dav1d_thread_picture_unref(&c->refs[i].p);
 1258|  56.7k|                dav1d_ref_dec(&c->refs[i].segmap);
 1259|  56.7k|                dav1d_ref_dec(&c->refs[i].refmvs);
 1260|  56.7k|                dav1d_cdf_thread_unref(&c->cdf[i]);
 1261|  56.7k|            }
 1262|  7.09k|            c->frame_flags |= PICTURE_FLAG_NEW_SEQUENCE;
 1263|       |        // If operating_parameter_info changed, signal it
 1264|  12.5k|        } else if (memcmp(seq_hdr->operating_parameter_info, c->seq_hdr->operating_parameter_info,
  ------------------
  |  Branch (1264:20): [True: 109, False: 12.4k]
  ------------------
 1265|  12.5k|                          sizeof(seq_hdr->operating_parameter_info)))
 1266|    109|        {
 1267|    109|            c->frame_flags |= PICTURE_FLAG_NEW_OP_PARAMS_INFO;
 1268|    109|        }
 1269|  34.2k|        dav1d_ref_dec(&c->seq_hdr_ref);
 1270|  34.2k|        c->seq_hdr_ref = ref;
 1271|  34.2k|        c->seq_hdr = seq_hdr;
 1272|  34.2k|        break;
 1273|  38.1k|    }
 1274|  1.48k|    case DAV1D_OBU_REDUNDANT_FRAME_HDR:
  ------------------
  |  Branch (1274:5): [True: 1.48k, False: 381k]
  ------------------
 1275|  1.48k|        if (c->frame_hdr) break;
  ------------------
  |  Branch (1275:13): [True: 221, False: 1.26k]
  ------------------
 1276|       |        // fall-through
 1277|   246k|    case DAV1D_OBU_FRAME:
  ------------------
  |  Branch (1277:5): [True: 245k, False: 138k]
  ------------------
 1278|   284k|    case DAV1D_OBU_FRAME_HDR:
  ------------------
  |  Branch (1278:5): [True: 38.3k, False: 345k]
  ------------------
 1279|   284k|        if (!c->seq_hdr) goto error;
  ------------------
  |  Branch (1279:13): [True: 194, False: 284k]
  ------------------
 1280|   284k|        if (!c->frame_hdr_ref) {
  ------------------
  |  Branch (1280:13): [True: 221k, False: 63.1k]
  ------------------
 1281|   221k|            c->frame_hdr_ref = dav1d_ref_create_using_pool(c->frame_hdr_pool,
 1282|   221k|                                                           sizeof(Dav1dFrameHeader));
 1283|   221k|            if (!c->frame_hdr_ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (1283:17): [True: 0, False: 221k]
  ------------------
 1284|   221k|        }
 1285|   284k|#ifndef NDEBUG
 1286|       |        // ensure that the reference is writable
 1287|   284k|        assert(dav1d_ref_is_writable(c->frame_hdr_ref));
  ------------------
  |  Branch (1287:9): [True: 284k, False: 0]
  ------------------
 1288|   284k|#endif
 1289|   284k|        c->frame_hdr = c->frame_hdr_ref->data;
 1290|   284k|        memset(c->frame_hdr, 0, sizeof(*c->frame_hdr));
 1291|   284k|        c->frame_hdr->temporal_id = temporal_id;
 1292|   284k|        c->frame_hdr->spatial_id = spatial_id;
 1293|   284k|        if ((res = parse_frame_hdr(c, &gb)) < 0) {
  ------------------
  |  Branch (1293:13): [True: 11.1k, False: 273k]
  ------------------
 1294|  11.1k|            c->frame_hdr = NULL;
 1295|  11.1k|            goto error;
 1296|  11.1k|        }
 1297|   277k|        for (int n = 0; n < c->n_tile_data; n++)
  ------------------
  |  Branch (1297:25): [True: 3.54k, False: 273k]
  ------------------
 1298|  3.54k|            dav1d_data_unref_internal(&c->tile[n].data);
 1299|   273k|        c->n_tile_data = 0;
 1300|   273k|        c->n_tiles = 0;
 1301|   273k|        if (type != DAV1D_OBU_FRAME) {
  ------------------
  |  Branch (1301:13): [True: 37.7k, False: 235k]
  ------------------
 1302|       |            // This is actually a frame header OBU so read the
 1303|       |            // trailing bit and check for overrun.
 1304|  37.7k|            if (check_trailing_bits(&gb, c->strict_std_compliance) < 0) {
  ------------------
  |  Branch (1304:17): [True: 6.70k, False: 31.0k]
  ------------------
 1305|  6.70k|                c->frame_hdr = NULL;
 1306|  6.70k|                goto error;
 1307|  6.70k|            }
 1308|  37.7k|        }
 1309|       |
 1310|   266k|        if (c->frame_size_limit && (int64_t)c->frame_hdr->width[1] *
  ------------------
  |  Branch (1310:13): [True: 266k, False: 0]
  |  Branch (1310:36): [True: 310, False: 266k]
  ------------------
 1311|   266k|            c->frame_hdr->height > c->frame_size_limit)
 1312|    310|        {
 1313|    310|            dav1d_log(c, "Frame size %dx%d exceeds limit %u\n", c->frame_hdr->width[1],
  ------------------
  |  |   44|    310|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 310]
  |  |  ------------------
  ------------------
 1314|    310|                      c->frame_hdr->height, c->frame_size_limit);
 1315|    310|            c->frame_hdr = NULL;
 1316|    310|            return DAV1D_ERR(ERANGE);
  ------------------
  |  |   58|    310|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 1317|    310|        }
 1318|       |
 1319|   266k|        if (type != DAV1D_OBU_FRAME)
  ------------------
  |  Branch (1319:13): [True: 31.0k, False: 235k]
  ------------------
 1320|  31.0k|            break;
 1321|       |        // OBU_FRAMEs shouldn't be signaled with show_existing_frame
 1322|   235k|        if (c->frame_hdr->show_existing_frame) {
  ------------------
  |  Branch (1322:13): [True: 3.22k, False: 232k]
  ------------------
 1323|  3.22k|            c->frame_hdr = NULL;
 1324|  3.22k|            goto error;
 1325|  3.22k|        }
 1326|       |
 1327|       |        // This is the frame header at the start of a frame OBU.
 1328|       |        // There's no trailing bit at the end to skip, but we do need
 1329|       |        // to align to the next byte.
 1330|   232k|        dav1d_bytealign_get_bits(&gb);
 1331|       |        // fall-through
 1332|   236k|    case DAV1D_OBU_TILE_GRP: {
  ------------------
  |  Branch (1332:5): [True: 4.05k, False: 379k]
  ------------------
 1333|   236k|        if (!c->frame_hdr) goto error;
  ------------------
  |  Branch (1333:13): [True: 2.26k, False: 234k]
  ------------------
 1334|   234k|        if (c->n_tile_data_alloc < c->n_tile_data + 1) {
  ------------------
  |  Branch (1334:13): [True: 13.9k, False: 220k]
  ------------------
 1335|  13.9k|            if ((c->n_tile_data + 1) > INT_MAX / (int)sizeof(*c->tile)) goto error;
  ------------------
  |  Branch (1335:17): [True: 0, False: 13.9k]
  ------------------
 1336|  13.9k|            struct Dav1dTileGroup *tile = dav1d_realloc(ALLOC_TILE, c->tile,
  ------------------
  |  |  133|  13.9k|#define dav1d_realloc(type, ptr, sz) realloc(ptr, sz)
  ------------------
 1337|  13.9k|                                                        (c->n_tile_data + 1) * sizeof(*c->tile));
 1338|  13.9k|            if (!tile) goto error;
  ------------------
  |  Branch (1338:17): [True: 0, False: 13.9k]
  ------------------
 1339|  13.9k|            c->tile = tile;
 1340|  13.9k|            memset(c->tile + c->n_tile_data, 0, sizeof(*c->tile));
 1341|  13.9k|            c->n_tile_data_alloc = c->n_tile_data + 1;
 1342|  13.9k|        }
 1343|   234k|        parse_tile_hdr(c, &gb);
 1344|       |        // Align to the next byte boundary and check for overrun.
 1345|   234k|        dav1d_bytealign_get_bits(&gb);
 1346|   234k|        if (gb.error) goto error;
  ------------------
  |  Branch (1346:13): [True: 11.2k, False: 222k]
  ------------------
 1347|       |
 1348|   222k|        dav1d_data_ref(&c->tile[c->n_tile_data].data, in);
 1349|   222k|        c->tile[c->n_tile_data].data.data = gb.ptr;
 1350|   222k|        c->tile[c->n_tile_data].data.sz = (size_t)(gb.ptr_end - gb.ptr);
 1351|       |        // ensure tile groups are in order and sane, see 6.10.1
 1352|   222k|        if (c->tile[c->n_tile_data].start > c->tile[c->n_tile_data].end ||
  ------------------
  |  Branch (1352:13): [True: 989, False: 221k]
  ------------------
 1353|   221k|            c->tile[c->n_tile_data].start != c->n_tiles)
  ------------------
  |  Branch (1353:13): [True: 998, False: 220k]
  ------------------
 1354|  1.98k|        {
 1355|  4.33k|            for (int i = 0; i <= c->n_tile_data; i++)
  ------------------
  |  Branch (1355:29): [True: 2.34k, False: 1.98k]
  ------------------
 1356|  2.34k|                dav1d_data_unref_internal(&c->tile[i].data);
 1357|  1.98k|            c->n_tile_data = 0;
 1358|  1.98k|            c->n_tiles = 0;
 1359|  1.98k|            goto error;
 1360|  1.98k|        }
 1361|   220k|        c->n_tiles += 1 + c->tile[c->n_tile_data].end -
 1362|   220k|                          c->tile[c->n_tile_data].start;
 1363|   220k|        c->n_tile_data++;
 1364|   220k|        break;
 1365|   222k|    }
 1366|  6.63k|    case DAV1D_OBU_METADATA: {
  ------------------
  |  Branch (1366:5): [True: 6.63k, False: 376k]
  ------------------
 1367|  6.63k|#define DEBUG_OBU_METADATA 0
 1368|       |#if DEBUG_OBU_METADATA
 1369|       |        const uint8_t *const init_ptr = gb.ptr;
 1370|       |#endif
 1371|       |        // obu metadta type field
 1372|  6.63k|        const enum ObuMetaType meta_type = dav1d_get_uleb128(&gb);
 1373|  6.63k|        if (gb.error) goto error;
  ------------------
  |  Branch (1373:13): [True: 640, False: 5.99k]
  ------------------
 1374|       |
 1375|  5.99k|        switch (meta_type) {
 1376|    883|        case OBU_META_HDR_CLL: {
  ------------------
  |  Branch (1376:9): [True: 883, False: 5.11k]
  ------------------
 1377|    883|            Dav1dRef *ref = dav1d_ref_create(ALLOC_OBU_META,
  ------------------
  |  |   49|    883|#define dav1d_ref_create(type, size) dav1d_ref_create(size)
  ------------------
 1378|    883|                                             sizeof(Dav1dContentLightLevel));
 1379|    883|            if (!ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (1379:17): [True: 0, False: 883]
  ------------------
 1380|    883|            Dav1dContentLightLevel *const content_light = ref->data;
 1381|       |
 1382|    883|            content_light->max_content_light_level = dav1d_get_bits(&gb, 16);
 1383|       |#if DEBUG_OBU_METADATA
 1384|       |            printf("CLLOBU: max-content-light-level: %d [off=%td]\n",
 1385|       |                   content_light->max_content_light_level,
 1386|       |                   (gb.ptr - init_ptr) * 8 - gb.bits_left);
 1387|       |#endif
 1388|    883|            content_light->max_frame_average_light_level = dav1d_get_bits(&gb, 16);
 1389|       |#if DEBUG_OBU_METADATA
 1390|       |            printf("CLLOBU: max-frame-average-light-level: %d [off=%td]\n",
 1391|       |                   content_light->max_frame_average_light_level,
 1392|       |                   (gb.ptr - init_ptr) * 8 - gb.bits_left);
 1393|       |#endif
 1394|       |
 1395|    883|            if (check_trailing_bits(&gb, c->strict_std_compliance) < 0) {
  ------------------
  |  Branch (1395:17): [True: 246, False: 637]
  ------------------
 1396|    246|                dav1d_ref_dec(&ref);
 1397|    246|                goto error;
 1398|    246|            }
 1399|       |
 1400|    637|            dav1d_ref_dec(&c->content_light_ref);
 1401|    637|            c->content_light = content_light;
 1402|    637|            c->content_light_ref = ref;
 1403|    637|            break;
 1404|    883|        }
 1405|    533|        case OBU_META_HDR_MDCV: {
  ------------------
  |  Branch (1405:9): [True: 533, False: 5.46k]
  ------------------
 1406|    533|            Dav1dRef *ref = dav1d_ref_create(ALLOC_OBU_META,
  ------------------
  |  |   49|    533|#define dav1d_ref_create(type, size) dav1d_ref_create(size)
  ------------------
 1407|    533|                                             sizeof(Dav1dMasteringDisplay));
 1408|    533|            if (!ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (1408:17): [True: 0, False: 533]
  ------------------
 1409|    533|            Dav1dMasteringDisplay *const mastering_display = ref->data;
 1410|       |
 1411|  2.13k|            for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (1411:29): [True: 1.59k, False: 533]
  ------------------
 1412|  1.59k|                mastering_display->primaries[i][0] = dav1d_get_bits(&gb, 16);
 1413|  1.59k|                mastering_display->primaries[i][1] = dav1d_get_bits(&gb, 16);
 1414|       |#if DEBUG_OBU_METADATA
 1415|       |                printf("MDCVOBU: primaries[%d]: (%d, %d) [off=%td]\n", i,
 1416|       |                       mastering_display->primaries[i][0],
 1417|       |                       mastering_display->primaries[i][1],
 1418|       |                       (gb.ptr - init_ptr) * 8 - gb.bits_left);
 1419|       |#endif
 1420|  1.59k|            }
 1421|    533|            mastering_display->white_point[0] = dav1d_get_bits(&gb, 16);
 1422|       |#if DEBUG_OBU_METADATA
 1423|       |            printf("MDCVOBU: white-point-x: %d [off=%td]\n",
 1424|       |                   mastering_display->white_point[0],
 1425|       |                   (gb.ptr - init_ptr) * 8 - gb.bits_left);
 1426|       |#endif
 1427|    533|            mastering_display->white_point[1] = dav1d_get_bits(&gb, 16);
 1428|       |#if DEBUG_OBU_METADATA
 1429|       |            printf("MDCVOBU: white-point-y: %d [off=%td]\n",
 1430|       |                   mastering_display->white_point[1],
 1431|       |                   (gb.ptr - init_ptr) * 8 - gb.bits_left);
 1432|       |#endif
 1433|    533|            mastering_display->max_luminance = dav1d_get_bits(&gb, 32);
 1434|       |#if DEBUG_OBU_METADATA
 1435|       |            printf("MDCVOBU: max-luminance: %d [off=%td]\n",
 1436|       |                   mastering_display->max_luminance,
 1437|       |                   (gb.ptr - init_ptr) * 8 - gb.bits_left);
 1438|       |#endif
 1439|    533|            mastering_display->min_luminance = dav1d_get_bits(&gb, 32);
 1440|       |#if DEBUG_OBU_METADATA
 1441|       |            printf("MDCVOBU: min-luminance: %d [off=%td]\n",
 1442|       |                   mastering_display->min_luminance,
 1443|       |                   (gb.ptr - init_ptr) * 8 - gb.bits_left);
 1444|       |#endif
 1445|    533|            if (check_trailing_bits(&gb, c->strict_std_compliance) < 0) {
  ------------------
  |  Branch (1445:17): [True: 321, False: 212]
  ------------------
 1446|    321|                dav1d_ref_dec(&ref);
 1447|    321|                goto error;
 1448|    321|            }
 1449|       |
 1450|    212|            dav1d_ref_dec(&c->mastering_display_ref);
 1451|    212|            c->mastering_display = mastering_display;
 1452|    212|            c->mastering_display_ref = ref;
 1453|    212|            break;
 1454|    533|        }
 1455|  3.90k|        case OBU_META_ITUT_T35: {
  ------------------
  |  Branch (1455:9): [True: 3.90k, False: 2.08k]
  ------------------
 1456|  3.90k|            ptrdiff_t payload_size = gb.ptr_end - gb.ptr;
 1457|       |            // Don't take into account all the trailing bits for payload_size
 1458|  4.34k|            while (payload_size > 0 && !gb.ptr[payload_size - 1])
  ------------------
  |  Branch (1458:20): [True: 3.31k, False: 1.02k]
  |  Branch (1458:40): [True: 436, False: 2.88k]
  ------------------
 1459|    436|                payload_size--; // trailing_zero_bit x 8
 1460|  3.90k|            payload_size--; // trailing_one_bit + trailing_zero_bit x 7
 1461|       |
 1462|  3.90k|            int country_code_extension_byte = 0;
 1463|  3.90k|            const int country_code = dav1d_get_bits(&gb, 8);
 1464|  3.90k|            payload_size--;
 1465|  3.90k|            if (country_code == 0xFF) {
  ------------------
  |  Branch (1465:17): [True: 452, False: 3.45k]
  ------------------
 1466|    452|                country_code_extension_byte = dav1d_get_bits(&gb, 8);
 1467|    452|                payload_size--;
 1468|    452|            }
 1469|       |
 1470|  3.90k|            if (payload_size <= 0 || gb.ptr[payload_size] != 0x80) {
  ------------------
  |  Branch (1470:17): [True: 1.12k, False: 2.78k]
  |  Branch (1470:38): [True: 508, False: 2.27k]
  ------------------
 1471|  1.63k|                dav1d_log(c, "Malformed ITU-T T.35 metadata message format\n");
  ------------------
  |  |   44|  1.63k|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 1.63k]
  |  |  ------------------
  ------------------
 1472|  1.63k|                break;
 1473|  1.63k|            }
 1474|       |
 1475|  2.27k|            if ((c->n_itut_t35 + 1) > INT_MAX / (int)sizeof(*c->itut_t35)) goto error;
  ------------------
  |  Branch (1475:17): [True: 0, False: 2.27k]
  ------------------
 1476|  2.27k|            uint8_t *const payload = dav1d_malloc(ALLOC_OBU_META, payload_size);
  ------------------
  |  |  132|  2.27k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 1477|  2.27k|            if (!payload) goto error;
  ------------------
  |  Branch (1477:17): [True: 0, False: 2.27k]
  ------------------
 1478|       |
 1479|  2.27k|            struct itut_t35_ctx_context *itut_t35_ctx = NULL;
 1480|  2.27k|            if (!c->n_itut_t35) {
  ------------------
  |  Branch (1480:17): [True: 823, False: 1.44k]
  ------------------
 1481|    823|                assert(!c->itut_t35_ref);
  ------------------
  |  Branch (1481:17): [True: 823, False: 0]
  ------------------
 1482|    823|                itut_t35_ctx = dav1d_malloc(ALLOC_OBU_META, sizeof(struct itut_t35_ctx_context));
  ------------------
  |  |  132|    823|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 1483|    823|                if (!itut_t35_ctx) {
  ------------------
  |  Branch (1483:21): [True: 0, False: 823]
  ------------------
 1484|      0|                    dav1d_free(payload);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
 1485|      0|                    goto error;
 1486|      0|                }
 1487|    823|            }
 1488|       |
 1489|  2.27k|            struct Dav1dITUTT35 *itut_t35 = dav1d_realloc(ALLOC_OBU_META, c->itut_t35,
  ------------------
  |  |  133|  2.27k|#define dav1d_realloc(type, ptr, sz) realloc(ptr, sz)
  ------------------
 1490|  2.27k|                                                          (c->n_itut_t35 + 1) * sizeof(*c->itut_t35));
 1491|  2.27k|            if (!itut_t35) {
  ------------------
  |  Branch (1491:17): [True: 0, False: 2.27k]
  ------------------
 1492|      0|                dav1d_free(itut_t35_ctx);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
 1493|      0|                dav1d_free(payload);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
 1494|      0|                goto error;
 1495|      0|            }
 1496|  2.27k|            c->itut_t35 = itut_t35;
 1497|  2.27k|            memset(c->itut_t35 + c->n_itut_t35, 0, sizeof(*c->itut_t35));
 1498|       |
 1499|  2.27k|            if (!c->n_itut_t35) {
  ------------------
  |  Branch (1499:17): [True: 823, False: 1.44k]
  ------------------
 1500|    823|                c->itut_t35_ref = dav1d_ref_init(&itut_t35_ctx->ref, c->itut_t35,
 1501|    823|                                                 dav1d_picture_free_itut_t35, itut_t35_ctx, 0);
 1502|  1.44k|            } else {
 1503|  1.44k|                assert(c->itut_t35_ref &&
  ------------------
  |  Branch (1503:17): [True: 1.44k, False: 0]
  |  Branch (1503:17): [True: 1.44k, False: 0]
  ------------------
 1504|  1.44k|                       atomic_load_explicit(&c->itut_t35_ref->ref_cnt, memory_order_relaxed) == 1);
 1505|  1.44k|                itut_t35_ctx = c->itut_t35_ref->user_data;
 1506|  1.44k|                c->itut_t35_ref->const_data = (uint8_t *)c->itut_t35;
 1507|  1.44k|            }
 1508|  2.27k|            itut_t35_ctx->itut_t35 = c->itut_t35;
 1509|  2.27k|            itut_t35_ctx->n_itut_t35 = c->n_itut_t35 + 1;
 1510|       |
 1511|  2.27k|            Dav1dITUTT35 *const itut_t35_metadata = &c->itut_t35[c->n_itut_t35];
 1512|  2.27k|            itut_t35_metadata->payload = payload;
 1513|       |
 1514|  2.27k|            itut_t35_metadata->country_code = country_code;
 1515|  2.27k|            itut_t35_metadata->country_code_extension_byte = country_code_extension_byte;
 1516|  2.27k|            itut_t35_metadata->payload_size = payload_size;
 1517|       |
 1518|       |            // We know that we've read a whole number of bytes and that the
 1519|       |            // payload is within the OBU boundaries, so just use memcpy()
 1520|  2.27k|            assert(gb.bits_left == 0);
  ------------------
  |  Branch (1520:13): [True: 2.27k, False: 0]
  ------------------
 1521|  2.27k|            memcpy(itut_t35_metadata->payload, gb.ptr, payload_size);
 1522|       |
 1523|  2.27k|            c->n_itut_t35++;
 1524|  2.27k|            break;
 1525|  2.27k|        }
 1526|      1|        case OBU_META_SCALABILITY:
  ------------------
  |  Branch (1526:9): [True: 1, False: 5.99k]
  ------------------
 1527|      6|        case OBU_META_TIMECODE:
  ------------------
  |  Branch (1527:9): [True: 5, False: 5.99k]
  ------------------
 1528|       |            // ignore metadata OBUs we don't care about
 1529|      6|            break;
 1530|    665|        default:
  ------------------
  |  Branch (1530:9): [True: 665, False: 5.33k]
  ------------------
 1531|       |            // print a warning but don't fail for unknown types
 1532|    665|            if (meta_type > 31) // Types 6 to 31 are "Unregistered user private", so ignore them.
  ------------------
  |  Branch (1532:17): [True: 591, False: 74]
  ------------------
 1533|    591|                dav1d_log(c, "Unknown Metadata OBU type %d\n", meta_type);
  ------------------
  |  |   44|    591|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 591]
  |  |  ------------------
  ------------------
 1534|    665|            break;
 1535|  5.99k|        }
 1536|       |
 1537|  5.42k|        break;
 1538|  5.99k|    }
 1539|  43.1k|    case DAV1D_OBU_TD:
  ------------------
  |  Branch (1539:5): [True: 43.1k, False: 340k]
  ------------------
 1540|  43.1k|        c->frame_flags |= PICTURE_FLAG_NEW_TEMPORAL_UNIT;
 1541|  43.1k|        break;
 1542|    472|    case DAV1D_OBU_PADDING:
  ------------------
  |  Branch (1542:5): [True: 472, False: 382k]
  ------------------
 1543|       |        // ignore OBUs we don't care about
 1544|    472|        break;
 1545|  5.83k|    default:
  ------------------
  |  Branch (1545:5): [True: 5.83k, False: 377k]
  ------------------
 1546|       |        // print a warning but don't fail for unknown types
 1547|  5.83k|        dav1d_log(c, "Unknown OBU type %d of size %td\n", type, gb.ptr_end - gb.ptr);
  ------------------
  |  |   44|  5.83k|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 5.83k]
  |  |  ------------------
  ------------------
 1548|  5.83k|        break;
 1549|   383k|    }
 1550|       |
 1551|   341k|    if (c->seq_hdr && c->frame_hdr) {
  ------------------
  |  Branch (1551:9): [True: 338k, False: 2.49k]
  |  Branch (1551:23): [True: 257k, False: 81.1k]
  ------------------
 1552|   257k|        if (c->frame_hdr->show_existing_frame) {
  ------------------
  |  Branch (1552:13): [True: 28.5k, False: 229k]
  ------------------
 1553|  28.5k|            if (!c->refs[c->frame_hdr->existing_frame_idx].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (1553:17): [True: 915, False: 27.6k]
  ------------------
 1554|  27.6k|            switch (c->refs[c->frame_hdr->existing_frame_idx].p.p.frame_hdr->frame_type) {
 1555|  13.1k|            case DAV1D_FRAME_TYPE_INTER:
  ------------------
  |  Branch (1555:13): [True: 13.1k, False: 14.5k]
  ------------------
 1556|  13.1k|            case DAV1D_FRAME_TYPE_SWITCH:
  ------------------
  |  Branch (1556:13): [True: 69, False: 27.5k]
  ------------------
 1557|  13.1k|                if (c->decode_frame_type > DAV1D_DECODEFRAMETYPE_REFERENCE)
  ------------------
  |  Branch (1557:21): [True: 0, False: 13.1k]
  ------------------
 1558|      0|                    goto skip;
 1559|  13.1k|                break;
 1560|  13.1k|            case DAV1D_FRAME_TYPE_INTRA:
  ------------------
  |  Branch (1560:13): [True: 893, False: 26.7k]
  ------------------
 1561|    893|                if (c->decode_frame_type > DAV1D_DECODEFRAMETYPE_INTRA)
  ------------------
  |  Branch (1561:21): [True: 0, False: 893]
  ------------------
 1562|      0|                    goto skip;
 1563|       |                // fall-through
 1564|  14.4k|            default:
  ------------------
  |  Branch (1564:13): [True: 13.5k, False: 14.0k]
  ------------------
 1565|  14.4k|                break;
 1566|  27.6k|            }
 1567|  27.6k|            if (!c->refs[c->frame_hdr->existing_frame_idx].p.p.data[0]) goto error;
  ------------------
  |  Branch (1567:17): [True: 0, False: 27.6k]
  ------------------
 1568|  27.6k|            if (c->strict_std_compliance &&
  ------------------
  |  Branch (1568:17): [True: 0, False: 27.6k]
  ------------------
 1569|      0|                !c->refs[c->frame_hdr->existing_frame_idx].p.showable)
  ------------------
  |  Branch (1569:17): [True: 0, False: 0]
  ------------------
 1570|      0|            {
 1571|      0|                goto error;
 1572|      0|            }
 1573|  27.6k|            if (c->n_fc == 1) {
  ------------------
  |  Branch (1573:17): [True: 0, False: 27.6k]
  ------------------
 1574|      0|                dav1d_thread_picture_ref(&c->out,
 1575|      0|                                         &c->refs[c->frame_hdr->existing_frame_idx].p);
 1576|      0|                dav1d_picture_copy_props(&c->out.p,
 1577|      0|                                         c->content_light, c->content_light_ref,
 1578|      0|                                         c->mastering_display, c->mastering_display_ref,
 1579|      0|                                         c->itut_t35, c->itut_t35_ref, c->n_itut_t35,
 1580|      0|                                         &in->m);
 1581|       |                // Must be removed from the context after being attached to the frame
 1582|      0|                dav1d_ref_dec(&c->itut_t35_ref);
 1583|      0|                c->itut_t35 = NULL;
 1584|      0|                c->n_itut_t35 = 0;
 1585|      0|                c->event_flags |= dav1d_picture_get_event_flags(&c->refs[c->frame_hdr->existing_frame_idx].p);
 1586|  27.6k|            } else {
 1587|  27.6k|                pthread_mutex_lock(&c->task_thread.lock);
 1588|       |                // need to append this to the frame output queue
 1589|  27.6k|                const unsigned next = c->frame_thread.next++;
 1590|  27.6k|                if (c->frame_thread.next == c->n_fc)
  ------------------
  |  Branch (1590:21): [True: 6.88k, False: 20.7k]
  ------------------
 1591|  6.88k|                    c->frame_thread.next = 0;
 1592|       |
 1593|  27.6k|                Dav1dFrameContext *const f = &c->fc[next];
 1594|  33.2k|                while (f->n_tile_data > 0)
  ------------------
  |  Branch (1594:24): [True: 5.60k, False: 27.6k]
  ------------------
 1595|  5.60k|                    pthread_cond_wait(&f->task_thread.cond,
 1596|  5.60k|                                      &f->task_thread.ttd->lock);
 1597|  27.6k|                Dav1dThreadPicture *const out_delayed =
 1598|  27.6k|                    &c->frame_thread.out_delayed[next];
 1599|  27.6k|                if (out_delayed->p.data[0] ||
  ------------------
  |  Branch (1599:21): [True: 26.4k, False: 1.20k]
  ------------------
 1600|  27.6k|                    atomic_load_explicit(&f->task_thread.error, memory_order_relaxed))
  ------------------
  |  Branch (1600:21): [True: 552, False: 648]
  ------------------
 1601|  27.0k|                {
 1602|  27.0k|                    unsigned first = atomic_load_explicit(&c->task_thread.first,
 1603|  27.0k|                                                          memory_order_relaxed);
 1604|  27.0k|                    if (first + 1U < c->n_fc)
  ------------------
  |  Branch (1604:25): [True: 20.3k, False: 6.66k]
  ------------------
 1605|  27.0k|                        atomic_fetch_add_explicit(&c->task_thread.first, 1U, memory_order_relaxed);
 1606|  6.66k|                    else
 1607|  27.0k|                        atomic_store_explicit(&c->task_thread.first, 0, memory_order_relaxed);
 1608|  27.0k|                    atomic_compare_exchange_strong_explicit(&c->task_thread.reset_task_cur,
 1609|  27.0k|                                                            &first, UINT_MAX,
 1610|  27.0k|                                                            memory_order_relaxed,
 1611|  27.0k|                                                            memory_order_relaxed);
 1612|  27.0k|                    if (c->task_thread.cur && c->task_thread.cur < c->n_fc)
  ------------------
  |  Branch (1612:25): [True: 25.9k, False: 1.10k]
  |  Branch (1612:47): [True: 16.5k, False: 9.39k]
  ------------------
 1613|  16.5k|                        c->task_thread.cur--;
 1614|  27.0k|                }
 1615|  27.6k|                const int error = f->task_thread.retval;
 1616|  27.6k|                if (error) {
  ------------------
  |  Branch (1616:21): [True: 2.56k, False: 25.0k]
  ------------------
 1617|  2.56k|                    c->cached_error = error;
 1618|  2.56k|                    f->task_thread.retval = 0;
 1619|  2.56k|                    dav1d_data_props_copy(&c->cached_error_props, &out_delayed->p.m);
 1620|  2.56k|                    dav1d_thread_picture_unref(out_delayed);
 1621|  25.0k|                } else if (out_delayed->p.data[0]) {
  ------------------
  |  Branch (1621:28): [True: 23.8k, False: 1.20k]
  ------------------
 1622|  23.8k|                    const unsigned progress = atomic_load_explicit(&out_delayed->progress[1],
 1623|  23.8k|                                                                   memory_order_relaxed);
 1624|  23.8k|                    if ((out_delayed->visible || c->output_invisible_frames) &&
  ------------------
  |  Branch (1624:26): [True: 23.7k, False: 149]
  |  Branch (1624:50): [True: 0, False: 149]
  ------------------
 1625|  23.7k|                        progress != FRAME_ERROR)
  ------------------
  |  |   35|  23.7k|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  |  Branch (1625:25): [True: 13.1k, False: 10.5k]
  ------------------
 1626|  13.1k|                    {
 1627|  13.1k|                        dav1d_thread_picture_ref(&c->out, out_delayed);
 1628|  13.1k|                        c->event_flags |= dav1d_picture_get_event_flags(out_delayed);
 1629|  13.1k|                    }
 1630|  23.8k|                    dav1d_thread_picture_unref(out_delayed);
 1631|  23.8k|                }
 1632|  27.6k|                dav1d_thread_picture_ref(out_delayed,
 1633|  27.6k|                                         &c->refs[c->frame_hdr->existing_frame_idx].p);
 1634|  27.6k|                out_delayed->visible = 1;
 1635|  27.6k|                dav1d_picture_copy_props(&out_delayed->p,
 1636|  27.6k|                                         c->content_light, c->content_light_ref,
 1637|  27.6k|                                         c->mastering_display, c->mastering_display_ref,
 1638|  27.6k|                                         c->itut_t35, c->itut_t35_ref, c->n_itut_t35,
 1639|  27.6k|                                         &in->m);
 1640|       |                // Must be removed from the context after being attached to the frame
 1641|  27.6k|                dav1d_ref_dec(&c->itut_t35_ref);
 1642|  27.6k|                c->itut_t35 = NULL;
 1643|  27.6k|                c->n_itut_t35 = 0;
 1644|       |
 1645|  27.6k|                pthread_mutex_unlock(&c->task_thread.lock);
 1646|  27.6k|            }
 1647|  27.6k|            if (c->refs[c->frame_hdr->existing_frame_idx].p.p.frame_hdr->frame_type == DAV1D_FRAME_TYPE_KEY) {
  ------------------
  |  Branch (1647:17): [True: 13.5k, False: 14.0k]
  ------------------
 1648|  13.5k|                const int r = c->frame_hdr->existing_frame_idx;
 1649|  13.5k|                c->refs[r].p.showable = 0;
 1650|   122k|                for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (1650:33): [True: 108k, False: 13.5k]
  ------------------
 1651|   108k|                    if (i == r) continue;
  ------------------
  |  Branch (1651:25): [True: 13.5k, False: 95.0k]
  ------------------
 1652|       |
 1653|  95.0k|                    if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (1653:25): [True: 94.6k, False: 390]
  ------------------
 1654|  94.6k|                        dav1d_thread_picture_unref(&c->refs[i].p);
 1655|  95.0k|                    dav1d_thread_picture_ref(&c->refs[i].p, &c->refs[r].p);
 1656|       |
 1657|  95.0k|                    dav1d_cdf_thread_unref(&c->cdf[i]);
 1658|  95.0k|                    dav1d_cdf_thread_ref(&c->cdf[i], &c->cdf[r]);
 1659|       |
 1660|  95.0k|                    dav1d_ref_dec(&c->refs[i].segmap);
 1661|  95.0k|                    c->refs[i].segmap = c->refs[r].segmap;
 1662|  95.0k|                    if (c->refs[r].segmap)
  ------------------
  |  Branch (1662:25): [True: 11.0k, False: 83.9k]
  ------------------
 1663|  11.0k|                        dav1d_ref_inc(c->refs[r].segmap);
 1664|  95.0k|                    dav1d_ref_dec(&c->refs[i].refmvs);
 1665|  95.0k|                }
 1666|  13.5k|            }
 1667|  27.6k|            c->frame_hdr = NULL;
 1668|   229k|        } else if (c->n_tiles == c->frame_hdr->tiling.cols * c->frame_hdr->tiling.rows) {
  ------------------
  |  Branch (1668:20): [True: 219k, False: 9.25k]
  ------------------
 1669|   219k|            switch (c->frame_hdr->frame_type) {
 1670|  93.0k|            case DAV1D_FRAME_TYPE_INTER:
  ------------------
  |  Branch (1670:13): [True: 93.0k, False: 126k]
  ------------------
 1671|  93.6k|            case DAV1D_FRAME_TYPE_SWITCH:
  ------------------
  |  Branch (1671:13): [True: 648, False: 219k]
  ------------------
 1672|  93.6k|                if (c->decode_frame_type > DAV1D_DECODEFRAMETYPE_REFERENCE ||
  ------------------
  |  Branch (1672:21): [True: 0, False: 93.6k]
  ------------------
 1673|  93.6k|                    (c->decode_frame_type == DAV1D_DECODEFRAMETYPE_REFERENCE &&
  ------------------
  |  Branch (1673:22): [True: 0, False: 93.6k]
  ------------------
 1674|      0|                     !c->frame_hdr->refresh_frame_flags))
  ------------------
  |  Branch (1674:22): [True: 0, False: 0]
  ------------------
 1675|      0|                    goto skip;
 1676|  93.6k|                break;
 1677|  93.6k|            case DAV1D_FRAME_TYPE_INTRA:
  ------------------
  |  Branch (1677:13): [True: 365, False: 219k]
  ------------------
 1678|    365|                if (c->decode_frame_type > DAV1D_DECODEFRAMETYPE_INTRA ||
  ------------------
  |  Branch (1678:21): [True: 0, False: 365]
  ------------------
 1679|    365|                    (c->decode_frame_type == DAV1D_DECODEFRAMETYPE_REFERENCE &&
  ------------------
  |  Branch (1679:22): [True: 0, False: 365]
  ------------------
 1680|      0|                     !c->frame_hdr->refresh_frame_flags))
  ------------------
  |  Branch (1680:22): [True: 0, False: 0]
  ------------------
 1681|      0|                    goto skip;
 1682|       |                // fall-through
 1683|   126k|            default:
  ------------------
  |  Branch (1683:13): [True: 125k, False: 94.0k]
  ------------------
 1684|   126k|                break;
 1685|   219k|            }
 1686|   219k|            if (!c->n_tile_data)
  ------------------
  |  Branch (1686:17): [True: 0, False: 219k]
  ------------------
 1687|      0|                goto error;
 1688|   219k|            if ((res = dav1d_submit_frame(c)) < 0)
  ------------------
  |  Branch (1688:17): [True: 3.34k, False: 216k]
  ------------------
 1689|  3.34k|                return res;
 1690|   219k|            assert(!c->n_tile_data);
  ------------------
  |  Branch (1690:13): [True: 216k, False: 0]
  ------------------
 1691|   216k|            c->frame_hdr = NULL;
 1692|   216k|            c->n_tiles = 0;
 1693|   216k|        }
 1694|   257k|    }
 1695|       |
 1696|   336k|    return gb.ptr_end - gb.ptr_start;
 1697|       |
 1698|      0|skip:
 1699|       |    // update refs with only the headers in case we skip the frame
 1700|      0|    for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (1700:21): [True: 0, False: 0]
  ------------------
 1701|      0|        if (c->frame_hdr->refresh_frame_flags & (1 << i)) {
  ------------------
  |  Branch (1701:13): [True: 0, False: 0]
  ------------------
 1702|      0|            dav1d_thread_picture_unref(&c->refs[i].p);
 1703|      0|            c->refs[i].p.p.frame_hdr = c->frame_hdr;
 1704|      0|            c->refs[i].p.p.seq_hdr = c->seq_hdr;
 1705|      0|            c->refs[i].p.p.frame_hdr_ref = c->frame_hdr_ref;
 1706|      0|            c->refs[i].p.p.seq_hdr_ref = c->seq_hdr_ref;
 1707|      0|            dav1d_ref_inc(c->frame_hdr_ref);
 1708|      0|            dav1d_ref_inc(c->seq_hdr_ref);
 1709|      0|        }
 1710|      0|    }
 1711|       |
 1712|      0|    dav1d_ref_dec(&c->frame_hdr_ref);
 1713|      0|    c->frame_hdr = NULL;
 1714|      0|    c->n_tiles = 0;
 1715|       |
 1716|      0|    return gb.ptr_end - gb.ptr_start;
 1717|       |
 1718|  48.1k|error:
 1719|  48.1k|    dav1d_data_props_copy(&c->cached_error_props, &in->m);
 1720|  48.1k|    dav1d_log(c, gb.error ? "Overrun in OBU bit buffer\n" :
  ------------------
  |  |   44|  48.1k|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 48.1k]
  |  |  ------------------
  ------------------
 1721|  48.1k|                            "Error parsing OBU data\n");
 1722|  48.1k|    return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|  48.1k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 1723|   341k|}
obu.c:parse_seq_hdr:
   75|  55.8k|{
   76|  55.8k|#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|  55.8k|    memset(hdr, 0, sizeof(*hdr));
   83|  55.8k|    hdr->profile = dav1d_get_bits(gb, 3);
   84|  55.8k|    if (hdr->profile > 2) goto error;
  ------------------
  |  Branch (84:9): [True: 464, False: 55.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|  55.3k|    hdr->still_picture = dav1d_get_bit(gb);
   91|  55.3k|    hdr->reduced_still_picture_header = dav1d_get_bit(gb);
   92|  55.3k|    if (hdr->reduced_still_picture_header && !hdr->still_picture) goto error;
  ------------------
  |  Branch (92:9): [True: 33.2k, False: 22.1k]
  |  Branch (92:46): [True: 223, False: 33.0k]
  ------------------
   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|  55.1k|    if (hdr->reduced_still_picture_header) {
  ------------------
  |  Branch (98:9): [True: 33.0k, False: 22.1k]
  ------------------
   99|  33.0k|        hdr->num_operating_points = 1;
  100|  33.0k|        hdr->operating_points[0].major_level = dav1d_get_bits(gb, 3);
  101|  33.0k|        hdr->operating_points[0].minor_level = dav1d_get_bits(gb, 2);
  102|  33.0k|        hdr->operating_points[0].initial_display_delay = 10;
  103|  33.0k|    } else {
  104|  22.1k|        hdr->timing_info_present = dav1d_get_bit(gb);
  105|  22.1k|        if (hdr->timing_info_present) {
  ------------------
  |  Branch (105:13): [True: 1.58k, False: 20.5k]
  ------------------
  106|  1.58k|            hdr->num_units_in_tick = dav1d_get_bits(gb, 32);
  107|  1.58k|            hdr->time_scale = dav1d_get_bits(gb, 32);
  108|  1.58k|            if (strict_std_compliance && (!hdr->num_units_in_tick || !hdr->time_scale))
  ------------------
  |  Branch (108:17): [True: 0, False: 1.58k]
  |  Branch (108:43): [True: 0, False: 0]
  |  Branch (108:70): [True: 0, False: 0]
  ------------------
  109|      0|                goto error;
  110|  1.58k|            hdr->equal_picture_interval = dav1d_get_bit(gb);
  111|  1.58k|            if (hdr->equal_picture_interval) {
  ------------------
  |  Branch (111:17): [True: 1.21k, False: 364]
  ------------------
  112|  1.21k|                const unsigned num_ticks_per_picture = dav1d_get_vlc(gb);
  113|  1.21k|                if (num_ticks_per_picture == UINT32_MAX)
  ------------------
  |  Branch (113:21): [True: 200, False: 1.01k]
  ------------------
  114|    200|                    goto error;
  115|  1.01k|                hdr->num_ticks_per_picture = num_ticks_per_picture + 1;
  116|  1.01k|            }
  117|       |
  118|  1.38k|            hdr->decoder_model_info_present = dav1d_get_bit(gb);
  119|  1.38k|            if (hdr->decoder_model_info_present) {
  ------------------
  |  Branch (119:17): [True: 886, False: 495]
  ------------------
  120|    886|                hdr->encoder_decoder_buffer_delay_length = dav1d_get_bits(gb, 5) + 1;
  121|    886|                hdr->num_units_in_decoding_tick = dav1d_get_bits(gb, 32);
  122|    886|                if (strict_std_compliance && !hdr->num_units_in_decoding_tick)
  ------------------
  |  Branch (122:21): [True: 0, False: 886]
  |  Branch (122:46): [True: 0, False: 0]
  ------------------
  123|      0|                    goto error;
  124|    886|                hdr->buffer_removal_delay_length = dav1d_get_bits(gb, 5) + 1;
  125|    886|                hdr->frame_presentation_delay_length = dav1d_get_bits(gb, 5) + 1;
  126|    886|            }
  127|  1.38k|        }
  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|  21.9k|        hdr->display_model_info_present = dav1d_get_bit(gb);
  134|  21.9k|        hdr->num_operating_points = dav1d_get_bits(gb, 5) + 1;
  135|  56.4k|        for (int i = 0; i < hdr->num_operating_points; i++) {
  ------------------
  |  Branch (135:25): [True: 36.1k, False: 20.3k]
  ------------------
  136|  36.1k|            struct Dav1dSequenceHeaderOperatingPoint *const op =
  137|  36.1k|                &hdr->operating_points[i];
  138|  36.1k|            op->idc = dav1d_get_bits(gb, 12);
  139|  36.1k|            if (op->idc && (!(op->idc & 0xff) || !(op->idc & 0xf00)))
  ------------------
  |  Branch (139:17): [True: 24.4k, False: 11.6k]
  |  Branch (139:29): [True: 1.44k, False: 23.0k]
  |  Branch (139:50): [True: 102, False: 22.9k]
  ------------------
  140|  1.54k|                goto error;
  141|  34.5k|            op->major_level = 2 + dav1d_get_bits(gb, 3);
  142|  34.5k|            op->minor_level = dav1d_get_bits(gb, 2);
  143|  34.5k|            if (op->major_level > 3)
  ------------------
  |  Branch (143:17): [True: 8.80k, False: 25.7k]
  ------------------
  144|  8.80k|                op->tier = dav1d_get_bit(gb);
  145|  34.5k|            if (hdr->decoder_model_info_present) {
  ------------------
  |  Branch (145:17): [True: 2.86k, False: 31.6k]
  ------------------
  146|  2.86k|                op->decoder_model_param_present = dav1d_get_bit(gb);
  147|  2.86k|                if (op->decoder_model_param_present) {
  ------------------
  |  Branch (147:21): [True: 1.53k, False: 1.33k]
  ------------------
  148|  1.53k|                    struct Dav1dSequenceHeaderOperatingParameterInfo *const opi =
  149|  1.53k|                        &hdr->operating_parameter_info[i];
  150|  1.53k|                    opi->decoder_buffer_delay =
  151|  1.53k|                        dav1d_get_bits(gb, hdr->encoder_decoder_buffer_delay_length);
  152|  1.53k|                    opi->encoder_buffer_delay =
  153|  1.53k|                        dav1d_get_bits(gb, hdr->encoder_decoder_buffer_delay_length);
  154|  1.53k|                    opi->low_delay_mode = dav1d_get_bit(gb);
  155|  1.53k|                }
  156|  2.86k|            }
  157|  34.5k|            if (hdr->display_model_info_present)
  ------------------
  |  Branch (157:17): [True: 6.97k, False: 27.5k]
  ------------------
  158|  6.97k|                op->display_model_param_present = dav1d_get_bit(gb);
  159|  34.5k|            op->initial_display_delay =
  160|  34.5k|                op->display_model_param_present ? dav1d_get_bits(gb, 4) + 1 : 10;
  ------------------
  |  Branch (160:17): [True: 1.55k, False: 33.0k]
  ------------------
  161|  34.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|  21.9k|    }
  167|       |
  168|  53.3k|    hdr->width_n_bits = dav1d_get_bits(gb, 4) + 1;
  169|  53.3k|    hdr->height_n_bits = dav1d_get_bits(gb, 4) + 1;
  170|  53.3k|    hdr->max_width = dav1d_get_bits(gb, hdr->width_n_bits) + 1;
  171|  53.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|  53.3k|    if (!hdr->reduced_still_picture_header) {
  ------------------
  |  Branch (176:9): [True: 20.3k, False: 33.0k]
  ------------------
  177|  20.3k|        hdr->frame_id_numbers_present = dav1d_get_bit(gb);
  178|  20.3k|        if (hdr->frame_id_numbers_present) {
  ------------------
  |  Branch (178:13): [True: 1.32k, False: 19.0k]
  ------------------
  179|  1.32k|            hdr->delta_frame_id_n_bits = dav1d_get_bits(gb, 4) + 2;
  180|  1.32k|            hdr->frame_id_n_bits = dav1d_get_bits(gb, 3) + hdr->delta_frame_id_n_bits + 1;
  181|  1.32k|        }
  182|  20.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|  53.3k|    hdr->sb128 = dav1d_get_bit(gb);
  189|  53.3k|    hdr->filter_intra = dav1d_get_bit(gb);
  190|  53.3k|    hdr->intra_edge_filter = dav1d_get_bit(gb);
  191|  53.3k|    if (hdr->reduced_still_picture_header) {
  ------------------
  |  Branch (191:9): [True: 33.0k, False: 20.3k]
  ------------------
  192|  33.0k|        hdr->screen_content_tools = DAV1D_ADAPTIVE;
  193|  33.0k|        hdr->force_integer_mv = DAV1D_ADAPTIVE;
  194|  33.0k|    } else {
  195|  20.3k|        hdr->inter_intra = dav1d_get_bit(gb);
  196|  20.3k|        hdr->masked_compound = dav1d_get_bit(gb);
  197|  20.3k|        hdr->warped_motion = dav1d_get_bit(gb);
  198|  20.3k|        hdr->dual_filter = dav1d_get_bit(gb);
  199|  20.3k|        hdr->order_hint = dav1d_get_bit(gb);
  200|  20.3k|        if (hdr->order_hint) {
  ------------------
  |  Branch (200:13): [True: 13.9k, False: 6.42k]
  ------------------
  201|  13.9k|            hdr->jnt_comp = dav1d_get_bit(gb);
  202|  13.9k|            hdr->ref_frame_mvs = dav1d_get_bit(gb);
  203|  13.9k|        }
  204|  20.3k|        hdr->screen_content_tools = dav1d_get_bit(gb) ? DAV1D_ADAPTIVE : dav1d_get_bit(gb);
  ------------------
  |  Branch (204:37): [True: 11.3k, False: 9.04k]
  ------------------
  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|  20.3k|        hdr->force_integer_mv = hdr->screen_content_tools ?
  ------------------
  |  Branch (209:33): [True: 17.0k, False: 3.30k]
  ------------------
  210|  17.0k|                                dav1d_get_bit(gb) ? DAV1D_ADAPTIVE : dav1d_get_bit(gb) : 2;
  ------------------
  |  Branch (210:33): [True: 5.50k, False: 11.5k]
  ------------------
  211|  20.3k|        if (hdr->order_hint)
  ------------------
  |  Branch (211:13): [True: 13.9k, False: 6.42k]
  ------------------
  212|  13.9k|            hdr->order_hint_n_bits = dav1d_get_bits(gb, 3) + 1;
  213|  20.3k|    }
  214|  53.3k|    hdr->super_res = dav1d_get_bit(gb);
  215|  53.3k|    hdr->cdef = dav1d_get_bit(gb);
  216|  53.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|  53.3k|    hdr->hbd = dav1d_get_bit(gb);
  223|  53.3k|    if (hdr->profile == 2 && hdr->hbd)
  ------------------
  |  Branch (223:9): [True: 22.4k, False: 30.8k]
  |  Branch (223:30): [True: 17.1k, False: 5.34k]
  ------------------
  224|  17.1k|        hdr->hbd += dav1d_get_bit(gb);
  225|  53.3k|    if (hdr->profile != 1)
  ------------------
  |  Branch (225:9): [True: 42.9k, False: 10.4k]
  ------------------
  226|  42.9k|        hdr->monochrome = dav1d_get_bit(gb);
  227|  53.3k|    hdr->color_description_present = dav1d_get_bit(gb);
  228|  53.3k|    if (hdr->color_description_present) {
  ------------------
  |  Branch (228:9): [True: 7.87k, False: 45.4k]
  ------------------
  229|  7.87k|        hdr->pri = dav1d_get_bits(gb, 8);
  230|  7.87k|        hdr->trc = dav1d_get_bits(gb, 8);
  231|  7.87k|        hdr->mtrx = dav1d_get_bits(gb, 8);
  232|  45.4k|    } else {
  233|  45.4k|        hdr->pri = DAV1D_COLOR_PRI_UNKNOWN;
  234|  45.4k|        hdr->trc = DAV1D_TRC_UNKNOWN;
  235|  45.4k|        hdr->mtrx = DAV1D_MC_UNKNOWN;
  236|  45.4k|    }
  237|  53.3k|    if (hdr->monochrome) {
  ------------------
  |  Branch (237:9): [True: 17.9k, False: 35.4k]
  ------------------
  238|  17.9k|        hdr->color_range = dav1d_get_bit(gb);
  239|  17.9k|        hdr->layout = DAV1D_PIXEL_LAYOUT_I400;
  240|  17.9k|        hdr->ss_hor = hdr->ss_ver = 1;
  241|  17.9k|        hdr->chr = DAV1D_CHR_UNKNOWN;
  242|  35.4k|    } else if (hdr->pri == DAV1D_COLOR_PRI_BT709 &&
  ------------------
  |  Branch (242:16): [True: 3.08k, False: 32.3k]
  ------------------
  243|  3.08k|               hdr->trc == DAV1D_TRC_SRGB &&
  ------------------
  |  Branch (243:16): [True: 2.52k, False: 562]
  ------------------
  244|  2.52k|               hdr->mtrx == DAV1D_MC_IDENTITY)
  ------------------
  |  Branch (244:16): [True: 2.32k, False: 200]
  ------------------
  245|  2.32k|    {
  246|  2.32k|        hdr->layout = DAV1D_PIXEL_LAYOUT_I444;
  247|  2.32k|        hdr->color_range = 1;
  248|  2.32k|        if (hdr->profile != 1 && !(hdr->profile == 2 && hdr->hbd == 2))
  ------------------
  |  Branch (248:13): [True: 2.13k, False: 194]
  |  Branch (248:36): [True: 598, False: 1.53k]
  |  Branch (248:57): [True: 404, False: 194]
  ------------------
  249|  1.72k|            goto error;
  250|  33.0k|    } else {
  251|  33.0k|        hdr->color_range = dav1d_get_bit(gb);
  252|  33.0k|        switch (hdr->profile) {
  ------------------
  |  Branch (252:17): [True: 33.0k, False: 0]
  ------------------
  253|  11.1k|        case 0: hdr->layout = DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (253:9): [True: 11.1k, False: 21.8k]
  ------------------
  254|  11.1k|                hdr->ss_hor = hdr->ss_ver = 1;
  255|  11.1k|                break;
  256|  10.2k|        case 1: hdr->layout = DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (256:9): [True: 10.2k, False: 22.8k]
  ------------------
  257|  10.2k|                break;
  258|  11.6k|        case 2:
  ------------------
  |  Branch (258:9): [True: 11.6k, False: 21.4k]
  ------------------
  259|  11.6k|            if (hdr->hbd == 2) {
  ------------------
  |  Branch (259:17): [True: 7.15k, False: 4.49k]
  ------------------
  260|  7.15k|                hdr->ss_hor = dav1d_get_bit(gb);
  261|  7.15k|                if (hdr->ss_hor)
  ------------------
  |  Branch (261:21): [True: 1.74k, False: 5.41k]
  ------------------
  262|  1.74k|                    hdr->ss_ver = dav1d_get_bit(gb);
  263|  7.15k|            } else
  264|  4.49k|                hdr->ss_hor = 1;
  265|  11.6k|            hdr->layout = hdr->ss_hor ?
  ------------------
  |  Branch (265:27): [True: 6.23k, False: 5.41k]
  ------------------
  266|  6.23k|                          hdr->ss_ver ? DAV1D_PIXEL_LAYOUT_I420 :
  ------------------
  |  Branch (266:27): [True: 1.58k, False: 4.65k]
  ------------------
  267|  6.23k|                                        DAV1D_PIXEL_LAYOUT_I422 :
  268|  11.6k|                                        DAV1D_PIXEL_LAYOUT_I444;
  269|  11.6k|            break;
  270|  33.0k|        }
  271|  33.0k|        hdr->chr = (hdr->ss_hor & hdr->ss_ver) ?
  ------------------
  |  Branch (271:20): [True: 12.7k, False: 20.3k]
  ------------------
  272|  20.3k|                   dav1d_get_bits(gb, 2) : DAV1D_CHR_UNKNOWN;
  273|  33.0k|    }
  274|  51.6k|    if (strict_std_compliance &&
  ------------------
  |  Branch (274:9): [True: 0, False: 51.6k]
  ------------------
  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|  51.6k|    if (!hdr->monochrome)
  ------------------
  |  Branch (279:9): [True: 33.6k, False: 17.9k]
  ------------------
  280|  33.6k|        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|  51.6k|    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|  51.6k|    return check_trailing_bits(gb, strict_std_compliance);
  297|       |
  298|  4.15k|error:
  299|  4.15k|    return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|  4.15k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  300|  51.6k|}
obu.c:parse_frame_hdr:
  419|   284k|static int parse_frame_hdr(Dav1dContext *const c, GetBits *const gb) {
  420|   284k|#define DEBUG_FRAME_HDR 0
  421|       |
  422|       |#if DEBUG_FRAME_HDR
  423|       |    const uint8_t *const init_ptr = gb->ptr;
  424|       |#endif
  425|   284k|    const Dav1dSequenceHeader *const seqhdr = c->seq_hdr;
  426|   284k|    Dav1dFrameHeader *const hdr = c->frame_hdr;
  427|       |
  428|   284k|    if (!seqhdr->reduced_still_picture_header)
  ------------------
  |  Branch (428:9): [True: 159k, False: 125k]
  ------------------
  429|   159k|        hdr->show_existing_frame = dav1d_get_bit(gb);
  430|       |#if DEBUG_FRAME_HDR
  431|       |    printf("HDR: post-show_existing_frame: off=%td\n",
  432|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  433|       |#endif
  434|   284k|    if (hdr->show_existing_frame) {
  ------------------
  |  Branch (434:9): [True: 32.0k, False: 252k]
  ------------------
  435|  32.0k|        hdr->existing_frame_idx = dav1d_get_bits(gb, 3);
  436|  32.0k|        if (seqhdr->decoder_model_info_present && !seqhdr->equal_picture_interval)
  ------------------
  |  Branch (436:13): [True: 464, False: 31.6k]
  |  Branch (436:51): [True: 201, False: 263]
  ------------------
  437|    201|            hdr->frame_presentation_delay = dav1d_get_bits(gb, seqhdr->frame_presentation_delay_length);
  438|  32.0k|        if (seqhdr->frame_id_numbers_present) {
  ------------------
  |  Branch (438:13): [True: 1.10k, False: 30.9k]
  ------------------
  439|  1.10k|            hdr->frame_id = dav1d_get_bits(gb, seqhdr->frame_id_n_bits);
  440|  1.10k|            Dav1dFrameHeader *const ref_frame_hdr = c->refs[hdr->existing_frame_idx].p.p.frame_hdr;
  441|  1.10k|            if (!ref_frame_hdr || ref_frame_hdr->frame_id != hdr->frame_id) goto error;
  ------------------
  |  Branch (441:17): [True: 590, False: 517]
  |  Branch (441:35): [True: 204, False: 313]
  ------------------
  442|  1.10k|        }
  443|  31.2k|        return 0;
  444|  32.0k|    }
  445|       |
  446|   252k|    if (seqhdr->reduced_still_picture_header) {
  ------------------
  |  Branch (446:9): [True: 125k, False: 127k]
  ------------------
  447|   125k|        hdr->frame_type = DAV1D_FRAME_TYPE_KEY;
  448|   125k|        hdr->show_frame = 1;
  449|   127k|    } else {
  450|   127k|        hdr->frame_type = dav1d_get_bits(gb, 2);
  451|   127k|        hdr->show_frame = dav1d_get_bit(gb);
  452|   127k|    }
  453|   252k|    if (hdr->show_frame) {
  ------------------
  |  Branch (453:9): [True: 173k, False: 78.6k]
  ------------------
  454|   173k|        if (seqhdr->decoder_model_info_present && !seqhdr->equal_picture_interval)
  ------------------
  |  Branch (454:13): [True: 1.79k, False: 172k]
  |  Branch (454:51): [True: 698, False: 1.10k]
  ------------------
  455|    698|            hdr->frame_presentation_delay = dav1d_get_bits(gb, seqhdr->frame_presentation_delay_length);
  456|   173k|        hdr->showable_frame = hdr->frame_type != DAV1D_FRAME_TYPE_KEY;
  457|   173k|    } else
  458|  78.6k|        hdr->showable_frame = dav1d_get_bit(gb);
  459|   252k|    hdr->error_resilient_mode =
  460|   252k|        (hdr->frame_type == DAV1D_FRAME_TYPE_KEY && hdr->show_frame) ||
  ------------------
  |  Branch (460:10): [True: 144k, False: 108k]
  |  Branch (460:53): [True: 139k, False: 5.35k]
  ------------------
  461|   113k|        hdr->frame_type == DAV1D_FRAME_TYPE_SWITCH ||
  ------------------
  |  Branch (461:9): [True: 6.67k, False: 106k]
  ------------------
  462|   106k|        seqhdr->reduced_still_picture_header || dav1d_get_bit(gb);
  ------------------
  |  Branch (462:9): [True: 0, False: 106k]
  |  Branch (462:49): [True: 1.91k, False: 104k]
  ------------------
  463|       |#if DEBUG_FRAME_HDR
  464|       |    printf("HDR: post-frametype_bits: off=%td\n",
  465|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  466|       |#endif
  467|   252k|    hdr->disable_cdf_update = dav1d_get_bit(gb);
  468|   252k|    hdr->allow_screen_content_tools = seqhdr->screen_content_tools == DAV1D_ADAPTIVE ?
  ------------------
  |  Branch (468:39): [True: 203k, False: 49.2k]
  ------------------
  469|   203k|                                      dav1d_get_bit(gb) : seqhdr->screen_content_tools;
  470|   252k|    if (hdr->allow_screen_content_tools)
  ------------------
  |  Branch (470:9): [True: 161k, False: 90.5k]
  ------------------
  471|   161k|        hdr->force_integer_mv = seqhdr->force_integer_mv == DAV1D_ADAPTIVE ?
  ------------------
  |  Branch (471:33): [True: 115k, False: 46.1k]
  ------------------
  472|   115k|                                dav1d_get_bit(gb) : seqhdr->force_integer_mv;
  473|       |
  474|   252k|    if (IS_KEY_OR_INTRA(hdr))
  ------------------
  |  |   43|   252k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|   252k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 145k, False: 107k]
  |  |  ------------------
  ------------------
  475|   145k|        hdr->force_integer_mv = 1;
  476|       |
  477|   252k|    if (seqhdr->frame_id_numbers_present)
  ------------------
  |  Branch (477:9): [True: 1.42k, False: 251k]
  ------------------
  478|  1.42k|        hdr->frame_id = dav1d_get_bits(gb, seqhdr->frame_id_n_bits);
  479|       |
  480|   252k|    if (!seqhdr->reduced_still_picture_header)
  ------------------
  |  Branch (480:9): [True: 127k, False: 125k]
  ------------------
  481|   127k|        hdr->frame_size_override = hdr->frame_type == DAV1D_FRAME_TYPE_SWITCH ? 1 : dav1d_get_bit(gb);
  ------------------
  |  Branch (481:36): [True: 6.67k, False: 120k]
  ------------------
  482|       |#if DEBUG_FRAME_HDR
  483|       |    printf("HDR: post-frame_size_override_flag: off=%td\n",
  484|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  485|       |#endif
  486|   252k|    if (seqhdr->order_hint)
  ------------------
  |  Branch (486:9): [True: 105k, False: 146k]
  ------------------
  487|   105k|        hdr->frame_offset = dav1d_get_bits(gb, seqhdr->order_hint_n_bits);
  488|   252k|    hdr->primary_ref_frame = !hdr->error_resilient_mode && IS_INTER_OR_SWITCH(hdr) ?
  ------------------
  |  |   36|   104k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 100k, False: 4.53k]
  |  |  ------------------
  ------------------
  |  Branch (488:30): [True: 104k, False: 147k]
  ------------------
  489|   152k|                             dav1d_get_bits(gb, 3) : DAV1D_PRIMARY_REF_NONE;
  ------------------
  |  |   45|   404k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  490|       |
  491|   252k|    if (seqhdr->decoder_model_info_present) {
  ------------------
  |  Branch (491:9): [True: 2.26k, False: 250k]
  ------------------
  492|  2.26k|        hdr->buffer_removal_time_present = dav1d_get_bit(gb);
  493|  2.26k|        if (hdr->buffer_removal_time_present) {
  ------------------
  |  Branch (493:13): [True: 1.57k, False: 690]
  ------------------
  494|  7.56k|            for (int i = 0; i < c->seq_hdr->num_operating_points; i++) {
  ------------------
  |  Branch (494:29): [True: 5.98k, False: 1.57k]
  ------------------
  495|  5.98k|                const struct Dav1dSequenceHeaderOperatingPoint *const seqop = &seqhdr->operating_points[i];
  496|  5.98k|                struct Dav1dFrameHeaderOperatingPoint *const op = &hdr->operating_points[i];
  497|  5.98k|                if (seqop->decoder_model_param_present) {
  ------------------
  |  Branch (497:21): [True: 3.08k, False: 2.89k]
  ------------------
  498|  3.08k|                    int in_temporal_layer = (seqop->idc >> hdr->temporal_id) & 1;
  499|  3.08k|                    int in_spatial_layer  = (seqop->idc >> (hdr->spatial_id + 8)) & 1;
  500|  3.08k|                    if (!seqop->idc || (in_temporal_layer && in_spatial_layer))
  ------------------
  |  Branch (500:25): [True: 635, False: 2.45k]
  |  Branch (500:41): [True: 1.30k, False: 1.14k]
  |  Branch (500:62): [True: 927, False: 376]
  ------------------
  501|  1.56k|                        op->buffer_removal_time = dav1d_get_bits(gb, seqhdr->buffer_removal_delay_length);
  502|  3.08k|                }
  503|  5.98k|            }
  504|  1.57k|        }
  505|  2.26k|    }
  506|       |
  507|   252k|    if (IS_KEY_OR_INTRA(hdr)) {
  ------------------
  |  |   43|   252k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|   252k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 145k, False: 107k]
  |  |  ------------------
  ------------------
  508|   145k|        hdr->refresh_frame_flags = (hdr->frame_type == DAV1D_FRAME_TYPE_KEY &&
  ------------------
  |  Branch (508:37): [True: 144k, False: 939]
  ------------------
  509|   144k|                                    hdr->show_frame) ? 0xff : dav1d_get_bits(gb, 8);
  ------------------
  |  Branch (509:37): [True: 139k, False: 5.35k]
  ------------------
  510|   145k|        if (hdr->refresh_frame_flags != 0xff && hdr->error_resilient_mode && seqhdr->order_hint)
  ------------------
  |  Branch (510:13): [True: 6.22k, False: 139k]
  |  Branch (510:49): [True: 1.75k, False: 4.46k]
  |  Branch (510:78): [True: 922, False: 835]
  ------------------
  511|  8.29k|            for (int i = 0; i < 8; i++)
  ------------------
  |  Branch (511:29): [True: 7.37k, False: 922]
  ------------------
  512|  7.37k|                dav1d_get_bits(gb, seqhdr->order_hint_n_bits);
  513|   145k|        if (c->strict_std_compliance &&
  ------------------
  |  Branch (513:13): [True: 0, False: 145k]
  ------------------
  514|      0|            hdr->frame_type == DAV1D_FRAME_TYPE_INTRA && hdr->refresh_frame_flags == 0xff)
  ------------------
  |  Branch (514:13): [True: 0, False: 0]
  |  Branch (514:58): [True: 0, False: 0]
  ------------------
  515|      0|        {
  516|      0|            goto error;
  517|      0|        }
  518|   145k|        if (read_frame_size(c, gb, 0) < 0) goto error;
  ------------------
  |  Branch (518:13): [True: 1.09k, False: 144k]
  ------------------
  519|   144k|        if (hdr->allow_screen_content_tools && !hdr->super_res.enabled)
  ------------------
  |  Branch (519:13): [True: 111k, False: 32.7k]
  |  Branch (519:48): [True: 107k, False: 3.61k]
  ------------------
  520|   107k|            hdr->allow_intrabc = dav1d_get_bit(gb);
  521|   144k|    } else {
  522|   107k|        hdr->refresh_frame_flags = hdr->frame_type == DAV1D_FRAME_TYPE_SWITCH ? 0xff :
  ------------------
  |  Branch (522:36): [True: 6.67k, False: 100k]
  ------------------
  523|   107k|                                   dav1d_get_bits(gb, 8);
  524|   107k|        if (hdr->error_resilient_mode && seqhdr->order_hint)
  ------------------
  |  Branch (524:13): [True: 6.83k, False: 100k]
  |  Branch (524:42): [True: 6.20k, False: 633]
  ------------------
  525|  55.8k|            for (int i = 0; i < 8; i++)
  ------------------
  |  Branch (525:29): [True: 49.6k, False: 6.20k]
  ------------------
  526|  49.6k|                dav1d_get_bits(gb, seqhdr->order_hint_n_bits);
  527|   107k|        if (seqhdr->order_hint) {
  ------------------
  |  Branch (527:13): [True: 90.2k, False: 16.8k]
  ------------------
  528|  90.2k|            hdr->frame_ref_short_signaling = dav1d_get_bit(gb);
  529|  90.2k|            if (hdr->frame_ref_short_signaling) {
  ------------------
  |  Branch (529:17): [True: 59.1k, False: 31.0k]
  ------------------
  530|  59.1k|                hdr->refidx[0] = dav1d_get_bits(gb, 3);
  531|  59.1k|                hdr->refidx[1] = hdr->refidx[2] = -1;
  532|  59.1k|                hdr->refidx[3] = dav1d_get_bits(gb, 3);
  533|       |
  534|       |                /* +1 allows for unconditional stores, as unused
  535|       |                 * values can be dumped into frame_offset[-1]. */
  536|  59.1k|                int frame_offset_mem[8+1];
  537|  59.1k|                int *const frame_offset = &frame_offset_mem[1];
  538|  59.1k|                int earliest_ref = -1;
  539|   529k|                for (int i = 0, earliest_offset = INT_MAX; i < 8; i++) {
  ------------------
  |  Branch (539:60): [True: 470k, False: 58.8k]
  ------------------
  540|   470k|                    const Dav1dFrameHeader *const refhdr = c->refs[i].p.p.frame_hdr;
  541|   470k|                    if (!refhdr) goto error;
  ------------------
  |  Branch (541:25): [True: 359, False: 470k]
  ------------------
  542|   470k|                    const int diff = get_poc_diff(seqhdr->order_hint_n_bits,
  543|   470k|                                                  refhdr->frame_offset,
  544|   470k|                                                  hdr->frame_offset);
  545|   470k|                    frame_offset[i] = diff;
  546|   470k|                    if (diff < earliest_offset) {
  ------------------
  |  Branch (546:25): [True: 82.5k, False: 387k]
  ------------------
  547|  82.5k|                        earliest_offset = diff;
  548|  82.5k|                        earliest_ref = i;
  549|  82.5k|                    }
  550|   470k|                }
  551|  58.8k|                frame_offset[hdr->refidx[0]] = INT_MIN; // = reference frame is used
  552|  58.8k|                frame_offset[hdr->refidx[3]] = INT_MIN;
  553|  58.8k|                assert(earliest_ref >= 0);
  ------------------
  |  Branch (553:17): [True: 58.8k, False: 0]
  ------------------
  554|       |
  555|  58.8k|                int refidx = -1;
  556|   529k|                for (int i = 0, latest_offset = 0; i < 8; i++) {
  ------------------
  |  Branch (556:52): [True: 470k, False: 58.8k]
  ------------------
  557|   470k|                    const int hint = frame_offset[i];
  558|   470k|                    if (hint >= latest_offset) {
  ------------------
  |  Branch (558:25): [True: 237k, False: 233k]
  ------------------
  559|   237k|                        latest_offset = hint;
  560|   237k|                        refidx = i;
  561|   237k|                    }
  562|   470k|                }
  563|  58.8k|                frame_offset[refidx] = INT_MIN;
  564|  58.8k|                hdr->refidx[6] = refidx;
  565|       |
  566|   176k|                for (int i = 4; i < 6; i++) {
  ------------------
  |  Branch (566:33): [True: 117k, False: 58.8k]
  ------------------
  567|       |                    /* Unsigned compares to handle negative values. */
  568|   117k|                    unsigned earliest_offset = UINT8_MAX;
  569|   117k|                    refidx = -1;
  570|  1.05M|                    for (int j = 0; j < 8; j++) {
  ------------------
  |  Branch (570:37): [True: 940k, False: 117k]
  ------------------
  571|   940k|                        const unsigned hint = frame_offset[j];
  572|   940k|                        if (hint < earliest_offset) {
  ------------------
  |  Branch (572:29): [True: 112k, False: 828k]
  ------------------
  573|   112k|                            earliest_offset = hint;
  574|   112k|                            refidx = j;
  575|   112k|                        }
  576|   940k|                    }
  577|   117k|                    frame_offset[refidx] = INT_MIN;
  578|   117k|                    hdr->refidx[i] = refidx;
  579|   117k|                }
  580|       |
  581|   411k|                for (int i = 1; i < 7; i++) {
  ------------------
  |  Branch (581:33): [True: 352k, False: 58.8k]
  ------------------
  582|   352k|                    refidx = hdr->refidx[i];
  583|   352k|                    if (refidx < 0) {
  ------------------
  |  Branch (583:25): [True: 137k, False: 215k]
  ------------------
  584|   137k|                        unsigned latest_offset = ~UINT8_MAX;
  585|  1.23M|                        for (int j = 0; j < 8; j++) {
  ------------------
  |  Branch (585:41): [True: 1.09M, False: 137k]
  ------------------
  586|  1.09M|                            const unsigned hint = frame_offset[j];
  587|  1.09M|                            if (hint >= latest_offset) {
  ------------------
  |  Branch (587:33): [True: 223k, False: 875k]
  ------------------
  588|   223k|                                latest_offset = hint;
  589|   223k|                                refidx = j;
  590|   223k|                            }
  591|  1.09M|                        }
  592|   137k|                        frame_offset[refidx] = INT_MIN;
  593|   137k|                        hdr->refidx[i] = refidx >= 0 ? refidx : earliest_ref;
  ------------------
  |  Branch (593:42): [True: 83.5k, False: 53.7k]
  ------------------
  594|   137k|                    }
  595|   352k|                }
  596|  58.8k|            }
  597|  90.2k|        }
  598|   849k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (598:25): [True: 743k, False: 106k]
  ------------------
  599|   743k|            if (!hdr->frame_ref_short_signaling)
  ------------------
  |  Branch (599:17): [True: 331k, False: 411k]
  ------------------
  600|   331k|                hdr->refidx[i] = dav1d_get_bits(gb, 3);
  601|   743k|            if (seqhdr->frame_id_numbers_present) {
  ------------------
  |  Branch (601:17): [True: 862, False: 742k]
  ------------------
  602|    862|                const unsigned delta_ref_frame_id = dav1d_get_bits(gb, seqhdr->delta_frame_id_n_bits) + 1;
  603|    862|                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);
  604|    862|                Dav1dFrameHeader *const ref_frame_hdr = c->refs[hdr->refidx[i]].p.p.frame_hdr;
  605|    862|                if (!ref_frame_hdr || ref_frame_hdr->frame_id != ref_frame_id) goto error;
  ------------------
  |  Branch (605:21): [True: 431, False: 431]
  |  Branch (605:39): [True: 209, False: 222]
  ------------------
  606|    862|            }
  607|   743k|        }
  608|   106k|        const int use_ref = !hdr->error_resilient_mode &&
  ------------------
  |  Branch (608:29): [True: 100k, False: 6.06k]
  ------------------
  609|   100k|                            hdr->frame_size_override;
  ------------------
  |  Branch (609:29): [True: 62.9k, False: 37.0k]
  ------------------
  610|   106k|        if (read_frame_size(c, gb, use_ref) < 0) goto error;
  ------------------
  |  Branch (610:13): [True: 3.25k, False: 102k]
  ------------------
  611|   102k|        if (!hdr->force_integer_mv)
  ------------------
  |  Branch (611:13): [True: 77.1k, False: 25.6k]
  ------------------
  612|  77.1k|            hdr->hp = dav1d_get_bit(gb);
  613|   102k|        hdr->subpel_filter_mode = dav1d_get_bit(gb) ? DAV1D_FILTER_SWITCHABLE :
  ------------------
  |  Branch (613:35): [True: 50.1k, False: 52.7k]
  ------------------
  614|   102k|                                                      dav1d_get_bits(gb, 2);
  615|   102k|        hdr->switchable_motion_mode = dav1d_get_bit(gb);
  616|   102k|        if (!hdr->error_resilient_mode && seqhdr->ref_frame_mvs &&
  ------------------
  |  Branch (616:13): [True: 99.5k, False: 3.24k]
  |  Branch (616:43): [True: 67.8k, False: 31.7k]
  ------------------
  617|  67.8k|            seqhdr->order_hint && IS_INTER_OR_SWITCH(hdr))
  ------------------
  |  |   36|  67.8k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 67.8k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (617:13): [True: 67.8k, False: 0]
  ------------------
  618|  67.8k|        {
  619|  67.8k|            hdr->use_ref_frame_mvs = dav1d_get_bit(gb);
  620|  67.8k|        }
  621|   102k|    }
  622|       |#if DEBUG_FRAME_HDR
  623|       |    printf("HDR: post-frametype-specific-bits: off=%td\n",
  624|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  625|       |#endif
  626|       |
  627|   247k|    if (!seqhdr->reduced_still_picture_header && !hdr->disable_cdf_update)
  ------------------
  |  Branch (627:9): [True: 121k, False: 125k]
  |  Branch (627:50): [True: 113k, False: 8.68k]
  ------------------
  628|   113k|        hdr->refresh_context = !dav1d_get_bit(gb);
  629|       |#if DEBUG_FRAME_HDR
  630|       |    printf("HDR: post-refresh_context: off=%td\n",
  631|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  632|       |#endif
  633|       |
  634|       |    // tile data
  635|   247k|    hdr->tiling.uniform = dav1d_get_bit(gb);
  636|   247k|    const int sbsz_min1 = (64 << seqhdr->sb128) - 1;
  637|   247k|    const int sbsz_log2 = 6 + seqhdr->sb128;
  638|   247k|    const int sbw = (hdr->width[0] + sbsz_min1) >> sbsz_log2;
  639|   247k|    const int sbh = (hdr->height + sbsz_min1) >> sbsz_log2;
  640|   247k|    const int max_tile_width_sb = 4096 >> sbsz_log2;
  641|   247k|    const int max_tile_area_sb = 4096 * 2304 >> (2 * sbsz_log2);
  642|   247k|    hdr->tiling.min_log2_cols = tile_log2(max_tile_width_sb, sbw);
  643|   247k|    hdr->tiling.max_log2_cols = tile_log2(1, imin(sbw, DAV1D_MAX_TILE_COLS));
  ------------------
  |  |   41|   247k|#define DAV1D_MAX_TILE_COLS 64
  ------------------
  644|   247k|    hdr->tiling.max_log2_rows = tile_log2(1, imin(sbh, DAV1D_MAX_TILE_ROWS));
  ------------------
  |  |   42|   247k|#define DAV1D_MAX_TILE_ROWS 64
  ------------------
  645|   247k|    const int min_log2_tiles = imax(tile_log2(max_tile_area_sb, sbw * sbh),
  646|   247k|                              hdr->tiling.min_log2_cols);
  647|   247k|    if (hdr->tiling.uniform) {
  ------------------
  |  Branch (647:9): [True: 191k, False: 55.7k]
  ------------------
  648|   191k|        for (hdr->tiling.log2_cols = hdr->tiling.min_log2_cols;
  649|   198k|             hdr->tiling.log2_cols < hdr->tiling.max_log2_cols && dav1d_get_bit(gb);
  ------------------
  |  Branch (649:14): [True: 106k, False: 92.4k]
  |  Branch (649:67): [True: 7.06k, False: 99.0k]
  ------------------
  650|   191k|             hdr->tiling.log2_cols++) ;
  651|   191k|        const int tile_w = 1 + ((sbw - 1) >> hdr->tiling.log2_cols);
  652|   191k|        hdr->tiling.cols = 0;
  653|   400k|        for (int sbx = 0; sbx < sbw; sbx += tile_w, hdr->tiling.cols++)
  ------------------
  |  Branch (653:27): [True: 209k, False: 191k]
  ------------------
  654|   209k|            hdr->tiling.col_start_sb[hdr->tiling.cols] = sbx;
  655|   191k|        hdr->tiling.min_log2_rows =
  656|   191k|            imax(min_log2_tiles - hdr->tiling.log2_cols, 0);
  657|       |
  658|   191k|        for (hdr->tiling.log2_rows = hdr->tiling.min_log2_rows;
  659|   210k|             hdr->tiling.log2_rows < hdr->tiling.max_log2_rows && dav1d_get_bit(gb);
  ------------------
  |  Branch (659:14): [True: 82.0k, False: 128k]
  |  Branch (659:67): [True: 18.6k, False: 63.3k]
  ------------------
  660|   191k|             hdr->tiling.log2_rows++) ;
  661|   191k|        const int tile_h = 1 + ((sbh - 1) >> hdr->tiling.log2_rows);
  662|   191k|        hdr->tiling.rows = 0;
  663|   447k|        for (int sby = 0; sby < sbh; sby += tile_h, hdr->tiling.rows++)
  ------------------
  |  Branch (663:27): [True: 256k, False: 191k]
  ------------------
  664|   256k|            hdr->tiling.row_start_sb[hdr->tiling.rows] = sby;
  665|   191k|    } else {
  666|  55.7k|        hdr->tiling.cols = 0;
  667|  55.7k|        int widest_tile = 0, max_tile_area_sb = sbw * sbh;
  668|   208k|        for (int sbx = 0; sbx < sbw && hdr->tiling.cols < DAV1D_MAX_TILE_COLS; hdr->tiling.cols++) {
  ------------------
  |  |   41|   153k|#define DAV1D_MAX_TILE_COLS 64
  ------------------
  |  Branch (668:27): [True: 153k, False: 55.1k]
  |  Branch (668:40): [True: 152k, False: 530]
  ------------------
  669|   152k|            const int tile_width_sb = imin(sbw - sbx, max_tile_width_sb);
  670|   152k|            const int tile_w = (tile_width_sb > 1) ? 1 + dav1d_get_uniform(gb, tile_width_sb) : 1;
  ------------------
  |  Branch (670:32): [True: 118k, False: 34.2k]
  ------------------
  671|   152k|            hdr->tiling.col_start_sb[hdr->tiling.cols] = sbx;
  672|   152k|            sbx += tile_w;
  673|   152k|            widest_tile = imax(widest_tile, tile_w);
  674|   152k|        }
  675|  55.7k|        hdr->tiling.log2_cols = tile_log2(1, hdr->tiling.cols);
  676|  55.7k|        if (min_log2_tiles) max_tile_area_sb >>= min_log2_tiles + 1;
  ------------------
  |  Branch (676:13): [True: 762, False: 54.9k]
  ------------------
  677|  55.7k|        const int max_tile_height_sb = imax(max_tile_area_sb / widest_tile, 1);
  678|       |
  679|  55.7k|        hdr->tiling.rows = 0;
  680|   161k|        for (int sby = 0; sby < sbh && hdr->tiling.rows < DAV1D_MAX_TILE_ROWS; hdr->tiling.rows++) {
  ------------------
  |  |   42|   106k|#define DAV1D_MAX_TILE_ROWS 64
  ------------------
  |  Branch (680:27): [True: 106k, False: 55.3k]
  |  Branch (680:40): [True: 106k, False: 320]
  ------------------
  681|   106k|            const int tile_height_sb = imin(sbh - sby, max_tile_height_sb);
  682|   106k|            const int tile_h = (tile_height_sb > 1) ? 1 + dav1d_get_uniform(gb, tile_height_sb) : 1;
  ------------------
  |  Branch (682:32): [True: 59.4k, False: 46.8k]
  ------------------
  683|   106k|            hdr->tiling.row_start_sb[hdr->tiling.rows] = sby;
  684|   106k|            sby += tile_h;
  685|   106k|        }
  686|  55.7k|        hdr->tiling.log2_rows = tile_log2(1, hdr->tiling.rows);
  687|  55.7k|    }
  688|   247k|    hdr->tiling.col_start_sb[hdr->tiling.cols] = sbw;
  689|   247k|    hdr->tiling.row_start_sb[hdr->tiling.rows] = sbh;
  690|   247k|    if (hdr->tiling.log2_cols || hdr->tiling.log2_rows) {
  ------------------
  |  Branch (690:9): [True: 15.7k, False: 231k]
  |  Branch (690:34): [True: 18.5k, False: 212k]
  ------------------
  691|  34.3k|        hdr->tiling.update = dav1d_get_bits(gb, hdr->tiling.log2_cols + hdr->tiling.log2_rows);
  692|  34.3k|        if (hdr->tiling.update >= hdr->tiling.cols * hdr->tiling.rows)
  ------------------
  |  Branch (692:13): [True: 302, False: 34.0k]
  ------------------
  693|    302|            goto error;
  694|  34.0k|        hdr->tiling.n_bytes = dav1d_get_bits(gb, 2) + 1;
  695|  34.0k|    }
  696|       |#if DEBUG_FRAME_HDR
  697|       |    printf("HDR: post-tiling: off=%td\n",
  698|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  699|       |#endif
  700|       |
  701|       |    // quant data
  702|   246k|    hdr->quant.yac = dav1d_get_bits(gb, 8);
  703|   246k|    if (dav1d_get_bit(gb))
  ------------------
  |  Branch (703:9): [True: 41.9k, False: 204k]
  ------------------
  704|  41.9k|        hdr->quant.ydc_delta = dav1d_get_sbits(gb, 7);
  705|   246k|    if (!seqhdr->monochrome) {
  ------------------
  |  Branch (705:9): [True: 163k, False: 83.6k]
  ------------------
  706|       |        // If the sequence header says that delta_q might be different
  707|       |        // for U, V, we must check whether it actually is for this
  708|       |        // frame.
  709|   163k|        const int diff_uv_delta = seqhdr->separate_uv_delta_q ? dav1d_get_bit(gb) : 0;
  ------------------
  |  Branch (709:35): [True: 27.1k, False: 136k]
  ------------------
  710|   163k|        if (dav1d_get_bit(gb))
  ------------------
  |  Branch (710:13): [True: 15.3k, False: 147k]
  ------------------
  711|  15.3k|            hdr->quant.udc_delta = dav1d_get_sbits(gb, 7);
  712|   163k|        if (dav1d_get_bit(gb))
  ------------------
  |  Branch (712:13): [True: 14.1k, False: 149k]
  ------------------
  713|  14.1k|            hdr->quant.uac_delta = dav1d_get_sbits(gb, 7);
  714|   163k|        if (diff_uv_delta) {
  ------------------
  |  Branch (714:13): [True: 6.95k, False: 156k]
  ------------------
  715|  6.95k|            if (dav1d_get_bit(gb))
  ------------------
  |  Branch (715:17): [True: 2.19k, False: 4.75k]
  ------------------
  716|  2.19k|                hdr->quant.vdc_delta = dav1d_get_sbits(gb, 7);
  717|  6.95k|            if (dav1d_get_bit(gb))
  ------------------
  |  Branch (717:17): [True: 3.01k, False: 3.93k]
  ------------------
  718|  3.01k|                hdr->quant.vac_delta = dav1d_get_sbits(gb, 7);
  719|   156k|        } else {
  720|   156k|            hdr->quant.vdc_delta = hdr->quant.udc_delta;
  721|   156k|            hdr->quant.vac_delta = hdr->quant.uac_delta;
  722|   156k|        }
  723|   163k|    }
  724|       |#if DEBUG_FRAME_HDR
  725|       |    printf("HDR: post-quant: off=%td\n",
  726|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  727|       |#endif
  728|   246k|    hdr->quant.qm = dav1d_get_bit(gb);
  729|   246k|    if (hdr->quant.qm) {
  ------------------
  |  Branch (729:9): [True: 39.0k, False: 207k]
  ------------------
  730|  39.0k|        hdr->quant.qm_y = dav1d_get_bits(gb, 4);
  731|  39.0k|        hdr->quant.qm_u = dav1d_get_bits(gb, 4);
  732|  39.0k|        hdr->quant.qm_v = seqhdr->separate_uv_delta_q ? dav1d_get_bits(gb, 4) :
  ------------------
  |  Branch (732:27): [True: 13.8k, False: 25.1k]
  ------------------
  733|  39.0k|                                                        hdr->quant.qm_u;
  734|  39.0k|    }
  735|       |#if DEBUG_FRAME_HDR
  736|       |    printf("HDR: post-qm: off=%td\n",
  737|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  738|       |#endif
  739|       |
  740|       |    // segmentation data
  741|   246k|    hdr->segmentation.enabled = dav1d_get_bit(gb);
  742|   246k|    if (hdr->segmentation.enabled) {
  ------------------
  |  Branch (742:9): [True: 34.7k, False: 212k]
  ------------------
  743|  34.7k|        if (hdr->primary_ref_frame == DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|  34.7k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (743:13): [True: 5.01k, False: 29.7k]
  ------------------
  744|  5.01k|            hdr->segmentation.update_map = 1;
  745|  5.01k|            hdr->segmentation.update_data = 1;
  746|  29.7k|        } else {
  747|  29.7k|            hdr->segmentation.update_map = dav1d_get_bit(gb);
  748|  29.7k|            if (hdr->segmentation.update_map)
  ------------------
  |  Branch (748:17): [True: 21.1k, False: 8.52k]
  ------------------
  749|  21.1k|                hdr->segmentation.temporal = dav1d_get_bit(gb);
  750|  29.7k|            hdr->segmentation.update_data = dav1d_get_bit(gb);
  751|  29.7k|        }
  752|       |
  753|  34.7k|        if (hdr->segmentation.update_data) {
  ------------------
  |  Branch (753:13): [True: 6.46k, False: 28.2k]
  ------------------
  754|  6.46k|            hdr->segmentation.seg_data.last_active_segid = -1;
  755|  58.1k|            for (int i = 0; i < DAV1D_MAX_SEGMENTS; i++) {
  ------------------
  |  |   43|  58.1k|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (755:29): [True: 51.6k, False: 6.46k]
  ------------------
  756|  51.6k|                Dav1dSegmentationData *const seg =
  757|  51.6k|                    &hdr->segmentation.seg_data.d[i];
  758|  51.6k|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (758:21): [True: 10.4k, False: 41.2k]
  ------------------
  759|  10.4k|                    seg->delta_q = dav1d_get_sbits(gb, 9);
  760|  10.4k|                    hdr->segmentation.seg_data.last_active_segid = i;
  761|  10.4k|                }
  762|  51.6k|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (762:21): [True: 6.25k, False: 45.4k]
  ------------------
  763|  6.25k|                    seg->delta_lf_y_v = dav1d_get_sbits(gb, 7);
  764|  6.25k|                    hdr->segmentation.seg_data.last_active_segid = i;
  765|  6.25k|                }
  766|  51.6k|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (766:21): [True: 9.16k, False: 42.5k]
  ------------------
  767|  9.16k|                    seg->delta_lf_y_h = dav1d_get_sbits(gb, 7);
  768|  9.16k|                    hdr->segmentation.seg_data.last_active_segid = i;
  769|  9.16k|                }
  770|  51.6k|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (770:21): [True: 7.91k, False: 43.7k]
  ------------------
  771|  7.91k|                    seg->delta_lf_u = dav1d_get_sbits(gb, 7);
  772|  7.91k|                    hdr->segmentation.seg_data.last_active_segid = i;
  773|  7.91k|                }
  774|  51.6k|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (774:21): [True: 7.59k, False: 44.0k]
  ------------------
  775|  7.59k|                    seg->delta_lf_v = dav1d_get_sbits(gb, 7);
  776|  7.59k|                    hdr->segmentation.seg_data.last_active_segid = i;
  777|  7.59k|                }
  778|  51.6k|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (778:21): [True: 7.77k, False: 43.9k]
  ------------------
  779|  7.77k|                    seg->ref = dav1d_get_bits(gb, 3);
  780|  7.77k|                    hdr->segmentation.seg_data.last_active_segid = i;
  781|  7.77k|                    hdr->segmentation.seg_data.preskip = 1;
  782|  43.9k|                } else {
  783|  43.9k|                    seg->ref = -1;
  784|  43.9k|                }
  785|  51.6k|                if ((seg->skip = dav1d_get_bit(gb))) {
  ------------------
  |  Branch (785:21): [True: 10.1k, False: 41.5k]
  ------------------
  786|  10.1k|                    hdr->segmentation.seg_data.last_active_segid = i;
  787|  10.1k|                    hdr->segmentation.seg_data.preskip = 1;
  788|  10.1k|                }
  789|  51.6k|                if ((seg->globalmv = dav1d_get_bit(gb))) {
  ------------------
  |  Branch (789:21): [True: 8.39k, False: 43.2k]
  ------------------
  790|  8.39k|                    hdr->segmentation.seg_data.last_active_segid = i;
  791|  8.39k|                    hdr->segmentation.seg_data.preskip = 1;
  792|  8.39k|                }
  793|  51.6k|            }
  794|  28.2k|        } else {
  795|       |            // segmentation.update_data was false so we should copy
  796|       |            // segmentation data from the reference frame.
  797|  28.2k|            assert(hdr->primary_ref_frame != DAV1D_PRIMARY_REF_NONE);
  ------------------
  |  Branch (797:13): [True: 28.2k, False: 0]
  ------------------
  798|  28.2k|            const int pri_ref = hdr->refidx[hdr->primary_ref_frame];
  799|  28.2k|            if (!c->refs[pri_ref].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (799:17): [True: 213, False: 28.0k]
  ------------------
  800|  28.0k|            hdr->segmentation.seg_data =
  801|  28.0k|                c->refs[pri_ref].p.p.frame_hdr->segmentation.seg_data;
  802|  28.0k|        }
  803|   212k|    } else {
  804|  1.90M|        for (int i = 0; i < DAV1D_MAX_SEGMENTS; i++)
  ------------------
  |  |   43|  1.90M|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (804:25): [True: 1.69M, False: 212k]
  ------------------
  805|  1.69M|            hdr->segmentation.seg_data.d[i].ref = -1;
  806|   212k|    }
  807|       |#if DEBUG_FRAME_HDR
  808|       |    printf("HDR: post-segmentation: off=%td\n",
  809|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  810|       |#endif
  811|       |
  812|       |    // delta q
  813|   246k|    if (hdr->quant.yac) {
  ------------------
  |  Branch (813:9): [True: 205k, False: 41.5k]
  ------------------
  814|   205k|        hdr->delta.q.present = dav1d_get_bit(gb);
  815|   205k|        if (hdr->delta.q.present) {
  ------------------
  |  Branch (815:13): [True: 71.6k, False: 133k]
  ------------------
  816|  71.6k|            hdr->delta.q.res_log2 = dav1d_get_bits(gb, 2);
  817|  71.6k|            if (!hdr->allow_intrabc) {
  ------------------
  |  Branch (817:17): [True: 17.2k, False: 54.3k]
  ------------------
  818|  17.2k|                hdr->delta.lf.present = dav1d_get_bit(gb);
  819|  17.2k|                if (hdr->delta.lf.present) {
  ------------------
  |  Branch (819:21): [True: 9.69k, False: 7.56k]
  ------------------
  820|  9.69k|                    hdr->delta.lf.res_log2 = dav1d_get_bits(gb, 2);
  821|  9.69k|                    hdr->delta.lf.multi = dav1d_get_bit(gb);
  822|  9.69k|                }
  823|  17.2k|            }
  824|  71.6k|        }
  825|   205k|    }
  826|       |#if DEBUG_FRAME_HDR
  827|       |    printf("HDR: post-delta_q_lf_flags: off=%td\n",
  828|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  829|       |#endif
  830|       |
  831|       |    // derive lossless flags
  832|   246k|    const int delta_lossless = !hdr->quant.ydc_delta && !hdr->quant.udc_delta &&
  ------------------
  |  Branch (832:32): [True: 206k, False: 40.5k]
  |  Branch (832:57): [True: 200k, False: 5.82k]
  ------------------
  833|   200k|        !hdr->quant.uac_delta && !hdr->quant.vdc_delta && !hdr->quant.vac_delta;
  ------------------
  |  Branch (833:9): [True: 194k, False: 5.32k]
  |  Branch (833:34): [True: 194k, False: 855]
  |  Branch (833:59): [True: 194k, False: 40]
  ------------------
  834|   246k|    hdr->all_lossless = 1;
  835|  2.22M|    for (int i = 0; i < DAV1D_MAX_SEGMENTS; i++) {
  ------------------
  |  |   43|  2.22M|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (835:21): [True: 1.97M, False: 246k]
  ------------------
  836|  1.97M|        hdr->segmentation.qidx[i] = hdr->segmentation.enabled ?
  ------------------
  |  Branch (836:37): [True: 275k, False: 1.69M]
  ------------------
  837|   275k|            iclip_u8(hdr->quant.yac + hdr->segmentation.seg_data.d[i].delta_q) :
  838|  1.97M|            hdr->quant.yac;
  839|  1.97M|        hdr->segmentation.lossless[i] =
  840|  1.97M|            !hdr->segmentation.qidx[i] && delta_lossless;
  ------------------
  |  Branch (840:13): [True: 345k, False: 1.62M]
  |  Branch (840:43): [True: 316k, False: 29.4k]
  ------------------
  841|  1.97M|        hdr->all_lossless &= hdr->segmentation.lossless[i];
  842|  1.97M|    }
  843|       |
  844|       |    // loopfilter
  845|   246k|    if (hdr->all_lossless || hdr->allow_intrabc) {
  ------------------
  |  Branch (845:9): [True: 39.2k, False: 207k]
  |  Branch (845:30): [True: 96.3k, False: 111k]
  ------------------
  846|   135k|        hdr->loopfilter.mode_ref_delta_enabled = 1;
  847|   135k|        hdr->loopfilter.mode_ref_delta_update = 1;
  848|   135k|        hdr->loopfilter.mode_ref_deltas = default_mode_ref_deltas;
  849|   135k|    } else {
  850|   111k|        hdr->loopfilter.level_y[0] = dav1d_get_bits(gb, 6);
  851|   111k|        hdr->loopfilter.level_y[1] = dav1d_get_bits(gb, 6);
  852|   111k|        if (!seqhdr->monochrome &&
  ------------------
  |  Branch (852:13): [True: 41.0k, False: 69.9k]
  ------------------
  853|  41.0k|            (hdr->loopfilter.level_y[0] || hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (853:14): [True: 23.4k, False: 17.5k]
  |  Branch (853:44): [True: 8.87k, False: 8.72k]
  ------------------
  854|  32.3k|        {
  855|  32.3k|            hdr->loopfilter.level_u = dav1d_get_bits(gb, 6);
  856|  32.3k|            hdr->loopfilter.level_v = dav1d_get_bits(gb, 6);
  857|  32.3k|        }
  858|   111k|        hdr->loopfilter.sharpness = dav1d_get_bits(gb, 3);
  859|       |
  860|   111k|        if (hdr->primary_ref_frame == DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|   111k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (860:13): [True: 47.7k, False: 63.2k]
  ------------------
  861|  47.7k|            hdr->loopfilter.mode_ref_deltas = default_mode_ref_deltas;
  862|  63.2k|        } else {
  863|  63.2k|            const int ref = hdr->refidx[hdr->primary_ref_frame];
  864|  63.2k|            if (!c->refs[ref].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (864:17): [True: 732, False: 62.5k]
  ------------------
  865|  62.5k|            hdr->loopfilter.mode_ref_deltas =
  866|  62.5k|                c->refs[ref].p.p.frame_hdr->loopfilter.mode_ref_deltas;
  867|  62.5k|        }
  868|   110k|        hdr->loopfilter.mode_ref_delta_enabled = dav1d_get_bit(gb);
  869|   110k|        if (hdr->loopfilter.mode_ref_delta_enabled) {
  ------------------
  |  Branch (869:13): [True: 62.8k, False: 47.4k]
  ------------------
  870|  62.8k|            hdr->loopfilter.mode_ref_delta_update = dav1d_get_bit(gb);
  871|  62.8k|            if (hdr->loopfilter.mode_ref_delta_update) {
  ------------------
  |  Branch (871:17): [True: 19.0k, False: 43.8k]
  ------------------
  872|   171k|                for (int i = 0; i < 8; i++)
  ------------------
  |  Branch (872:33): [True: 152k, False: 19.0k]
  ------------------
  873|   152k|                    if (dav1d_get_bit(gb))
  ------------------
  |  Branch (873:25): [True: 51.0k, False: 101k]
  ------------------
  874|  51.0k|                        hdr->loopfilter.mode_ref_deltas.ref_delta[i] =
  875|  51.0k|                            dav1d_get_sbits(gb, 7);
  876|  57.2k|                for (int i = 0; i < 2; i++)
  ------------------
  |  Branch (876:33): [True: 38.1k, False: 19.0k]
  ------------------
  877|  38.1k|                    if (dav1d_get_bit(gb))
  ------------------
  |  Branch (877:25): [True: 3.57k, False: 34.5k]
  ------------------
  878|  3.57k|                        hdr->loopfilter.mode_ref_deltas.mode_delta[i] =
  879|  3.57k|                            dav1d_get_sbits(gb, 7);
  880|  19.0k|            }
  881|  62.8k|        }
  882|   110k|    }
  883|       |#if DEBUG_FRAME_HDR
  884|       |    printf("HDR: post-lpf: off=%td\n",
  885|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  886|       |#endif
  887|       |
  888|       |    // cdef
  889|   245k|    if (!hdr->all_lossless && seqhdr->cdef && !hdr->allow_intrabc) {
  ------------------
  |  Branch (889:9): [True: 206k, False: 39.2k]
  |  Branch (889:31): [True: 97.4k, False: 109k]
  |  Branch (889:47): [True: 49.8k, False: 47.5k]
  ------------------
  890|  49.8k|        hdr->cdef.damping = dav1d_get_bits(gb, 2) + 3;
  891|  49.8k|        hdr->cdef.n_bits = dav1d_get_bits(gb, 2);
  892|   130k|        for (int i = 0; i < (1 << hdr->cdef.n_bits); i++) {
  ------------------
  |  Branch (892:25): [True: 80.3k, False: 49.8k]
  ------------------
  893|  80.3k|            hdr->cdef.y_strength[i] = dav1d_get_bits(gb, 6);
  894|  80.3k|            if (!seqhdr->monochrome)
  ------------------
  |  Branch (894:17): [True: 26.1k, False: 54.2k]
  ------------------
  895|  26.1k|                hdr->cdef.uv_strength[i] = dav1d_get_bits(gb, 6);
  896|  80.3k|        }
  897|  49.8k|    }
  898|       |#if DEBUG_FRAME_HDR
  899|       |    printf("HDR: post-cdef: off=%td\n",
  900|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  901|       |#endif
  902|       |
  903|       |    // restoration
  904|   245k|    if ((!hdr->all_lossless || hdr->super_res.enabled) &&
  ------------------
  |  Branch (904:10): [True: 206k, False: 39.2k]
  |  Branch (904:32): [True: 21.9k, False: 17.2k]
  ------------------
  905|   228k|        seqhdr->restoration && !hdr->allow_intrabc)
  ------------------
  |  Branch (905:9): [True: 96.5k, False: 132k]
  |  Branch (905:32): [True: 84.1k, False: 12.4k]
  ------------------
  906|  84.1k|    {
  907|  84.1k|        hdr->restoration.type[0] = dav1d_get_bits(gb, 2);
  908|  84.1k|        if (!seqhdr->monochrome) {
  ------------------
  |  Branch (908:13): [True: 29.1k, False: 54.9k]
  ------------------
  909|  29.1k|            hdr->restoration.type[1] = dav1d_get_bits(gb, 2);
  910|  29.1k|            hdr->restoration.type[2] = dav1d_get_bits(gb, 2);
  911|  29.1k|        }
  912|       |
  913|  84.1k|        if (hdr->restoration.type[0] || hdr->restoration.type[1] ||
  ------------------
  |  Branch (913:13): [True: 41.0k, False: 43.1k]
  |  Branch (913:41): [True: 2.70k, False: 40.4k]
  ------------------
  914|  40.4k|            hdr->restoration.type[2])
  ------------------
  |  Branch (914:13): [True: 485, False: 39.9k]
  ------------------
  915|  44.1k|        {
  916|       |            // Log2 of the restoration unit size.
  917|  44.1k|            hdr->restoration.unit_size[0] = 6 + seqhdr->sb128;
  918|  44.1k|            if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (918:17): [True: 11.0k, False: 33.1k]
  ------------------
  919|  11.0k|                hdr->restoration.unit_size[0]++;
  920|  11.0k|                if (!seqhdr->sb128)
  ------------------
  |  Branch (920:21): [True: 3.00k, False: 8.00k]
  ------------------
  921|  3.00k|                    hdr->restoration.unit_size[0] += dav1d_get_bit(gb);
  922|  11.0k|            }
  923|  44.1k|            hdr->restoration.unit_size[1] = hdr->restoration.unit_size[0];
  924|  44.1k|            if ((hdr->restoration.type[1] || hdr->restoration.type[2]) &&
  ------------------
  |  Branch (924:18): [True: 12.6k, False: 31.5k]
  |  Branch (924:46): [True: 2.55k, False: 29.0k]
  ------------------
  925|  15.1k|                seqhdr->ss_hor == 1 && seqhdr->ss_ver == 1)
  ------------------
  |  Branch (925:17): [True: 10.9k, False: 4.19k]
  |  Branch (925:40): [True: 9.73k, False: 1.22k]
  ------------------
  926|  9.73k|            {
  927|  9.73k|                hdr->restoration.unit_size[1] -= dav1d_get_bit(gb);
  928|  9.73k|            }
  929|  44.1k|        } else {
  930|  39.9k|            hdr->restoration.unit_size[0] = 8;
  931|  39.9k|        }
  932|  84.1k|    }
  933|       |#if DEBUG_FRAME_HDR
  934|       |    printf("HDR: post-restoration: off=%td\n",
  935|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  936|       |#endif
  937|       |
  938|   245k|    if (!hdr->all_lossless)
  ------------------
  |  Branch (938:9): [True: 206k, False: 39.2k]
  ------------------
  939|   206k|        hdr->txfm_mode = dav1d_get_bit(gb) ? DAV1D_TX_SWITCHABLE : DAV1D_TX_LARGEST;
  ------------------
  |  Branch (939:26): [True: 60.7k, False: 145k]
  ------------------
  940|       |#if DEBUG_FRAME_HDR
  941|       |    printf("HDR: post-txfmmode: off=%td\n",
  942|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  943|       |#endif
  944|   245k|    if (IS_INTER_OR_SWITCH(hdr))
  ------------------
  |  |   36|   245k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 101k, False: 144k]
  |  |  ------------------
  ------------------
  945|   101k|        hdr->switchable_comp_refs = dav1d_get_bit(gb);
  946|       |#if DEBUG_FRAME_HDR
  947|       |    printf("HDR: post-refmode: off=%td\n",
  948|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
  949|       |#endif
  950|   245k|    if (hdr->switchable_comp_refs && IS_INTER_OR_SWITCH(hdr) && seqhdr->order_hint) {
  ------------------
  |  |   36|   288k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 42.6k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (950:9): [True: 42.6k, False: 203k]
  |  Branch (950:65): [True: 40.6k, False: 2.04k]
  ------------------
  951|  40.6k|        const int poc = hdr->frame_offset;
  952|  40.6k|        int off_before = -1, off_after = -1;
  953|  40.6k|        int off_before_idx, off_after_idx;
  954|   323k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (954:25): [True: 283k, False: 40.4k]
  ------------------
  955|   283k|            if (!c->refs[hdr->refidx[i]].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (955:17): [True: 201, False: 283k]
  ------------------
  956|   283k|            const int refpoc = c->refs[hdr->refidx[i]].p.p.frame_hdr->frame_offset;
  957|       |
  958|   283k|            const int diff = get_poc_diff(seqhdr->order_hint_n_bits, refpoc, poc);
  959|   283k|            if (diff > 0) {
  ------------------
  |  Branch (959:17): [True: 94.7k, False: 188k]
  ------------------
  960|  94.7k|                if (off_after < 0 || get_poc_diff(seqhdr->order_hint_n_bits,
  ------------------
  |  Branch (960:21): [True: 25.8k, False: 68.9k]
  |  Branch (960:38): [True: 5.57k, False: 63.3k]
  ------------------
  961|  68.9k|                                                  off_after, refpoc) > 0)
  962|  31.3k|                {
  963|  31.3k|                    off_after = refpoc;
  964|  31.3k|                    off_after_idx = i;
  965|  31.3k|                }
  966|   188k|            } else if (diff < 0 && (off_before < 0 ||
  ------------------
  |  Branch (966:24): [True: 121k, False: 66.5k]
  |  Branch (966:37): [True: 35.1k, False: 86.5k]
  ------------------
  967|  86.5k|                                    get_poc_diff(seqhdr->order_hint_n_bits,
  ------------------
  |  Branch (967:37): [True: 4.32k, False: 82.2k]
  ------------------
  968|  86.5k|                                                 refpoc, off_before) > 0))
  969|  39.4k|            {
  970|  39.4k|                off_before = refpoc;
  971|  39.4k|                off_before_idx = i;
  972|  39.4k|            }
  973|   283k|        }
  974|       |
  975|  40.4k|        if ((off_before | off_after) >= 0) {
  ------------------
  |  Branch (975:13): [True: 22.0k, False: 18.3k]
  ------------------
  976|  22.0k|            hdr->skip_mode_refs[0] = imin(off_before_idx, off_after_idx);
  977|  22.0k|            hdr->skip_mode_refs[1] = imax(off_before_idx, off_after_idx);
  978|  22.0k|            hdr->skip_mode_allowed = 1;
  979|  22.0k|        } else if (off_before >= 0) {
  ------------------
  |  Branch (979:20): [True: 13.0k, False: 5.30k]
  ------------------
  980|  13.0k|            int off_before2 = -1;
  981|  13.0k|            int off_before2_idx;
  982|   104k|            for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (982:29): [True: 91.3k, False: 13.0k]
  ------------------
  983|  91.3k|                if (!c->refs[hdr->refidx[i]].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (983:21): [True: 0, False: 91.3k]
  ------------------
  984|  91.3k|                const int refpoc = c->refs[hdr->refidx[i]].p.p.frame_hdr->frame_offset;
  985|  91.3k|                if (get_poc_diff(seqhdr->order_hint_n_bits,
  ------------------
  |  Branch (985:21): [True: 31.6k, False: 59.6k]
  ------------------
  986|  91.3k|                                 refpoc, off_before) < 0) {
  987|  31.6k|                    if (off_before2 < 0 || get_poc_diff(seqhdr->order_hint_n_bits,
  ------------------
  |  Branch (987:25): [True: 7.68k, False: 24.0k]
  |  Branch (987:44): [True: 408, False: 23.6k]
  ------------------
  988|  24.0k|                                                        refpoc, off_before2) > 0)
  989|  8.08k|                    {
  990|  8.08k|                        off_before2 = refpoc;
  991|  8.08k|                        off_before2_idx = i;
  992|  8.08k|                    }
  993|  31.6k|                }
  994|  91.3k|            }
  995|       |
  996|  13.0k|            if (off_before2 >= 0) {
  ------------------
  |  Branch (996:17): [True: 7.68k, False: 5.36k]
  ------------------
  997|  7.68k|                hdr->skip_mode_refs[0] = imin(off_before_idx, off_before2_idx);
  998|  7.68k|                hdr->skip_mode_refs[1] = imax(off_before_idx, off_before2_idx);
  999|  7.68k|                hdr->skip_mode_allowed = 1;
 1000|  7.68k|            }
 1001|  13.0k|        }
 1002|  40.4k|    }
 1003|   245k|    if (hdr->skip_mode_allowed)
  ------------------
  |  Branch (1003:9): [True: 29.7k, False: 215k]
  ------------------
 1004|  29.7k|        hdr->skip_mode_enabled = dav1d_get_bit(gb);
 1005|       |#if DEBUG_FRAME_HDR
 1006|       |    printf("HDR: post-extskip: off=%td\n",
 1007|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
 1008|       |#endif
 1009|   245k|    if (!hdr->error_resilient_mode && IS_INTER_OR_SWITCH(hdr) && seqhdr->warped_motion)
  ------------------
  |  |   36|   348k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 98.3k, False: 4.15k]
  |  |  ------------------
  ------------------
  |  Branch (1009:9): [True: 102k, False: 143k]
  |  Branch (1009:66): [True: 71.6k, False: 26.7k]
  ------------------
 1010|  71.6k|        hdr->warp_motion = dav1d_get_bit(gb);
 1011|       |#if DEBUG_FRAME_HDR
 1012|       |    printf("HDR: post-warpmotionbit: off=%td\n",
 1013|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
 1014|       |#endif
 1015|   245k|    hdr->reduced_txtp_set = dav1d_get_bit(gb);
 1016|       |#if DEBUG_FRAME_HDR
 1017|       |    printf("HDR: post-reducedtxtpset: off=%td\n",
 1018|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
 1019|       |#endif
 1020|       |
 1021|  1.96M|    for (int i = 0; i < 7; i++)
  ------------------
  |  Branch (1021:21): [True: 1.72M, False: 245k]
  ------------------
 1022|  1.72M|        hdr->gmv[i] = dav1d_default_wm_params;
 1023|       |
 1024|   245k|    if (IS_INTER_OR_SWITCH(hdr)) {
  ------------------
  |  |   36|   245k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 101k, False: 144k]
  |  |  ------------------
  ------------------
 1025|   811k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (1025:25): [True: 709k, False: 101k]
  ------------------
 1026|   709k|            hdr->gmv[i].type = !dav1d_get_bit(gb) ? DAV1D_WM_TYPE_IDENTITY :
  ------------------
  |  Branch (1026:32): [True: 670k, False: 38.9k]
  ------------------
 1027|   709k|                                dav1d_get_bit(gb) ? DAV1D_WM_TYPE_ROT_ZOOM :
  ------------------
  |  Branch (1027:33): [True: 20.0k, False: 18.8k]
  ------------------
 1028|  38.9k|                                dav1d_get_bit(gb) ? DAV1D_WM_TYPE_TRANSLATION :
  ------------------
  |  Branch (1028:33): [True: 5.05k, False: 13.8k]
  ------------------
 1029|  18.8k|                                                    DAV1D_WM_TYPE_AFFINE;
 1030|       |
 1031|   709k|            if (hdr->gmv[i].type == DAV1D_WM_TYPE_IDENTITY) continue;
  ------------------
  |  Branch (1031:17): [True: 670k, False: 38.9k]
  ------------------
 1032|       |
 1033|  38.9k|            const Dav1dWarpedMotionParams *ref_gmv;
 1034|  38.9k|            if (hdr->primary_ref_frame == DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|  38.9k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (1034:17): [True: 1.80k, False: 37.1k]
  ------------------
 1035|  1.80k|                ref_gmv = &dav1d_default_wm_params;
 1036|  37.1k|            } else {
 1037|  37.1k|                const int pri_ref = hdr->refidx[hdr->primary_ref_frame];
 1038|  37.1k|                if (!c->refs[pri_ref].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (1038:21): [True: 226, False: 36.8k]
  ------------------
 1039|  36.8k|                ref_gmv = &c->refs[pri_ref].p.p.frame_hdr->gmv[i];
 1040|  36.8k|            }
 1041|  38.6k|            int32_t *const mat = hdr->gmv[i].matrix;
 1042|  38.6k|            const int32_t *const ref_mat = ref_gmv->matrix;
 1043|  38.6k|            int bits, shift;
 1044|       |
 1045|  38.6k|            if (hdr->gmv[i].type >= DAV1D_WM_TYPE_ROT_ZOOM) {
  ------------------
  |  Branch (1045:17): [True: 33.6k, False: 5.05k]
  ------------------
 1046|  33.6k|                mat[2] = (1 << 16) + 2 *
 1047|  33.6k|                    dav1d_get_bits_subexp(gb, (ref_mat[2] - (1 << 16)) >> 1, 12);
 1048|  33.6k|                mat[3] = 2 * dav1d_get_bits_subexp(gb, ref_mat[3] >> 1, 12);
 1049|       |
 1050|  33.6k|                bits = 12;
 1051|  33.6k|                shift = 10;
 1052|  33.6k|            } else {
 1053|  5.05k|                bits = 9 - !hdr->hp;
 1054|  5.05k|                shift = 13 + !hdr->hp;
 1055|  5.05k|            }
 1056|       |
 1057|  38.6k|            if (hdr->gmv[i].type == DAV1D_WM_TYPE_AFFINE) {
  ------------------
  |  Branch (1057:17): [True: 13.8k, False: 24.8k]
  ------------------
 1058|  13.8k|                mat[4] = 2 * dav1d_get_bits_subexp(gb, ref_mat[4] >> 1, 12);
 1059|  13.8k|                mat[5] = (1 << 16) + 2 *
 1060|  13.8k|                    dav1d_get_bits_subexp(gb, (ref_mat[5] - (1 << 16)) >> 1, 12);
 1061|  24.8k|            } else {
 1062|  24.8k|                mat[4] = -mat[3];
 1063|  24.8k|                mat[5] = mat[2];
 1064|  24.8k|            }
 1065|       |
 1066|  38.6k|            mat[0] = dav1d_get_bits_subexp(gb, ref_mat[0] >> shift, bits) * (1 << shift);
 1067|  38.6k|            mat[1] = dav1d_get_bits_subexp(gb, ref_mat[1] >> shift, bits) * (1 << shift);
 1068|  38.6k|        }
 1069|   101k|    }
 1070|       |#if DEBUG_FRAME_HDR
 1071|       |    printf("HDR: post-gmv: off=%td\n",
 1072|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
 1073|       |#endif
 1074|       |
 1075|   245k|    if (seqhdr->film_grain_present && (hdr->show_frame || hdr->showable_frame)) {
  ------------------
  |  Branch (1075:9): [True: 142k, False: 102k]
  |  Branch (1075:40): [True: 108k, False: 34.4k]
  |  Branch (1075:59): [True: 2.04k, False: 32.3k]
  ------------------
 1076|   110k|        hdr->film_grain.present = dav1d_get_bit(gb);
 1077|   110k|        if (hdr->film_grain.present) {
  ------------------
  |  Branch (1077:13): [True: 21.6k, False: 88.8k]
  ------------------
 1078|  21.6k|            const unsigned seed = dav1d_get_bits(gb, 16);
 1079|  21.6k|            hdr->film_grain.update = hdr->frame_type != DAV1D_FRAME_TYPE_INTER || dav1d_get_bit(gb);
  ------------------
  |  Branch (1079:38): [True: 6.70k, False: 14.9k]
  |  Branch (1079:83): [True: 530, False: 14.3k]
  ------------------
 1080|  21.6k|            if (!hdr->film_grain.update) {
  ------------------
  |  Branch (1080:17): [True: 14.3k, False: 7.23k]
  ------------------
 1081|  14.3k|                const int refidx = dav1d_get_bits(gb, 3);
 1082|  14.3k|                int i;
 1083|  35.8k|                for (i = 0; i < 7; i++)
  ------------------
  |  Branch (1083:29): [True: 35.5k, False: 236]
  ------------------
 1084|  35.5k|                    if (hdr->refidx[i] == refidx)
  ------------------
  |  Branch (1084:25): [True: 14.1k, False: 21.4k]
  ------------------
 1085|  14.1k|                        break;
 1086|  14.3k|                if (i == 7 || !c->refs[refidx].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (1086:21): [True: 236, False: 14.1k]
  |  Branch (1086:31): [True: 218, False: 13.9k]
  ------------------
 1087|  13.9k|                hdr->film_grain.data = c->refs[refidx].p.p.frame_hdr->film_grain.data;
 1088|  13.9k|                hdr->film_grain.data.seed = seed;
 1089|  13.9k|            } else {
 1090|  7.23k|                Dav1dFilmGrainData *const fgd = &hdr->film_grain.data;
 1091|  7.23k|                fgd->seed = seed;
 1092|       |
 1093|  7.23k|                fgd->num_y_points = dav1d_get_bits(gb, 4);
 1094|  7.23k|                if (fgd->num_y_points > 14) goto error;
  ------------------
  |  Branch (1094:21): [True: 563, False: 6.67k]
  ------------------
 1095|  11.3k|                for (int i = 0; i < fgd->num_y_points; i++) {
  ------------------
  |  Branch (1095:33): [True: 5.43k, False: 5.86k]
  ------------------
 1096|  5.43k|                    fgd->y_points[i][0] = dav1d_get_bits(gb, 8);
 1097|  5.43k|                    if (i && fgd->y_points[i - 1][0] >= fgd->y_points[i][0])
  ------------------
  |  Branch (1097:25): [True: 2.11k, False: 3.32k]
  |  Branch (1097:30): [True: 809, False: 1.30k]
  ------------------
 1098|    809|                        goto error;
 1099|  4.62k|                    fgd->y_points[i][1] = dav1d_get_bits(gb, 8);
 1100|  4.62k|                }
 1101|       |
 1102|  5.86k|                if (!seqhdr->monochrome)
  ------------------
  |  Branch (1102:21): [True: 5.05k, False: 806]
  ------------------
 1103|  5.05k|                    fgd->chroma_scaling_from_luma = dav1d_get_bit(gb);
 1104|  5.86k|                if (seqhdr->monochrome || fgd->chroma_scaling_from_luma ||
  ------------------
  |  Branch (1104:21): [True: 806, False: 5.05k]
  |  Branch (1104:43): [True: 1.88k, False: 3.17k]
  ------------------
 1105|  3.17k|                    (seqhdr->ss_ver == 1 && seqhdr->ss_hor == 1 && !fgd->num_y_points))
  ------------------
  |  Branch (1105:22): [True: 1.74k, False: 1.43k]
  |  Branch (1105:45): [True: 1.74k, False: 0]
  |  Branch (1105:68): [True: 279, False: 1.46k]
  ------------------
 1106|  2.96k|                {
 1107|  2.96k|                    fgd->num_uv_points[0] = fgd->num_uv_points[1] = 0;
 1108|  6.35k|                } else for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1108:41): [True: 4.72k, False: 1.62k]
  ------------------
 1109|  4.72k|                    fgd->num_uv_points[pl] = dav1d_get_bits(gb, 4);
 1110|  4.72k|                    if (fgd->num_uv_points[pl] > 10) goto error;
  ------------------
  |  Branch (1110:25): [True: 211, False: 4.51k]
  ------------------
 1111|  8.33k|                    for (int i = 0; i < fgd->num_uv_points[pl]; i++) {
  ------------------
  |  Branch (1111:37): [True: 4.88k, False: 3.45k]
  ------------------
 1112|  4.88k|                        fgd->uv_points[pl][i][0] = dav1d_get_bits(gb, 8);
 1113|  4.88k|                        if (i && fgd->uv_points[pl][i - 1][0] >= fgd->uv_points[pl][i][0])
  ------------------
  |  Branch (1113:29): [True: 3.07k, False: 1.81k]
  |  Branch (1113:34): [True: 1.05k, False: 2.01k]
  ------------------
 1114|  1.05k|                            goto error;
 1115|  3.82k|                        fgd->uv_points[pl][i][1] = dav1d_get_bits(gb, 8);
 1116|  3.82k|                    }
 1117|  4.51k|                }
 1118|       |
 1119|  4.59k|                if (seqhdr->ss_hor == 1 && seqhdr->ss_ver == 1 &&
  ------------------
  |  Branch (1119:21): [True: 3.81k, False: 780]
  |  Branch (1119:44): [True: 3.33k, False: 477]
  ------------------
 1120|  3.33k|                    !!fgd->num_uv_points[0] != !!fgd->num_uv_points[1])
  ------------------
  |  Branch (1120:21): [True: 198, False: 3.14k]
  ------------------
 1121|    198|                {
 1122|    198|                    goto error;
 1123|    198|                }
 1124|       |
 1125|  4.39k|                fgd->scaling_shift = dav1d_get_bits(gb, 2) + 8;
 1126|  4.39k|                fgd->ar_coeff_lag = dav1d_get_bits(gb, 2);
 1127|  4.39k|                const int num_y_pos = 2 * fgd->ar_coeff_lag * (fgd->ar_coeff_lag + 1);
 1128|  4.39k|                if (fgd->num_y_points)
  ------------------
  |  Branch (1128:21): [True: 1.57k, False: 2.82k]
  ------------------
 1129|  16.0k|                    for (int i = 0; i < num_y_pos; i++)
  ------------------
  |  Branch (1129:37): [True: 14.4k, False: 1.57k]
  ------------------
 1130|  14.4k|                        fgd->ar_coeffs_y[i] = dav1d_get_bits(gb, 8) - 128;
 1131|  13.1k|                for (int pl = 0; pl < 2; pl++)
  ------------------
  |  Branch (1131:34): [True: 8.79k, False: 4.39k]
  ------------------
 1132|  8.79k|                    if (fgd->num_uv_points[pl] || fgd->chroma_scaling_from_luma) {
  ------------------
  |  Branch (1132:25): [True: 549, False: 8.24k]
  |  Branch (1132:51): [True: 3.76k, False: 4.48k]
  ------------------
 1133|  4.31k|                        const int num_uv_pos = num_y_pos + !!fgd->num_y_points;
 1134|  26.5k|                        for (int i = 0; i < num_uv_pos; i++)
  ------------------
  |  Branch (1134:41): [True: 22.2k, False: 4.31k]
  ------------------
 1135|  22.2k|                            fgd->ar_coeffs_uv[pl][i] = dav1d_get_bits(gb, 8) - 128;
 1136|  4.31k|                        if (!fgd->num_y_points)
  ------------------
  |  Branch (1136:29): [True: 2.68k, False: 1.62k]
  ------------------
 1137|  2.68k|                            fgd->ar_coeffs_uv[pl][num_uv_pos] = 0;
 1138|  4.31k|                    }
 1139|  4.39k|                fgd->ar_coeff_shift = dav1d_get_bits(gb, 2) + 6;
 1140|  4.39k|                fgd->grain_scale_shift = dav1d_get_bits(gb, 2);
 1141|  13.1k|                for (int pl = 0; pl < 2; pl++)
  ------------------
  |  Branch (1141:34): [True: 8.79k, False: 4.39k]
  ------------------
 1142|  8.79k|                    if (fgd->num_uv_points[pl]) {
  ------------------
  |  Branch (1142:25): [True: 549, False: 8.24k]
  ------------------
 1143|    549|                        fgd->uv_mult[pl] = dav1d_get_bits(gb, 8) - 128;
 1144|    549|                        fgd->uv_luma_mult[pl] = dav1d_get_bits(gb, 8) - 128;
 1145|    549|                        fgd->uv_offset[pl] = dav1d_get_bits(gb, 9) - 256;
 1146|    549|                    }
 1147|  4.39k|                fgd->overlap_flag = dav1d_get_bit(gb);
 1148|  4.39k|                fgd->clip_to_restricted_range = dav1d_get_bit(gb);
 1149|  4.39k|            }
 1150|  21.6k|        }
 1151|   110k|    }
 1152|       |#if DEBUG_FRAME_HDR
 1153|       |    printf("HDR: post-filmgrain: off=%td\n",
 1154|       |           (gb->ptr - init_ptr) * 8 - gb->bits_left);
 1155|       |#endif
 1156|       |
 1157|   242k|    return 0;
 1158|       |
 1159|  11.1k|error:
 1160|  11.1k|    dav1d_log(c, "Error parsing frame header\n");
  ------------------
  |  |   44|  11.1k|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 11.1k]
  |  |  ------------------
  ------------------
 1161|  11.1k|    return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|  11.1k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 1162|   245k|}
obu.c:read_frame_size:
  343|   251k|{
  344|   251k|    const Dav1dSequenceHeader *const seqhdr = c->seq_hdr;
  345|   251k|    Dav1dFrameHeader *const hdr = c->frame_hdr;
  346|       |
  347|   251k|    if (use_ref) {
  ------------------
  |  Branch (347:9): [True: 62.9k, False: 188k]
  ------------------
  348|   103k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (348:25): [True: 102k, False: 993]
  ------------------
  349|   102k|            if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (349:17): [True: 61.9k, False: 40.6k]
  ------------------
  350|  61.9k|                const Dav1dThreadPicture *const ref =
  351|  61.9k|                    &c->refs[c->frame_hdr->refidx[i]].p;
  352|  61.9k|                if (!ref->p.frame_hdr) return -1;
  ------------------
  |  Branch (352:21): [True: 383, False: 61.5k]
  ------------------
  353|  61.5k|                hdr->width[1] = ref->p.frame_hdr->width[1];
  354|  61.5k|                hdr->height = ref->p.frame_hdr->height;
  355|  61.5k|                if (hdr->width[1] > seqhdr->max_width ||
  ------------------
  |  Branch (355:21): [True: 0, False: 61.5k]
  ------------------
  356|  61.5k|                    hdr->height > seqhdr->max_height)
  ------------------
  |  Branch (356:21): [True: 0, False: 61.5k]
  ------------------
  357|      0|                {
  358|      0|                    return -1;
  359|      0|                }
  360|  61.5k|                hdr->render_width = ref->p.frame_hdr->render_width;
  361|  61.5k|                hdr->render_height = ref->p.frame_hdr->render_height;
  362|  61.5k|                hdr->super_res.enabled = seqhdr->super_res && dav1d_get_bit(gb);
  ------------------
  |  Branch (362:42): [True: 13.6k, False: 47.8k]
  |  Branch (362:63): [True: 2.11k, False: 11.5k]
  ------------------
  363|  61.5k|                if (hdr->super_res.enabled) {
  ------------------
  |  Branch (363:21): [True: 2.11k, False: 59.4k]
  ------------------
  364|  2.11k|                    const int d = hdr->super_res.width_scale_denominator =
  365|  2.11k|                        9 + dav1d_get_bits(gb, 3);
  366|  2.11k|                    hdr->width[0] = imax((hdr->width[1] * 8 + (d >> 1)) / d,
  367|  2.11k|                                         imin(16, hdr->width[1]));
  368|  59.4k|                } else {
  369|  59.4k|                    hdr->super_res.width_scale_denominator = 8;
  370|  59.4k|                    hdr->width[0] = hdr->width[1];
  371|  59.4k|                }
  372|  61.5k|                return 0;
  373|  61.5k|            }
  374|   102k|        }
  375|  62.9k|    }
  376|       |
  377|   189k|    if (hdr->frame_size_override) {
  ------------------
  |  Branch (377:9): [True: 11.1k, False: 178k]
  ------------------
  378|  11.1k|        hdr->width[1] = dav1d_get_bits(gb, seqhdr->width_n_bits) + 1;
  379|  11.1k|        hdr->height = dav1d_get_bits(gb, seqhdr->height_n_bits) + 1;
  380|  11.1k|        if (hdr->width[1] > seqhdr->max_width ||
  ------------------
  |  Branch (380:13): [True: 3.61k, False: 7.57k]
  ------------------
  381|  7.57k|            hdr->height > seqhdr->max_height)
  ------------------
  |  Branch (381:13): [True: 352, False: 7.22k]
  ------------------
  382|  3.96k|        {
  383|  3.96k|            return -1;
  384|  3.96k|        }
  385|   178k|    } else {
  386|   178k|        hdr->width[1] = seqhdr->max_width;
  387|   178k|        hdr->height = seqhdr->max_height;
  388|   178k|    }
  389|   185k|    hdr->super_res.enabled = seqhdr->super_res && dav1d_get_bit(gb);
  ------------------
  |  Branch (389:30): [True: 144k, False: 41.4k]
  |  Branch (389:51): [True: 48.8k, False: 95.4k]
  ------------------
  390|   185k|    if (hdr->super_res.enabled) {
  ------------------
  |  Branch (390:9): [True: 48.8k, False: 136k]
  ------------------
  391|  48.8k|        const int d = hdr->super_res.width_scale_denominator = 9 + dav1d_get_bits(gb, 3);
  392|  48.8k|        hdr->width[0] = imax((hdr->width[1] * 8 + (d >> 1)) / d, imin(16, hdr->width[1]));
  393|   136k|    } else {
  394|   136k|        hdr->super_res.width_scale_denominator = 8;
  395|   136k|        hdr->width[0] = hdr->width[1];
  396|   136k|    }
  397|   185k|    hdr->have_render_size = dav1d_get_bit(gb);
  398|   185k|    if (hdr->have_render_size) {
  ------------------
  |  Branch (398:9): [True: 7.20k, False: 178k]
  ------------------
  399|  7.20k|        hdr->render_width = dav1d_get_bits(gb, 16) + 1;
  400|  7.20k|        hdr->render_height = dav1d_get_bits(gb, 16) + 1;
  401|   178k|    } else {
  402|   178k|        hdr->render_width = hdr->width[1];
  403|   178k|        hdr->render_height = hdr->height;
  404|   178k|    }
  405|   185k|    return 0;
  406|   189k|}
obu.c:tile_log2:
  408|  1.10M|static inline int tile_log2(const int sz, const int tgt) {
  409|  1.10M|    int k;
  410|  1.90M|    for (k = 0; (sz << k) < tgt; k++) ;
  ------------------
  |  Branch (410:17): [True: 801k, False: 1.10M]
  ------------------
  411|  1.10M|    return k;
  412|  1.10M|}
obu.c:check_trailing_bits:
   50|  90.8k|{
   51|  90.8k|    const int trailing_one_bit = dav1d_get_bit(gb);
   52|       |
   53|  90.8k|    if (gb->error)
  ------------------
  |  Branch (53:9): [True: 9.05k, False: 81.7k]
  ------------------
   54|  9.05k|        return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|  9.05k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
   55|       |
   56|  81.7k|    if (!strict_std_compliance)
  ------------------
  |  Branch (56:9): [True: 81.7k, False: 0]
  ------------------
   57|  81.7k|        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:
 1164|   234k|static void parse_tile_hdr(Dav1dContext *const c, GetBits *const gb) {
 1165|   234k|    const int n_tiles = c->frame_hdr->tiling.cols * c->frame_hdr->tiling.rows;
 1166|   234k|    const int have_tile_pos = n_tiles > 1 ? dav1d_get_bit(gb) : 0;
  ------------------
  |  Branch (1166:31): [True: 32.5k, False: 201k]
  ------------------
 1167|       |
 1168|   234k|    if (have_tile_pos) {
  ------------------
  |  Branch (1168:9): [True: 3.34k, False: 230k]
  ------------------
 1169|  3.34k|        const int n_bits = c->frame_hdr->tiling.log2_cols +
 1170|  3.34k|                           c->frame_hdr->tiling.log2_rows;
 1171|  3.34k|        c->tile[c->n_tile_data].start = dav1d_get_bits(gb, n_bits);
 1172|  3.34k|        c->tile[c->n_tile_data].end = dav1d_get_bits(gb, n_bits);
 1173|   230k|    } else {
 1174|   230k|        c->tile[c->n_tile_data].start = 0;
 1175|   230k|        c->tile[c->n_tile_data].end = n_tiles - 1;
 1176|   230k|    }
 1177|   234k|}

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

dav1d_default_picture_alloc:
   46|   258k|int dav1d_default_picture_alloc(Dav1dPicture *const p, void *const cookie) {
   47|   258k|    const int hbd = p->p.bpc > 8;
   48|   258k|    const int aligned_w = (p->p.w + 127) & ~127;
   49|   258k|    const int aligned_h = (p->p.h + 127) & ~127;
   50|   258k|    const int has_chroma = p->p.layout != DAV1D_PIXEL_LAYOUT_I400;
   51|   258k|    const int ss_ver = p->p.layout == DAV1D_PIXEL_LAYOUT_I420;
   52|   258k|    const int ss_hor = p->p.layout != DAV1D_PIXEL_LAYOUT_I444;
   53|   258k|    ptrdiff_t y_stride = aligned_w << hbd;
   54|   258k|    ptrdiff_t uv_stride = has_chroma ? y_stride >> ss_hor : 0;
  ------------------
  |  Branch (54:27): [True: 173k, False: 85.4k]
  ------------------
   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|   258k|    if (!(y_stride & 1023))
  ------------------
  |  Branch (60:9): [True: 35.6k, False: 222k]
  ------------------
   61|  35.6k|        y_stride += DAV1D_PICTURE_ALIGNMENT;
  ------------------
  |  |   44|  35.6k|#define DAV1D_PICTURE_ALIGNMENT 64
  ------------------
   62|   258k|    if (!(uv_stride & 1023) && has_chroma)
  ------------------
  |  Branch (62:9): [True: 117k, False: 140k]
  |  Branch (62:32): [True: 32.5k, False: 85.4k]
  ------------------
   63|  32.5k|        uv_stride += DAV1D_PICTURE_ALIGNMENT;
  ------------------
  |  |   44|  32.5k|#define DAV1D_PICTURE_ALIGNMENT 64
  ------------------
   64|   258k|    p->stride[0] = y_stride;
   65|   258k|    p->stride[1] = uv_stride;
   66|   258k|    const size_t y_sz = y_stride * aligned_h;
   67|   258k|    const size_t uv_sz = uv_stride * (aligned_h >> ss_ver);
   68|   258k|    const size_t pic_size = y_sz + 2 * uv_sz;
   69|       |
   70|   258k|    uint8_t *const buf = dav1d_mem_pool_pop(cookie, pic_size + DAV1D_PICTURE_ALIGNMENT);
  ------------------
  |  |   44|   258k|#define DAV1D_PICTURE_ALIGNMENT 64
  ------------------
   71|   258k|    if (!buf) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (71:9): [True: 0, False: 258k]
  ------------------
   72|   258k|    p->allocator_data = buf;
   73|   258k|    p->data[0] = buf;
   74|   258k|    p->data[1] = has_chroma ? buf + y_sz : NULL;
  ------------------
  |  Branch (74:18): [True: 173k, False: 85.4k]
  ------------------
   75|   258k|    p->data[2] = has_chroma ? buf + y_sz + uv_sz : NULL;
  ------------------
  |  Branch (75:18): [True: 173k, False: 85.4k]
  ------------------
   76|       |
   77|   258k|    return 0;
   78|   258k|}
dav1d_default_picture_release:
   80|   258k|void dav1d_default_picture_release(Dav1dPicture *const p, void *const cookie) {
   81|   258k|    dav1d_mem_pool_push(cookie, p->allocator_data);
   82|   258k|}
dav1d_picture_free_itut_t35:
   99|    823|void dav1d_picture_free_itut_t35(const uint8_t *const data, void *const user_data) {
  100|    823|    struct itut_t35_ctx_context *itut_t35_ctx = user_data;
  101|       |
  102|  3.09k|    for (size_t i = 0; i < itut_t35_ctx->n_itut_t35; i++)
  ------------------
  |  Branch (102:24): [True: 2.27k, False: 823]
  ------------------
  103|  2.27k|        dav1d_free(itut_t35_ctx->itut_t35[i].payload);
  ------------------
  |  |  135|  2.27k|#define dav1d_free(ptr) free(ptr)
  ------------------
  104|    823|    dav1d_free(itut_t35_ctx->itut_t35);
  ------------------
  |  |  135|    823|#define dav1d_free(ptr) free(ptr)
  ------------------
  105|    823|    dav1d_free(itut_t35_ctx);
  ------------------
  |  |  135|    823|#define dav1d_free(ptr) free(ptr)
  ------------------
  106|    823|}
dav1d_picture_copy_props:
  164|   221k|{
  165|   221k|    dav1d_data_props_copy(&p->m, props);
  166|       |
  167|   221k|    dav1d_ref_dec(&p->content_light_ref);
  168|   221k|    p->content_light_ref = content_light_ref;
  169|   221k|    p->content_light = content_light;
  170|   221k|    if (content_light_ref) dav1d_ref_inc(content_light_ref);
  ------------------
  |  Branch (170:9): [True: 6.60k, False: 214k]
  ------------------
  171|       |
  172|   221k|    dav1d_ref_dec(&p->mastering_display_ref);
  173|   221k|    p->mastering_display_ref = mastering_display_ref;
  174|   221k|    p->mastering_display = mastering_display;
  175|   221k|    if (mastering_display_ref) dav1d_ref_inc(mastering_display_ref);
  ------------------
  |  Branch (175:9): [True: 2.40k, False: 219k]
  ------------------
  176|       |
  177|   221k|    dav1d_ref_dec(&p->itut_t35_ref);
  178|   221k|    p->itut_t35_ref = itut_t35_ref;
  179|   221k|    p->itut_t35 = itut_t35;
  180|   221k|    p->n_itut_t35 = n_itut_t35;
  181|   221k|    if (itut_t35_ref) dav1d_ref_inc(itut_t35_ref);
  ------------------
  |  Branch (181:9): [True: 1.24k, False: 220k]
  ------------------
  182|   221k|}
dav1d_thread_picture_alloc:
  186|   216k|{
  187|   216k|    Dav1dThreadPicture *const p = &f->sr_cur;
  188|       |
  189|   216k|    const int res = picture_alloc(c, &p->p, f->frame_hdr->width[1], f->frame_hdr->height,
  190|   216k|                                  f->seq_hdr, f->seq_hdr_ref,
  191|   216k|                                  f->frame_hdr, f->frame_hdr_ref,
  192|   216k|                                  bpc, &f->tile[0].data.m, &c->allocator,
  193|   216k|                                  (void **) &p->progress);
  194|   216k|    if (res) return res;
  ------------------
  |  Branch (194:9): [True: 0, False: 216k]
  ------------------
  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|   216k|    const int flags_mask = ((f->frame_hdr->show_frame || c->output_invisible_frames) &&
  ------------------
  |  Branch (198:30): [True: 151k, False: 64.6k]
  |  Branch (198:58): [True: 0, False: 64.6k]
  ------------------
  199|   151k|                            c->max_spatial_id == f->frame_hdr->spatial_id)
  ------------------
  |  Branch (199:29): [True: 141k, False: 10.0k]
  ------------------
  200|   216k|                           ? 0 : (PICTURE_FLAG_NEW_SEQUENCE | PICTURE_FLAG_NEW_OP_PARAMS_INFO);
  201|   216k|    p->flags = c->frame_flags;
  202|   216k|    c->frame_flags &= flags_mask;
  203|       |
  204|   216k|    p->visible = f->frame_hdr->show_frame;
  205|   216k|    p->showable = f->frame_hdr->showable_frame;
  206|       |
  207|   216k|    if (p->visible) {
  ------------------
  |  Branch (207:9): [True: 151k, False: 64.6k]
  ------------------
  208|       |        // Only add HDR10+ and T35 metadata when show frame flag is enabled
  209|   151k|        dav1d_picture_copy_props(&p->p, c->content_light, c->content_light_ref,
  210|   151k|                                 c->mastering_display, c->mastering_display_ref,
  211|   151k|                                 c->itut_t35, c->itut_t35_ref, c->n_itut_t35,
  212|   151k|                                 &f->tile[0].data.m);
  213|       |
  214|       |        // Must be removed from the context after being attached to the frame
  215|   151k|        dav1d_ref_dec(&c->itut_t35_ref);
  216|   151k|        c->itut_t35 = NULL;
  217|   151k|        c->n_itut_t35 = 0;
  218|   151k|    } else {
  219|  64.6k|        dav1d_data_props_copy(&p->p.m, &f->tile[0].data.m);
  220|  64.6k|    }
  221|       |
  222|   216k|    if (c->n_fc > 1) {
  ------------------
  |  Branch (222:9): [True: 216k, False: 0]
  ------------------
  223|   216k|        atomic_init(&p->progress[0], 0);
  224|       |        atomic_init(&p->progress[1], 0);
  225|   216k|    }
  226|   216k|    return res;
  227|   216k|}
dav1d_picture_alloc_copy:
  231|  41.9k|{
  232|  41.9k|    struct pic_ctx_context *const pic_ctx = (struct pic_ctx_context*)src->ref->const_data;
  233|  41.9k|    const int res = picture_alloc(c, dst, w, src->p.h,
  234|  41.9k|                                  src->seq_hdr, src->seq_hdr_ref,
  235|  41.9k|                                  src->frame_hdr, src->frame_hdr_ref,
  236|  41.9k|                                  src->p.bpc, &src->m, &pic_ctx->allocator,
  237|  41.9k|                                  NULL);
  238|  41.9k|    if (res) return res;
  ------------------
  |  Branch (238:9): [True: 0, False: 41.9k]
  ------------------
  239|       |
  240|  41.9k|    dav1d_picture_copy_props(dst, src->content_light, src->content_light_ref,
  241|  41.9k|                             src->mastering_display, src->mastering_display_ref,
  242|  41.9k|                             src->itut_t35, src->itut_t35_ref, src->n_itut_t35,
  243|  41.9k|                             &src->m);
  244|       |
  245|  41.9k|    return 0;
  246|  41.9k|}
dav1d_picture_ref:
  248|  2.55M|void dav1d_picture_ref(Dav1dPicture *const dst, const Dav1dPicture *const src) {
  249|  2.55M|    assert(dst != NULL);
  ------------------
  |  Branch (249:5): [True: 2.55M, False: 0]
  ------------------
  250|  2.55M|    assert(dst->data[0] == NULL);
  ------------------
  |  Branch (250:5): [True: 2.55M, False: 0]
  ------------------
  251|  2.55M|    assert(src != NULL);
  ------------------
  |  Branch (251:5): [True: 2.55M, False: 0]
  ------------------
  252|       |
  253|  2.55M|    if (src->ref) {
  ------------------
  |  Branch (253:9): [True: 2.55M, False: 0]
  ------------------
  254|  2.55M|        assert(src->data[0] != NULL);
  ------------------
  |  Branch (254:9): [True: 2.55M, False: 0]
  ------------------
  255|  2.55M|        dav1d_ref_inc(src->ref);
  256|  2.55M|    }
  257|  2.55M|    if (src->frame_hdr_ref) dav1d_ref_inc(src->frame_hdr_ref);
  ------------------
  |  Branch (257:9): [True: 2.55M, False: 0]
  ------------------
  258|  2.55M|    if (src->seq_hdr_ref) dav1d_ref_inc(src->seq_hdr_ref);
  ------------------
  |  Branch (258:9): [True: 2.55M, False: 0]
  ------------------
  259|  2.55M|    if (src->m.user_data.ref) dav1d_ref_inc(src->m.user_data.ref);
  ------------------
  |  Branch (259:9): [True: 0, False: 2.55M]
  ------------------
  260|  2.55M|    if (src->content_light_ref) dav1d_ref_inc(src->content_light_ref);
  ------------------
  |  Branch (260:9): [True: 32.1k, False: 2.51M]
  ------------------
  261|  2.55M|    if (src->mastering_display_ref) dav1d_ref_inc(src->mastering_display_ref);
  ------------------
  |  Branch (261:9): [True: 11.8k, False: 2.53M]
  ------------------
  262|  2.55M|    if (src->itut_t35_ref) dav1d_ref_inc(src->itut_t35_ref);
  ------------------
  |  Branch (262:9): [True: 4.88k, False: 2.54M]
  ------------------
  263|  2.55M|    *dst = *src;
  264|  2.55M|}
dav1d_picture_move_ref:
  266|  49.9k|void dav1d_picture_move_ref(Dav1dPicture *const dst, Dav1dPicture *const src) {
  267|  49.9k|    assert(dst != NULL);
  ------------------
  |  Branch (267:5): [True: 49.9k, False: 0]
  ------------------
  268|  49.9k|    assert(dst->data[0] == NULL);
  ------------------
  |  Branch (268:5): [True: 49.9k, False: 0]
  ------------------
  269|  49.9k|    assert(src != NULL);
  ------------------
  |  Branch (269:5): [True: 49.9k, False: 0]
  ------------------
  270|       |
  271|  49.9k|    if (src->ref)
  ------------------
  |  Branch (271:9): [True: 49.9k, False: 0]
  ------------------
  272|  49.9k|        assert(src->data[0] != NULL);
  ------------------
  |  Branch (272:9): [True: 49.9k, False: 0]
  ------------------
  273|       |
  274|  49.9k|    *dst = *src;
  275|  49.9k|    memset(src, 0, sizeof(*src));
  276|  49.9k|}
dav1d_thread_picture_ref:
  280|  2.37M|{
  281|  2.37M|    dav1d_picture_ref(&dst->p, &src->p);
  282|  2.37M|    dst->visible = src->visible;
  283|  2.37M|    dst->showable = src->showable;
  284|  2.37M|    dst->progress = src->progress;
  285|  2.37M|    dst->flags = src->flags;
  286|  2.37M|}
dav1d_picture_unref_internal:
  299|  2.98M|void dav1d_picture_unref_internal(Dav1dPicture *const p) {
  300|  2.98M|    validate_input(p != NULL);
  ------------------
  |  |   59|  2.98M|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|  2.98M|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 2.98M]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |   54|      0|                    #x, __func__); \
  |  |  |  |   55|      0|        debug_abort(); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|      0|#define debug_abort abort
  |  |  |  |  ------------------
  |  |  |  |   56|      0|        return r; \
  |  |  |  |   57|      0|    }
  |  |  ------------------
  ------------------
  301|       |
  302|  2.98M|    if (p->ref) {
  ------------------
  |  Branch (302:9): [True: 2.80M, False: 176k]
  ------------------
  303|  2.80M|        validate_input(p->data[0] != NULL);
  ------------------
  |  |   59|  2.80M|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|  2.80M|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 2.80M]
  |  |  |  |  ------------------
  |  |  |  |   53|      0|        debug_print("Input validation check \'%s\' failed in %s!\n", \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|      0|#define debug_print(...) fprintf(stderr, __VA_ARGS__)
  |  |  |  |  ------------------
  |  |  |  |   54|      0|                    #x, __func__); \
  |  |  |  |   55|      0|        debug_abort(); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|      0|#define debug_abort abort
  |  |  |  |  ------------------
  |  |  |  |   56|      0|        return r; \
  |  |  |  |   57|      0|    }
  |  |  ------------------
  ------------------
  304|  2.80M|        dav1d_ref_dec(&p->ref);
  305|  2.80M|    }
  306|  2.98M|    dav1d_ref_dec(&p->seq_hdr_ref);
  307|  2.98M|    dav1d_ref_dec(&p->frame_hdr_ref);
  308|  2.98M|    dav1d_ref_dec(&p->m.user_data.ref);
  309|  2.98M|    dav1d_ref_dec(&p->content_light_ref);
  310|  2.98M|    dav1d_ref_dec(&p->mastering_display_ref);
  311|  2.98M|    dav1d_ref_dec(&p->itut_t35_ref);
  312|  2.98M|    memset(p, 0, sizeof(*p));
  313|  2.98M|    dav1d_data_props_set_defaults(&p->m);
  314|  2.98M|}
dav1d_thread_picture_unref:
  316|  2.65M|void dav1d_thread_picture_unref(Dav1dThreadPicture *const p) {
  317|  2.65M|    dav1d_picture_unref_internal(&p->p);
  318|       |
  319|       |    p->progress = NULL;
  320|  2.65M|}
dav1d_picture_get_event_flags:
  322|  53.9k|enum Dav1dEventFlags dav1d_picture_get_event_flags(const Dav1dThreadPicture *const p) {
  323|  53.9k|    if (!p->flags)
  ------------------
  |  Branch (323:9): [True: 30.8k, False: 23.0k]
  ------------------
  324|  30.8k|        return 0;
  325|       |
  326|  23.0k|    enum Dav1dEventFlags flags = 0;
  327|  23.0k|    if (p->flags & PICTURE_FLAG_NEW_SEQUENCE)
  ------------------
  |  Branch (327:9): [True: 14.2k, False: 8.79k]
  ------------------
  328|  14.2k|       flags |= DAV1D_EVENT_FLAG_NEW_SEQUENCE;
  329|  23.0k|    if (p->flags & PICTURE_FLAG_NEW_OP_PARAMS_INFO)
  ------------------
  |  Branch (329:9): [True: 66, False: 23.0k]
  ------------------
  330|     66|       flags |= DAV1D_EVENT_FLAG_NEW_OP_PARAMS_INFO;
  331|       |
  332|  23.0k|    return flags;
  333|  53.9k|}
picture.c:picture_alloc:
  117|   258k|{
  118|   258k|    if (p->data[0]) {
  ------------------
  |  Branch (118:9): [True: 0, False: 258k]
  ------------------
  119|      0|        dav1d_log(c, "Picture already allocated!\n");
  ------------------
  |  |   44|      0|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 0]
  |  |  ------------------
  ------------------
  120|      0|        return -1;
  121|      0|    }
  122|   258k|    assert(bpc > 0 && bpc <= 16);
  ------------------
  |  Branch (122:5): [True: 258k, False: 0]
  |  Branch (122:5): [True: 258k, False: 0]
  ------------------
  123|       |
  124|   258k|    size_t extra = c->n_fc > 1 ? sizeof(atomic_int) * 2 : 0;
  ------------------
  |  Branch (124:20): [True: 258k, False: 0]
  ------------------
  125|   258k|    struct pic_ctx_context *pic_ctx = dav1d_mem_pool_pop(c->pic_ctx_pool, extra +
  126|   258k|                                                         sizeof(struct pic_ctx_context));
  127|   258k|    if (!pic_ctx)
  ------------------
  |  Branch (127:9): [True: 0, False: 258k]
  ------------------
  128|      0|        return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  129|       |
  130|   258k|    p->p.w = w;
  131|   258k|    p->p.h = h;
  132|   258k|    p->seq_hdr = seq_hdr;
  133|   258k|    p->frame_hdr = frame_hdr;
  134|   258k|    p->p.layout = seq_hdr->layout;
  135|   258k|    p->p.bpc = bpc;
  136|   258k|    dav1d_data_props_set_defaults(&p->m);
  137|   258k|    const int res = p_allocator->alloc_picture_callback(p, p_allocator->cookie);
  138|   258k|    if (res < 0) {
  ------------------
  |  Branch (138:9): [True: 0, False: 258k]
  ------------------
  139|      0|        dav1d_mem_pool_push(c->pic_ctx_pool, pic_ctx);
  140|      0|        return res;
  141|      0|    }
  142|       |
  143|   258k|    pic_ctx->allocator = *p_allocator;
  144|   258k|    pic_ctx->pic = *p;
  145|   258k|    p->ref = dav1d_ref_init(&pic_ctx->ref, pic_ctx, free_buffer, c->pic_ctx_pool, 0);
  146|       |
  147|   258k|    p->seq_hdr_ref = seq_hdr_ref;
  148|   258k|    if (seq_hdr_ref) dav1d_ref_inc(seq_hdr_ref);
  ------------------
  |  Branch (148:9): [True: 258k, False: 0]
  ------------------
  149|       |
  150|   258k|    p->frame_hdr_ref = frame_hdr_ref;
  151|   258k|    if (frame_hdr_ref) dav1d_ref_inc(frame_hdr_ref);
  ------------------
  |  Branch (151:9): [True: 258k, False: 0]
  ------------------
  152|       |
  153|   258k|    if (extra && extra_ptr)
  ------------------
  |  Branch (153:9): [True: 258k, False: 0]
  |  Branch (153:18): [True: 216k, False: 41.9k]
  ------------------
  154|   216k|        *extra_ptr = &pic_ctx->extra_data;
  155|       |
  156|   258k|    return 0;
  157|   258k|}
picture.c:free_buffer:
   91|   258k|static void free_buffer(const uint8_t *const data, void *const user_data) {
   92|   258k|    struct pic_ctx_context *pic_ctx = (struct pic_ctx_context*)data;
   93|       |
   94|   258k|    pic_ctx->allocator.release_picture_callback(&pic_ctx->pic,
   95|   258k|                                                pic_ctx->allocator.cookie);
   96|   258k|    dav1d_mem_pool_push(user_data, pic_ctx);
   97|   258k|}

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_read_coef_blocks_8bpc:
  826|  5.93M|{
  827|  5.93M|    const Dav1dFrameContext *const f = t->f;
  828|  5.93M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  829|  5.93M|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  830|  5.93M|    const int bx4 = t->bx & 31, by4 = t->by & 31;
  831|  5.93M|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
  832|  5.93M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  833|  5.93M|    const int bw4 = b_dim[0], bh4 = b_dim[1];
  834|  5.93M|    const int cbw4 = (bw4 + ss_hor) >> ss_hor, cbh4 = (bh4 + ss_ver) >> ss_ver;
  835|  5.93M|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (835:28): [True: 4.75M, False: 1.18M]
  ------------------
  836|  4.75M|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (836:29): [True: 4.35M, False: 398k]
  |  Branch (836:45): [True: 196k, False: 201k]
  ------------------
  837|  4.56M|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (837:29): [True: 4.28M, False: 279k]
  |  Branch (837:45): [True: 138k, False: 140k]
  ------------------
  838|       |
  839|  5.93M|    if (b->skip) {
  ------------------
  |  Branch (839:9): [True: 2.89M, False: 3.04M]
  ------------------
  840|  2.89M|        BlockContext *const a = t->a;
  841|  2.89M|        dav1d_memset_pow2[b_dim[2]](&a->lcoef[bx4], 0x40);
  842|  2.89M|        dav1d_memset_pow2[b_dim[3]](&t->l.lcoef[by4], 0x40);
  843|  2.89M|        if (has_chroma) {
  ------------------
  |  Branch (843:13): [True: 1.78M, False: 1.10M]
  ------------------
  844|  1.78M|            dav1d_memset_pow2_fn memset_cw = dav1d_memset_pow2[ulog2(cbw4)];
  845|  1.78M|            dav1d_memset_pow2_fn memset_ch = dav1d_memset_pow2[ulog2(cbh4)];
  846|  1.78M|            memset_cw(&a->ccoef[0][cbx4], 0x40);
  847|  1.78M|            memset_cw(&a->ccoef[1][cbx4], 0x40);
  848|  1.78M|            memset_ch(&t->l.ccoef[0][cby4], 0x40);
  849|  1.78M|            memset_ch(&t->l.ccoef[1][cby4], 0x40);
  850|  1.78M|        }
  851|  2.89M|        return;
  852|  2.89M|    }
  853|       |
  854|  3.04M|    Dav1dTileState *const ts = t->ts;
  855|  3.04M|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
  856|  3.04M|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
  857|  3.04M|    assert(t->frame_thread.pass == 1);
  ------------------
  |  Branch (857:5): [True: 3.10M, False: 18.4E]
  ------------------
  858|  3.10M|    assert(!b->skip);
  ------------------
  |  Branch (858:5): [True: 3.10M, False: 18.4E]
  ------------------
  859|  3.10M|    const TxfmInfo *const uv_t_dim = &dav1d_txfm_dimensions[b->uvtx];
  860|  3.10M|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[b->intra ? b->tx : b->max_ytx];
  ------------------
  |  Branch (860:58): [True: 2.40M, False: 696k]
  ------------------
  861|  3.10M|    const uint16_t tx_split[2] = { b->tx_split0, b->tx_split1 };
  862|       |
  863|  6.26M|    for (int init_y = 0; init_y < h4; init_y += 16) {
  ------------------
  |  Branch (863:26): [True: 3.16M, False: 3.10M]
  ------------------
  864|  3.16M|        const int sub_h4 = imin(h4, 16 + init_y);
  865|  6.40M|        for (int init_x = 0; init_x < w4; init_x += 16) {
  ------------------
  |  Branch (865:30): [True: 3.24M, False: 3.16M]
  ------------------
  866|  3.24M|            const int sub_w4 = imin(w4, init_x + 16);
  867|  3.24M|            int y_off = !!init_y, y, x;
  868|  6.62M|            for (y = init_y, t->by += init_y; y < sub_h4;
  ------------------
  |  Branch (868:47): [True: 3.37M, False: 3.24M]
  ------------------
  869|  3.37M|                 y += t_dim->h, t->by += t_dim->h, y_off++)
  870|  3.37M|            {
  871|  3.37M|                int x_off = !!init_x;
  872|  7.34M|                for (x = init_x, t->bx += init_x; x < sub_w4;
  ------------------
  |  Branch (872:51): [True: 3.97M, False: 3.37M]
  ------------------
  873|  3.97M|                     x += t_dim->w, t->bx += t_dim->w, x_off++)
  874|  3.97M|                {
  875|  3.97M|                    if (!b->intra) {
  ------------------
  |  Branch (875:25): [True: 863k, False: 3.10M]
  ------------------
  876|   863k|                        read_coef_tree(t, bs, b, b->max_ytx, 0, tx_split,
  877|   863k|                                       x_off, y_off, NULL);
  878|  3.10M|                    } else {
  879|  3.10M|                        uint8_t cf_ctx = 0x40;
  880|  3.10M|                        enum TxfmType txtp;
  881|  3.10M|                        const int eob =
  882|  3.10M|                            decode_coefs(t, &t->a->lcoef[bx4 + x],
  883|  3.10M|                                         &t->l.lcoef[by4 + y], b->tx, bs, b, 1,
  884|  3.10M|                                         0, ts->frame_thread[1].cf, &txtp, &cf_ctx);
  885|  3.10M|                        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  3.10M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 3.10M]
  |  |  ------------------
  |  |   35|  3.10M|        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.10M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  886|      0|                            printf("Post-y-cf-blk[tx=%d,txtp=%d,eob=%d]: r=%d\n",
  887|      0|                                   b->tx, txtp, eob, ts->msac.rng);
  888|  3.10M|                        *ts->frame_thread[1].cbi++ = eob * (1 << 5) + txtp;
  889|  3.10M|                        ts->frame_thread[1].cf += imin(t_dim->w, 8) * imin(t_dim->h, 8) * 16;
  890|  3.10M|                        dav1d_memset_likely_pow2(&t->a->lcoef[bx4 + x], cf_ctx, imin(t_dim->w, f->bw - t->bx));
  891|  3.10M|                        dav1d_memset_likely_pow2(&t->l.lcoef[by4 + y], cf_ctx, imin(t_dim->h, f->bh - t->by));
  892|  3.10M|                    }
  893|  3.97M|                }
  894|  3.37M|                t->bx -= x;
  895|  3.37M|            }
  896|  3.24M|            t->by -= y;
  897|       |
  898|  3.24M|            if (!has_chroma) continue;
  ------------------
  |  Branch (898:17): [True: 434k, False: 2.81M]
  ------------------
  899|       |
  900|  2.81M|            const int sub_ch4 = imin(ch4, (init_y + 16) >> ss_ver);
  901|  2.81M|            const int sub_cw4 = imin(cw4, (init_x + 16) >> ss_hor);
  902|  8.21M|            for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (902:30): [True: 5.40M, False: 2.81M]
  ------------------
  903|  11.2M|                for (y = init_y >> ss_ver, t->by += init_y; y < sub_ch4;
  ------------------
  |  Branch (903:61): [True: 5.83M, False: 5.40M]
  ------------------
  904|  5.83M|                     y += uv_t_dim->h, t->by += uv_t_dim->h << ss_ver)
  905|  5.83M|                {
  906|  12.6M|                    for (x = init_x >> ss_hor, t->bx += init_x; x < sub_cw4;
  ------------------
  |  Branch (906:65): [True: 6.82M, False: 5.83M]
  ------------------
  907|  6.82M|                         x += uv_t_dim->w, t->bx += uv_t_dim->w << ss_hor)
  908|  6.82M|                    {
  909|  6.82M|                        uint8_t cf_ctx = 0x40;
  910|  6.82M|                        enum TxfmType txtp;
  911|  6.82M|                        if (!b->intra)
  ------------------
  |  Branch (911:29): [True: 1.27M, False: 5.54M]
  ------------------
  912|  1.27M|                            txtp = t->scratch.txtp_map[(by4 + (y << ss_ver)) * 32 +
  913|  1.27M|                                                        bx4 + (x << ss_hor)];
  914|  6.82M|                        const int eob =
  915|  6.82M|                            decode_coefs(t, &t->a->ccoef[pl][cbx4 + x],
  916|  6.82M|                                         &t->l.ccoef[pl][cby4 + y], b->uvtx, bs,
  917|  6.82M|                                         b, b->intra, 1 + pl, ts->frame_thread[1].cf,
  918|  6.82M|                                         &txtp, &cf_ctx);
  919|  6.82M|                        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  6.82M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 6.82M]
  |  |  ------------------
  |  |   35|  6.82M|        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|  6.82M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  920|      0|                            printf("Post-uv-cf-blk[pl=%d,tx=%d,"
  921|      0|                                   "txtp=%d,eob=%d]: r=%d\n",
  922|      0|                                   pl, b->uvtx, txtp, eob, ts->msac.rng);
  923|  6.82M|                        *ts->frame_thread[1].cbi++ = eob * (1 << 5) + txtp;
  924|  6.82M|                        ts->frame_thread[1].cf += uv_t_dim->w * uv_t_dim->h * 16;
  925|  6.82M|                        int ctw = imin(uv_t_dim->w, (f->bw - t->bx + ss_hor) >> ss_hor);
  926|  6.82M|                        int cth = imin(uv_t_dim->h, (f->bh - t->by + ss_ver) >> ss_ver);
  927|  6.82M|                        dav1d_memset_likely_pow2(&t->a->ccoef[pl][cbx4 + x], cf_ctx, ctw);
  928|  6.82M|                        dav1d_memset_likely_pow2(&t->l.ccoef[pl][cby4 + y], cf_ctx, cth);
  929|  6.82M|                    }
  930|  5.83M|                    t->bx -= x << ss_hor;
  931|  5.83M|                }
  932|  5.40M|                t->by -= y << ss_ver;
  933|  5.40M|            }
  934|  2.81M|        }
  935|  3.16M|    }
  936|  3.10M|}
dav1d_recon_b_intra_8bpc:
 1179|   704k|{
 1180|   704k|    Dav1dTileState *const ts = t->ts;
 1181|   704k|    const Dav1dFrameContext *const f = t->f;
 1182|   704k|    const Dav1dDSPContext *const dsp = f->dsp;
 1183|   704k|    const int bx4 = t->bx & 31, by4 = t->by & 31;
 1184|   704k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1185|   704k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 1186|   704k|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
 1187|   704k|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
 1188|   704k|    const int bw4 = b_dim[0], bh4 = b_dim[1];
 1189|   704k|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
 1190|   704k|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
 1191|   704k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (1191:28): [True: 484k, False: 220k]
  ------------------
 1192|   484k|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (1192:29): [True: 371k, False: 112k]
  |  Branch (1192:45): [True: 58.0k, False: 54.7k]
  ------------------
 1193|   430k|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (1193:29): [True: 338k, False: 92.0k]
  |  Branch (1193:45): [True: 46.9k, False: 45.1k]
  ------------------
 1194|   704k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[b->tx];
 1195|   704k|    const TxfmInfo *const uv_t_dim = &dav1d_txfm_dimensions[b->uvtx];
 1196|       |
 1197|       |    // coefficient coding
 1198|   704k|    pixel *const edge = bitfn(t->scratch.edge) + 128;
  ------------------
  |  |   51|   704k|#define bitfn(x) x##_8bpc
  ------------------
 1199|   704k|    const int cbw4 = (bw4 + ss_hor) >> ss_hor, cbh4 = (bh4 + ss_ver) >> ss_ver;
 1200|       |
 1201|   704k|    const int intra_edge_filter_flag = f->seq_hdr->intra_edge_filter << 10;
 1202|       |
 1203|  1.50M|    for (int init_y = 0; init_y < h4; init_y += 16) {
  ------------------
  |  Branch (1203:26): [True: 784k, False: 716k]
  ------------------
 1204|   784k|        const int sub_h4 = imin(h4, 16 + init_y);
 1205|   784k|        const int sub_ch4 = imin(ch4, (init_y + 16) >> ss_ver);
 1206|  1.72M|        for (int init_x = 0; init_x < w4; init_x += 16) {
  ------------------
  |  Branch (1206:30): [True: 930k, False: 795k]
  ------------------
 1207|   930k|            if (b->pal_sz[0]) {
  ------------------
  |  Branch (1207:17): [True: 15.1k, False: 914k]
  ------------------
 1208|  15.1k|                pixel *dst = ((pixel *) f->cur.data[0]) +
 1209|  15.1k|                             4 * (t->by * PXSTRIDE(f->cur.stride[0]) + t->bx);
  ------------------
  |  |   53|  15.1k|#define PXSTRIDE(x) (x)
  ------------------
 1210|  15.1k|                const uint8_t *pal_idx;
 1211|  15.1k|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (1211:21): [True: 15.1k, False: 0]
  ------------------
 1212|  15.1k|                    const int p = t->frame_thread.pass & 1;
 1213|  15.1k|                    assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  Branch (1213:21): [True: 15.1k, False: 0]
  ------------------
 1214|  15.1k|                    pal_idx = ts->frame_thread[p].pal_idx;
 1215|  15.1k|                    ts->frame_thread[p].pal_idx += bw4 * bh4 * 8;
 1216|  15.1k|                } else {
 1217|      0|                    pal_idx = t->scratch.pal_idx_y;
 1218|      0|                }
 1219|  15.1k|                const pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (1219:42): [True: 15.1k, False: 0]
  ------------------
 1220|  15.1k|                    f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 1221|  15.1k|                                        ((t->bx >> 1) + (t->by & 1))][0] :
 1222|  15.1k|                    bytefn(t->scratch.pal)[0];
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  15.1k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1223|  15.1k|                f->dsp->ipred.pal_pred(dst, f->cur.stride[0], pal,
 1224|  15.1k|                                       pal_idx, bw4 * 4, bh4 * 4);
 1225|  15.1k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|  15.1k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 15.1k]
  |  |  ------------------
  |  |   35|  15.1k|        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.1k|        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|  15.1k|            }
 1229|       |
 1230|   930k|            const int intra_flags = (sm_flag(t->a, bx4) |
 1231|   930k|                                     sm_flag(&t->l, by4) |
 1232|   930k|                                     intra_edge_filter_flag);
 1233|   930k|            const int sb_has_tr = init_x + 16 < w4 ? 1 : init_y ? 0 :
  ------------------
  |  Branch (1233:35): [True: 147k, False: 782k]
  |  Branch (1233:58): [True: 78.2k, False: 704k]
  ------------------
 1234|   782k|                              intra_edge_flags & EDGE_I444_TOP_HAS_RIGHT;
 1235|   930k|            const int sb_has_bl = init_x ? 0 : init_y + 16 < h4 ? 1 :
  ------------------
  |  Branch (1235:35): [True: 147k, False: 782k]
  |  Branch (1235:48): [True: 78.2k, False: 704k]
  ------------------
 1236|   782k|                              intra_edge_flags & EDGE_I444_LEFT_HAS_BOTTOM;
 1237|   930k|            int y, x;
 1238|   930k|            const int sub_w4 = imin(w4, init_x + 16);
 1239|  2.32M|            for (y = init_y, t->by += init_y; y < sub_h4;
  ------------------
  |  Branch (1239:47): [True: 1.38M, False: 936k]
  ------------------
 1240|  1.39M|                 y += t_dim->h, t->by += t_dim->h)
 1241|  1.38M|            {
 1242|  1.38M|                pixel *dst = ((pixel *) f->cur.data[0]) +
 1243|  1.38M|                               4 * (t->by * PXSTRIDE(f->cur.stride[0]) +
  ------------------
  |  |   53|  1.38M|#define PXSTRIDE(x) (x)
  ------------------
 1244|  1.38M|                                    t->bx + init_x);
 1245|  6.73M|                for (x = init_x, t->bx += init_x; x < sub_w4;
  ------------------
  |  Branch (1245:51): [True: 5.34M, False: 1.39M]
  ------------------
 1246|  5.35M|                     x += t_dim->w, t->bx += t_dim->w)
 1247|  5.34M|                {
 1248|  5.34M|                    if (b->pal_sz[0]) goto skip_y_pred;
  ------------------
  |  Branch (1248:25): [True: 16.5k, False: 5.33M]
  ------------------
 1249|       |
 1250|  5.33M|                    int angle = b->y_angle;
 1251|  5.33M|                    const enum EdgeFlags edge_flags =
 1252|  5.33M|                        (((y > init_y || !sb_has_tr) && (x + t_dim->w >= sub_w4)) ?
  ------------------
  |  Branch (1252:28): [True: 4.08M, False: 1.24M]
  |  Branch (1252:42): [True: 315k, False: 930k]
  |  Branch (1252:57): [True: 707k, False: 3.70M]
  ------------------
 1253|  4.63M|                             0 : EDGE_I444_TOP_HAS_RIGHT) |
 1254|  5.33M|                        ((x > init_x || (!sb_has_bl && y + t_dim->h >= sub_h4)) ?
  ------------------
  |  Branch (1254:27): [True: 3.96M, False: 1.36M]
  |  Branch (1254:42): [True: 1.01M, False: 354k]
  |  Branch (1254:56): [True: 655k, False: 358k]
  ------------------
 1255|  4.62M|                             0 : EDGE_I444_LEFT_HAS_BOTTOM);
 1256|  5.33M|                    const pixel *top_sb_edge = NULL;
 1257|  5.33M|                    if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1257:25): [True: 560k, False: 4.77M]
  ------------------
 1258|   560k|                        top_sb_edge = f->ipred_edge[0];
 1259|   560k|                        const int sby = t->by >> f->sb_shift;
 1260|   560k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1261|   560k|                    }
 1262|  5.33M|                    const enum IntraPredMode m =
 1263|  5.33M|                        bytefn(dav1d_prepare_intra_edges)(t->bx,
  ------------------
  |  |   87|  5.33M|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  5.33M|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1264|  5.33M|                                                          t->bx > ts->tiling.col_start,
 1265|  5.33M|                                                          t->by,
 1266|  5.33M|                                                          t->by > ts->tiling.row_start,
 1267|  5.33M|                                                          ts->tiling.col_end,
 1268|  5.33M|                                                          ts->tiling.row_end,
 1269|  5.33M|                                                          edge_flags, dst,
 1270|  5.33M|                                                          f->cur.stride[0], top_sb_edge,
 1271|  5.33M|                                                          b->y_mode, &angle,
 1272|  5.33M|                                                          t_dim->w, t_dim->h,
 1273|  5.33M|                                                          f->seq_hdr->intra_edge_filter,
 1274|  5.33M|                                                          edge HIGHBD_CALL_SUFFIX);
 1275|  5.33M|                    dsp->ipred.intra_pred[m](dst, f->cur.stride[0], edge,
 1276|  5.33M|                                             t_dim->w * 4, t_dim->h * 4,
 1277|  5.33M|                                             angle | intra_flags,
 1278|  5.33M|                                             4 * f->bw - 4 * t->bx,
 1279|  5.33M|                                             4 * f->bh - 4 * t->by
 1280|  5.33M|                                             HIGHBD_CALL_SUFFIX);
 1281|       |
 1282|  5.33M|                    if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  5.33M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 5.33M]
  |  |  ------------------
  |  |   35|  5.33M|        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.33M|        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|  5.35M|                skip_y_pred: {}
 1293|  5.35M|                    if (!b->skip) {
  ------------------
  |  Branch (1293:25): [True: 575k, False: 4.77M]
  ------------------
 1294|   575k|                        coef *cf;
 1295|   575k|                        int eob;
 1296|   575k|                        enum TxfmType txtp;
 1297|   575k|                        if (t->frame_thread.pass) {
  ------------------
  |  Branch (1297:29): [True: 575k, False: 18.4E]
  ------------------
 1298|   575k|                            const int p = t->frame_thread.pass & 1;
 1299|   575k|                            const int cbi = *ts->frame_thread[p].cbi++;
 1300|   575k|                            cf = ts->frame_thread[p].cf;
 1301|   575k|                            ts->frame_thread[p].cf += imin(t_dim->w, 8) * imin(t_dim->h, 8) * 16;
 1302|   575k|                            eob  = cbi >> 5;
 1303|   575k|                            txtp = cbi & 0x1f;
 1304|  18.4E|                        } else {
 1305|  18.4E|                            uint8_t cf_ctx;
 1306|  18.4E|                            cf = bitfn(t->cf);
  ------------------
  |  |   51|  18.4E|#define bitfn(x) x##_8bpc
  ------------------
 1307|  18.4E|                            eob = decode_coefs(t, &t->a->lcoef[bx4 + x],
 1308|  18.4E|                                               &t->l.lcoef[by4 + y], b->tx, bs,
 1309|  18.4E|                                               b, 1, 0, cf, &txtp, &cf_ctx);
 1310|  18.4E|                            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  18.4E|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 18.4E]
  |  |  ------------------
  |  |   35|  18.4E|        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|  18.4E|        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|  18.4E|                            dav1d_memset_likely_pow2(&t->a->lcoef[bx4 + x], cf_ctx, imin(t_dim->w, f->bw - t->bx));
 1314|  18.4E|                            dav1d_memset_likely_pow2(&t->l.lcoef[by4 + y], cf_ctx, imin(t_dim->h, f->bh - t->by));
 1315|  18.4E|                        }
 1316|   575k|                        if (eob >= 0) {
  ------------------
  |  Branch (1316:29): [True: 412k, False: 163k]
  ------------------
 1317|   412k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   412k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 412k]
  |  |  ------------------
  |  |   35|   412k|        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|   412k|        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|   412k|                            dsp->itx.itxfm_add[b->tx]
 1321|   412k|                                              [txtp](dst,
 1322|   412k|                                                     f->cur.stride[0],
 1323|   412k|                                                     cf, eob HIGHBD_CALL_SUFFIX);
 1324|   412k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   412k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 412k]
  |  |  ------------------
  |  |   35|   412k|        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|   412k|        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|   412k|                        }
 1328|  4.77M|                    } else if (!t->frame_thread.pass) {
  ------------------
  |  Branch (1328:32): [True: 0, False: 4.77M]
  ------------------
 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|  5.35M|                    dst += 4 * t_dim->w;
 1333|  5.35M|                }
 1334|  1.39M|                t->bx -= x;
 1335|  1.39M|            }
 1336|   936k|            t->by -= y;
 1337|       |
 1338|   936k|            if (!has_chroma) continue;
  ------------------
  |  Branch (1338:17): [True: 384k, False: 551k]
  ------------------
 1339|       |
 1340|   551k|            const ptrdiff_t stride = f->cur.stride[1];
 1341|       |
 1342|   551k|            if (b->uv_mode == CFL_PRED) {
  ------------------
  |  Branch (1342:17): [True: 38.1k, False: 513k]
  ------------------
 1343|  38.1k|                assert(!init_x && !init_y);
  ------------------
  |  Branch (1343:17): [True: 38.1k, False: 0]
  |  Branch (1343:17): [True: 38.1k, False: 0]
  ------------------
 1344|       |
 1345|  38.1k|                int16_t *const ac = t->scratch.ac;
 1346|  38.1k|                pixel *y_src = ((pixel *) f->cur.data[0]) + 4 * (t->bx & ~ss_hor) +
 1347|  38.1k|                                 4 * (t->by & ~ss_ver) * PXSTRIDE(f->cur.stride[0]);
  ------------------
  |  |   53|  38.1k|#define PXSTRIDE(x) (x)
  ------------------
 1348|  38.1k|                const ptrdiff_t uv_off = 4 * ((t->bx >> ss_hor) +
 1349|  38.1k|                                              (t->by >> ss_ver) * PXSTRIDE(stride));
  ------------------
  |  |   53|  38.1k|#define PXSTRIDE(x) (x)
  ------------------
 1350|  38.1k|                pixel *const uv_dst[2] = { ((pixel *) f->cur.data[1]) + uv_off,
 1351|  38.1k|                                           ((pixel *) f->cur.data[2]) + uv_off };
 1352|       |
 1353|  38.1k|                const int furthest_r =
 1354|  38.1k|                    ((cw4 << ss_hor) + t_dim->w - 1) & ~(t_dim->w - 1);
 1355|  38.1k|                const int furthest_b =
 1356|  38.1k|                    ((ch4 << ss_ver) + t_dim->h - 1) & ~(t_dim->h - 1);
 1357|  38.1k|                dsp->ipred.cfl_ac[f->cur.p.layout - 1](ac, y_src, f->cur.stride[0],
 1358|  38.1k|                                                         cbw4 - (furthest_r >> ss_hor),
 1359|  38.1k|                                                         cbh4 - (furthest_b >> ss_ver),
 1360|  38.1k|                                                         cbw4 * 4, cbh4 * 4);
 1361|   114k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1361:34): [True: 76.2k, False: 38.1k]
  ------------------
 1362|  76.2k|                    if (!b->cfl_alpha[pl]) continue;
  ------------------
  |  Branch (1362:25): [True: 13.3k, False: 62.8k]
  ------------------
 1363|  62.8k|                    int angle = 0;
 1364|  62.8k|                    const pixel *top_sb_edge = NULL;
 1365|  62.8k|                    if (!((t->by & ~ss_ver) & (f->sb_step - 1))) {
  ------------------
  |  Branch (1365:25): [True: 8.28k, False: 54.6k]
  ------------------
 1366|  8.28k|                        top_sb_edge = f->ipred_edge[pl + 1];
 1367|  8.28k|                        const int sby = t->by >> f->sb_shift;
 1368|  8.28k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1369|  8.28k|                    }
 1370|  62.8k|                    const int xpos = t->bx >> ss_hor, ypos = t->by >> ss_ver;
 1371|  62.8k|                    const int xstart = ts->tiling.col_start >> ss_hor;
 1372|  62.8k|                    const int ystart = ts->tiling.row_start >> ss_ver;
 1373|  62.8k|                    const enum IntraPredMode m =
 1374|  62.8k|                        bytefn(dav1d_prepare_intra_edges)(xpos, xpos > xstart,
  ------------------
  |  |   87|  62.8k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  62.8k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1375|  62.8k|                                                          ypos, ypos > ystart,
 1376|  62.8k|                                                          ts->tiling.col_end >> ss_hor,
 1377|  62.8k|                                                          ts->tiling.row_end >> ss_ver,
 1378|  62.8k|                                                          0, uv_dst[pl], stride,
 1379|  62.8k|                                                          top_sb_edge, DC_PRED, &angle,
 1380|  62.8k|                                                          uv_t_dim->w, uv_t_dim->h, 0,
 1381|  62.8k|                                                          edge HIGHBD_CALL_SUFFIX);
 1382|  62.8k|                    dsp->ipred.cfl_pred[m](uv_dst[pl], stride, edge,
 1383|  62.8k|                                           uv_t_dim->w * 4,
 1384|  62.8k|                                           uv_t_dim->h * 4,
 1385|  62.8k|                                           ac, b->cfl_alpha[pl]
 1386|  62.8k|                                           HIGHBD_CALL_SUFFIX);
 1387|  62.8k|                }
 1388|  38.1k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  38.1k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 38.1k]
  |  |  ------------------
  |  |   35|  38.1k|        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|  38.1k|        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|   513k|            } else if (b->pal_sz[1]) {
  ------------------
  |  Branch (1393:24): [True: 5.13k, False: 508k]
  ------------------
 1394|  5.13k|                const ptrdiff_t uv_dstoff = 4 * ((t->bx >> ss_hor) +
 1395|  5.13k|                                              (t->by >> ss_ver) * PXSTRIDE(f->cur.stride[1]));
  ------------------
  |  |   53|  5.13k|#define PXSTRIDE(x) (x)
  ------------------
 1396|  5.13k|                const pixel (*pal)[8];
 1397|  5.13k|                const uint8_t *pal_idx;
 1398|  5.13k|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (1398:21): [True: 5.13k, False: 0]
  ------------------
 1399|  5.13k|                    const int p = t->frame_thread.pass & 1;
 1400|  5.13k|                    assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  Branch (1400:21): [True: 5.13k, False: 0]
  ------------------
 1401|  5.13k|                    pal = f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 1402|  5.13k|                                              ((t->bx >> 1) + (t->by & 1))];
 1403|  5.13k|                    pal_idx = ts->frame_thread[p].pal_idx;
 1404|  5.13k|                    ts->frame_thread[p].pal_idx += cbw4 * cbh4 * 8;
 1405|  5.13k|                } 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|  5.13k|                f->dsp->ipred.pal_pred(((pixel *) f->cur.data[1]) + uv_dstoff,
 1411|  5.13k|                                       f->cur.stride[1], pal[1],
 1412|  5.13k|                                       pal_idx, cbw4 * 4, cbh4 * 4);
 1413|  5.13k|                f->dsp->ipred.pal_pred(((pixel *) f->cur.data[2]) + uv_dstoff,
 1414|  5.13k|                                       f->cur.stride[1], pal[2],
 1415|  5.13k|                                       pal_idx, cbw4 * 4, cbh4 * 4);
 1416|  5.13k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  5.13k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 5.13k]
  |  |  ------------------
  |  |   35|  5.13k|        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.13k|        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|  5.13k|            }
 1425|       |
 1426|   551k|            const int sm_uv_fl = sm_uv_flag(t->a, cbx4) |
 1427|   551k|                                 sm_uv_flag(&t->l, cby4);
 1428|   551k|            const int uv_sb_has_tr =
 1429|   551k|                ((init_x + 16) >> ss_hor) < cw4 ? 1 : init_y ? 0 :
  ------------------
  |  Branch (1429:17): [True: 105k, False: 446k]
  |  Branch (1429:55): [True: 54.4k, False: 392k]
  ------------------
 1430|   446k|                intra_edge_flags & (EDGE_I420_TOP_HAS_RIGHT >> (f->cur.p.layout - 1));
 1431|   551k|            const int uv_sb_has_bl =
 1432|   551k|                init_x ? 0 : ((init_y + 16) >> ss_ver) < ch4 ? 1 :
  ------------------
  |  Branch (1432:17): [True: 105k, False: 446k]
  |  Branch (1432:30): [True: 54.4k, False: 392k]
  ------------------
 1433|   446k|                intra_edge_flags & (EDGE_I420_LEFT_HAS_BOTTOM >> (f->cur.p.layout - 1));
 1434|   551k|            const int sub_cw4 = imin(cw4, (init_x + 16) >> ss_hor);
 1435|  1.64M|            for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1435:30): [True: 1.08M, False: 556k]
  ------------------
 1436|  2.88M|                for (y = init_y >> ss_ver, t->by += init_y; y < sub_ch4;
  ------------------
  |  Branch (1436:61): [True: 1.78M, False: 1.09M]
  ------------------
 1437|  1.79M|                     y += uv_t_dim->h, t->by += uv_t_dim->h << ss_ver)
 1438|  1.78M|                {
 1439|  1.78M|                    pixel *dst = ((pixel *) f->cur.data[1 + pl]) +
 1440|  1.78M|                                   4 * ((t->by >> ss_ver) * PXSTRIDE(stride) +
  ------------------
  |  |   53|  1.78M|#define PXSTRIDE(x) (x)
  ------------------
 1441|  1.78M|                                        ((t->bx + init_x) >> ss_hor));
 1442|  7.63M|                    for (x = init_x >> ss_hor, t->bx += init_x; x < sub_cw4;
  ------------------
  |  Branch (1442:65): [True: 5.83M, False: 1.79M]
  ------------------
 1443|  5.84M|                         x += uv_t_dim->w, t->bx += uv_t_dim->w << ss_hor)
 1444|  5.83M|                    {
 1445|  5.83M|                        if ((b->uv_mode == CFL_PRED && b->cfl_alpha[pl]) ||
  ------------------
  |  Branch (1445:30): [True: 76.2k, False: 5.76M]
  |  Branch (1445:56): [True: 62.8k, False: 13.3k]
  ------------------
 1446|  5.77M|                            b->pal_sz[1])
  ------------------
  |  Branch (1446:29): [True: 10.5k, False: 5.76M]
  ------------------
 1447|  73.5k|                        {
 1448|  73.5k|                            goto skip_uv_pred;
 1449|  73.5k|                        }
 1450|       |
 1451|  5.76M|                        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|  5.76M|                        const enum EdgeFlags edge_flags =
 1456|  5.76M|                            (((y > (init_y >> ss_ver) || !uv_sb_has_tr) &&
  ------------------
  |  Branch (1456:32): [True: 4.44M, False: 1.32M]
  |  Branch (1456:58): [True: 370k, False: 954k]
  ------------------
 1457|  4.82M|                              (x + uv_t_dim->w >= sub_cw4)) ?
  ------------------
  |  Branch (1457:31): [True: 1.03M, False: 3.78M]
  ------------------
 1458|  4.74M|                                 0 : EDGE_I444_TOP_HAS_RIGHT) |
 1459|  5.76M|                            ((x > (init_x >> ss_hor) ||
  ------------------
  |  Branch (1459:31): [True: 4.04M, False: 1.71M]
  ------------------
 1460|  1.71M|                              (!uv_sb_has_bl && y + uv_t_dim->h >= sub_ch4)) ?
  ------------------
  |  Branch (1460:32): [True: 1.22M, False: 494k]
  |  Branch (1460:49): [True: 671k, False: 550k]
  ------------------
 1461|  4.72M|                                 0 : EDGE_I444_LEFT_HAS_BOTTOM);
 1462|  5.76M|                        const pixel *top_sb_edge = NULL;
 1463|  5.76M|                        if (!((t->by & ~ss_ver) & (f->sb_step - 1))) {
  ------------------
  |  Branch (1463:29): [True: 513k, False: 5.25M]
  ------------------
 1464|   513k|                            top_sb_edge = f->ipred_edge[1 + pl];
 1465|   513k|                            const int sby = t->by >> f->sb_shift;
 1466|   513k|                            top_sb_edge += f->sb128w * 128 * (sby - 1);
 1467|   513k|                        }
 1468|  5.76M|                        const enum IntraPredMode uv_mode =
 1469|  5.76M|                             b->uv_mode == CFL_PRED ? DC_PRED : b->uv_mode;
  ------------------
  |  Branch (1469:30): [True: 13.3k, False: 5.75M]
  ------------------
 1470|  5.76M|                        const int xpos = t->bx >> ss_hor, ypos = t->by >> ss_ver;
 1471|  5.76M|                        const int xstart = ts->tiling.col_start >> ss_hor;
 1472|  5.76M|                        const int ystart = ts->tiling.row_start >> ss_ver;
 1473|  5.76M|                        const enum IntraPredMode m =
 1474|  5.76M|                            bytefn(dav1d_prepare_intra_edges)(xpos, xpos > xstart,
  ------------------
  |  |   87|  5.76M|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  5.76M|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1475|  5.76M|                                                              ypos, ypos > ystart,
 1476|  5.76M|                                                              ts->tiling.col_end >> ss_hor,
 1477|  5.76M|                                                              ts->tiling.row_end >> ss_ver,
 1478|  5.76M|                                                              edge_flags, dst, stride,
 1479|  5.76M|                                                              top_sb_edge, uv_mode,
 1480|  5.76M|                                                              &angle, uv_t_dim->w,
 1481|  5.76M|                                                              uv_t_dim->h,
 1482|  5.76M|                                                              f->seq_hdr->intra_edge_filter,
 1483|  5.76M|                                                              edge HIGHBD_CALL_SUFFIX);
 1484|  5.76M|                        angle |= intra_edge_filter_flag;
 1485|  5.76M|                        dsp->ipred.intra_pred[m](dst, stride, edge,
 1486|  5.76M|                                                 uv_t_dim->w * 4,
 1487|  5.76M|                                                 uv_t_dim->h * 4,
 1488|  5.76M|                                                 angle | sm_uv_fl,
 1489|  5.76M|                                                 (4 * f->bw + ss_hor -
 1490|  5.76M|                                                  4 * (t->bx & ~ss_hor)) >> ss_hor,
 1491|  5.76M|                                                 (4 * f->bh + ss_ver -
 1492|  5.76M|                                                  4 * (t->by & ~ss_ver)) >> ss_ver
 1493|  5.76M|                                                 HIGHBD_CALL_SUFFIX);
 1494|  5.76M|                        if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  5.76M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 5.76M]
  |  |  ------------------
  |  |   35|  5.76M|        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.76M|        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|  5.84M|                    skip_uv_pred: {}
 1505|  5.84M|                        if (!b->skip) {
  ------------------
  |  Branch (1505:29): [True: 574k, False: 5.27M]
  ------------------
 1506|   574k|                            enum TxfmType txtp;
 1507|   574k|                            int eob;
 1508|   574k|                            coef *cf;
 1509|   574k|                            if (t->frame_thread.pass) {
  ------------------
  |  Branch (1509:33): [True: 574k, False: 18.4E]
  ------------------
 1510|   574k|                                const int p = t->frame_thread.pass & 1;
 1511|   574k|                                const int cbi = *ts->frame_thread[p].cbi++;
 1512|   574k|                                cf = ts->frame_thread[p].cf;
 1513|   574k|                                ts->frame_thread[p].cf += uv_t_dim->w * uv_t_dim->h * 16;
 1514|   574k|                                eob  = cbi >> 5;
 1515|   574k|                                txtp = cbi & 0x1f;
 1516|  18.4E|                            } else {
 1517|  18.4E|                                uint8_t cf_ctx;
 1518|  18.4E|                                cf = bitfn(t->cf);
  ------------------
  |  |   51|  18.4E|#define bitfn(x) x##_8bpc
  ------------------
 1519|  18.4E|                                eob = decode_coefs(t, &t->a->ccoef[pl][cbx4 + x],
 1520|  18.4E|                                                   &t->l.ccoef[pl][cby4 + y],
 1521|  18.4E|                                                   b->uvtx, bs, b, 1, 1 + pl, cf,
 1522|  18.4E|                                                   &txtp, &cf_ctx);
 1523|  18.4E|                                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  18.4E|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 18.4E]
  |  |  ------------------
  |  |   35|  18.4E|        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|  18.4E|        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|  18.4E|                                int ctw = imin(uv_t_dim->w, (f->bw - t->bx + ss_hor) >> ss_hor);
 1528|  18.4E|                                int cth = imin(uv_t_dim->h, (f->bh - t->by + ss_ver) >> ss_ver);
 1529|  18.4E|                                dav1d_memset_likely_pow2(&t->a->ccoef[pl][cbx4 + x], cf_ctx, ctw);
 1530|  18.4E|                                dav1d_memset_likely_pow2(&t->l.ccoef[pl][cby4 + y], cf_ctx, cth);
 1531|  18.4E|                            }
 1532|   574k|                            if (eob >= 0) {
  ------------------
  |  Branch (1532:33): [True: 212k, False: 362k]
  ------------------
 1533|   212k|                                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   212k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 212k]
  |  |  ------------------
  |  |   35|   212k|        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|   212k|        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|   212k|                                dsp->itx.itxfm_add[b->uvtx]
 1537|   212k|                                                  [txtp](dst, stride,
 1538|   212k|                                                         cf, eob HIGHBD_CALL_SUFFIX);
 1539|   212k|                                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   212k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 212k]
  |  |  ------------------
  |  |   35|   212k|        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|   212k|        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|   212k|                            }
 1543|  5.27M|                        } else if (!t->frame_thread.pass) {
  ------------------
  |  Branch (1543:36): [True: 0, False: 5.27M]
  ------------------
 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|  5.84M|                        dst += uv_t_dim->w * 4;
 1548|  5.84M|                    }
 1549|  1.79M|                    t->bx -= x << ss_hor;
 1550|  1.79M|                }
 1551|  1.09M|                t->by -= y << ss_ver;
 1552|  1.09M|            }
 1553|   551k|        }
 1554|   784k|    }
 1555|   704k|}
dav1d_recon_b_inter_8bpc:
 1559|  1.49M|{
 1560|  1.49M|    Dav1dTileState *const ts = t->ts;
 1561|  1.49M|    const Dav1dFrameContext *const f = t->f;
 1562|  1.49M|    const Dav1dDSPContext *const dsp = f->dsp;
 1563|  1.49M|    const int bx4 = t->bx & 31, by4 = t->by & 31;
 1564|  1.49M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1565|  1.49M|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 1566|  1.49M|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
 1567|  1.49M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
 1568|  1.49M|    const int bw4 = b_dim[0], bh4 = b_dim[1];
 1569|  1.49M|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
 1570|  1.49M|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (1570:28): [True: 1.03M, False: 455k]
  ------------------
 1571|  1.03M|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (1571:29): [True: 852k, False: 181k]
  |  Branch (1571:45): [True: 89.2k, False: 92.6k]
  ------------------
 1572|   943k|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (1572:29): [True: 837k, False: 105k]
  |  Branch (1572:45): [True: 52.0k, False: 53.8k]
  ------------------
 1573|  1.49M|    const int chr_layout_idx = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I400 ? 0 :
  ------------------
  |  Branch (1573:32): [True: 455k, False: 1.03M]
  ------------------
 1574|  1.49M|                               DAV1D_PIXEL_LAYOUT_I444 - f->cur.p.layout;
 1575|  1.49M|    int res;
 1576|       |
 1577|       |    // prediction
 1578|  1.49M|    const int cbh4 = (bh4 + ss_ver) >> ss_ver, cbw4 = (bw4 + ss_hor) >> ss_hor;
 1579|  1.49M|    pixel *dst = ((pixel *) f->cur.data[0]) +
 1580|  1.49M|        4 * (t->by * PXSTRIDE(f->cur.stride[0]) + t->bx);
  ------------------
  |  |   53|  1.49M|#define PXSTRIDE(x) (x)
  ------------------
 1581|  1.49M|    const ptrdiff_t uvdstoff =
 1582|  1.49M|        4 * ((t->bx >> ss_hor) + (t->by >> ss_ver) * PXSTRIDE(f->cur.stride[1]));
  ------------------
  |  |   53|  1.49M|#define PXSTRIDE(x) (x)
  ------------------
 1583|  1.49M|    if (IS_KEY_OR_INTRA(f->frame_hdr)) {
  ------------------
  |  |   43|  1.49M|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  1.49M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 2.01k, False: 1.48M]
  |  |  ------------------
  ------------------
 1584|       |        // intrabc
 1585|  2.01k|        assert(!f->frame_hdr->super_res.enabled);
  ------------------
  |  Branch (1585:9): [True: 2.01k, False: 0]
  ------------------
 1586|  2.01k|        res = mc(t, dst, NULL, f->cur.stride[0], bw4, bh4, t->bx, t->by, 0,
 1587|  2.01k|                 b->mv[0], &f->sr_cur, 0 /* unused */, FILTER_2D_BILINEAR);
 1588|  2.01k|        if (res) return res;
  ------------------
  |  Branch (1588:13): [True: 0, False: 2.01k]
  ------------------
 1589|  2.62k|        if (has_chroma) for (int pl = 1; pl < 3; pl++) {
  ------------------
  |  Branch (1589:13): [True: 874, False: 1.13k]
  |  Branch (1589:42): [True: 1.74k, False: 874]
  ------------------
 1590|  1.74k|            res = mc(t, ((pixel *)f->cur.data[pl]) + uvdstoff, NULL, f->cur.stride[1],
 1591|  1.74k|                     bw4 << (bw4 == ss_hor), bh4 << (bh4 == ss_ver),
 1592|  1.74k|                     t->bx & ~ss_hor, t->by & ~ss_ver, pl, b->mv[0],
 1593|  1.74k|                     &f->sr_cur, 0 /* unused */, FILTER_2D_BILINEAR);
 1594|  1.74k|            if (res) return res;
  ------------------
  |  Branch (1594:17): [True: 0, False: 1.74k]
  ------------------
 1595|  1.74k|        }
 1596|  1.48M|    } else if (b->comp_type == COMP_INTER_NONE) {
  ------------------
  |  Branch (1596:16): [True: 1.43M, False: 58.3k]
  ------------------
 1597|  1.43M|        const Dav1dThreadPicture *const refp = &f->refp[b->ref[0]];
 1598|  1.43M|        const enum Filter2d filter_2d = b->filter2d;
 1599|       |
 1600|  1.43M|        if (imin(bw4, bh4) > 1 &&
  ------------------
  |  Branch (1600:13): [True: 1.16M, False: 268k]
  ------------------
 1601|  1.16M|            ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (1601:15): [True: 474k, False: 686k]
  |  Branch (1601:44): [True: 174k, False: 300k]
  ------------------
 1602|   991k|             (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (1602:15): [True: 125k, False: 866k]
  |  Branch (1602:44): [True: 121k, False: 3.57k]
  ------------------
 1603|   295k|        {
 1604|   295k|            res = warp_affine(t, dst, NULL, f->cur.stride[0], b_dim, 0, refp,
 1605|   295k|                              b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (1605:31): [True: 121k, False: 174k]
  ------------------
 1606|   295k|                                  &f->frame_hdr->gmv[b->ref[0]]);
 1607|   295k|            if (res) return res;
  ------------------
  |  Branch (1607:17): [True: 0, False: 295k]
  ------------------
 1608|  1.13M|        } else {
 1609|  1.13M|            res = mc(t, dst, NULL, f->cur.stride[0],
 1610|  1.13M|                     bw4, bh4, t->bx, t->by, 0, b->mv[0], refp, b->ref[0], filter_2d);
 1611|  1.13M|            if (res) return res;
  ------------------
  |  Branch (1611:17): [True: 0, False: 1.13M]
  ------------------
 1612|  1.13M|            if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (1612:17): [True: 298k, False: 836k]
  ------------------
 1613|   298k|                res = obmc(t, dst, f->cur.stride[0], b_dim, 0, bx4, by4, w4, h4);
 1614|   298k|                if (res) return res;
  ------------------
  |  Branch (1614:21): [True: 0, False: 298k]
  ------------------
 1615|   298k|            }
 1616|  1.13M|        }
 1617|  1.43M|        if (b->interintra_type) {
  ------------------
  |  Branch (1617:13): [True: 133k, False: 1.29M]
  ------------------
 1618|   133k|            pixel *const tl_edge = bitfn(t->scratch.edge) + 32;
  ------------------
  |  |   51|   133k|#define bitfn(x) x##_8bpc
  ------------------
 1619|   133k|            enum IntraPredMode m = b->interintra_mode == II_SMOOTH_PRED ?
  ------------------
  |  Branch (1619:36): [True: 20.9k, False: 112k]
  ------------------
 1620|   112k|                                   SMOOTH_PRED : b->interintra_mode;
 1621|   133k|            pixel *const tmp = bitfn(t->scratch.interintra);
  ------------------
  |  |   51|   133k|#define bitfn(x) x##_8bpc
  ------------------
 1622|   133k|            int angle = 0;
 1623|   133k|            const pixel *top_sb_edge = NULL;
 1624|   133k|            if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1624:17): [True: 14.6k, False: 118k]
  ------------------
 1625|  14.6k|                top_sb_edge = f->ipred_edge[0];
 1626|  14.6k|                const int sby = t->by >> f->sb_shift;
 1627|  14.6k|                top_sb_edge += f->sb128w * 128 * (sby - 1);
 1628|  14.6k|            }
 1629|   133k|            m = bytefn(dav1d_prepare_intra_edges)(t->bx, t->bx > ts->tiling.col_start,
  ------------------
  |  |   87|   133k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   133k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1630|   133k|                                                  t->by, t->by > ts->tiling.row_start,
 1631|   133k|                                                  ts->tiling.col_end, ts->tiling.row_end,
 1632|   133k|                                                  0, dst, f->cur.stride[0], top_sb_edge,
 1633|   133k|                                                  m, &angle, bw4, bh4, 0, tl_edge
 1634|   133k|                                                  HIGHBD_CALL_SUFFIX);
 1635|   133k|            dsp->ipred.intra_pred[m](tmp, 4 * bw4 * sizeof(pixel),
 1636|   133k|                                     tl_edge, bw4 * 4, bh4 * 4, 0, 0, 0
 1637|   133k|                                     HIGHBD_CALL_SUFFIX);
 1638|   133k|            dsp->mc.blend(dst, f->cur.stride[0], tmp,
 1639|   133k|                          bw4 * 4, bh4 * 4, II_MASK(0, bs, b));
  ------------------
  |  |   83|   133k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   84|   133k|    (size_t)((b)->interintra_type == INTER_INTRA_BLEND ? \
  |  |  ------------------
  |  |  |  Branch (84:14): [True: 99.3k, False: 33.8k]
  |  |  ------------------
  |  |   85|   133k|    dav1d_masks.offsets[c][(bs)-BS_32x32].ii[(b)->interintra_mode] : \
  |  |   86|   133k|    dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
  ------------------
 1640|   133k|        }
 1641|       |
 1642|  1.43M|        if (!has_chroma) goto skip_inter_chroma_pred;
  ------------------
  |  Branch (1642:13): [True: 592k, False: 837k]
  ------------------
 1643|       |
 1644|       |        // sub8x8 derivation
 1645|   837k|        int is_sub8x8 = bw4 == ss_hor || bh4 == ss_ver;
  ------------------
  |  Branch (1645:25): [True: 40.9k, False: 796k]
  |  Branch (1645:42): [True: 13.7k, False: 782k]
  ------------------
 1646|   837k|        refmvs_block *const *r;
 1647|   837k|        if (is_sub8x8) {
  ------------------
  |  Branch (1647:13): [True: 62.9k, False: 774k]
  ------------------
 1648|  62.9k|            assert(ss_hor == 1);
  ------------------
  |  Branch (1648:13): [True: 62.9k, False: 0]
  ------------------
 1649|  62.9k|            r = &t->rt.r[(t->by & 31) + 5];
 1650|  62.9k|            if (bw4 == 1) is_sub8x8 &= r[0][t->bx - 1].ref.ref[0] > 0;
  ------------------
  |  Branch (1650:17): [True: 49.0k, False: 13.8k]
  ------------------
 1651|  62.9k|            if (bh4 == ss_ver) is_sub8x8 &= r[-1][t->bx].ref.ref[0] > 0;
  ------------------
  |  Branch (1651:17): [True: 51.7k, False: 11.1k]
  ------------------
 1652|  62.9k|            if (bw4 == 1 && bh4 == ss_ver)
  ------------------
  |  Branch (1652:17): [True: 49.0k, False: 13.8k]
  |  Branch (1652:29): [True: 37.9k, False: 11.1k]
  ------------------
 1653|  37.9k|                is_sub8x8 &= r[-1][t->bx - 1].ref.ref[0] > 0;
 1654|  62.9k|        }
 1655|       |
 1656|       |        // chroma prediction
 1657|   837k|        if (is_sub8x8) {
  ------------------
  |  Branch (1657:13): [True: 52.3k, False: 785k]
  ------------------
 1658|  52.3k|            assert(ss_hor == 1);
  ------------------
  |  Branch (1658:13): [True: 52.3k, False: 0]
  ------------------
 1659|  52.3k|            ptrdiff_t h_off = 0, v_off = 0;
 1660|  52.3k|            if (bw4 == 1 && bh4 == ss_ver) {
  ------------------
  |  Branch (1660:17): [True: 40.7k, False: 11.6k]
  |  Branch (1660:29): [True: 31.4k, False: 9.26k]
  ------------------
 1661|  94.3k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1661:34): [True: 62.8k, False: 31.4k]
  ------------------
 1662|  62.8k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1663|  62.8k|                             NULL, f->cur.stride[1],
 1664|  62.8k|                             bw4, bh4, t->bx - 1, t->by - 1, 1 + pl,
 1665|  62.8k|                             r[-1][t->bx - 1].mv.mv[0],
 1666|  62.8k|                             &f->refp[r[-1][t->bx - 1].ref.ref[0] - 1],
 1667|  62.8k|                             r[-1][t->bx - 1].ref.ref[0] - 1,
 1668|  62.8k|                             t->frame_thread.pass != 2 ? t->tl_4x4_filter :
  ------------------
  |  Branch (1668:30): [True: 0, False: 62.8k]
  ------------------
 1669|  62.8k|                                 f->frame_thread.b[((t->by - 1) * f->b4_stride) + t->bx - 1].filter2d);
 1670|  62.8k|                    if (res) return res;
  ------------------
  |  Branch (1670:25): [True: 0, False: 62.8k]
  ------------------
 1671|  62.8k|                }
 1672|  31.4k|                v_off = 2 * PXSTRIDE(f->cur.stride[1]);
  ------------------
  |  |   53|  31.4k|#define PXSTRIDE(x) (x)
  ------------------
 1673|  31.4k|                h_off = 2;
 1674|  31.4k|            }
 1675|  52.3k|            if (bw4 == 1) {
  ------------------
  |  Branch (1675:17): [True: 40.7k, False: 11.6k]
  ------------------
 1676|  40.7k|                const enum Filter2d left_filter_2d =
 1677|  40.7k|                    dav1d_filter_2d[t->l.filter[1][by4]][t->l.filter[0][by4]];
 1678|   122k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1678:34): [True: 81.4k, False: 40.7k]
  ------------------
 1679|  81.4k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + v_off, NULL,
 1680|  81.4k|                             f->cur.stride[1], bw4, bh4, t->bx - 1,
 1681|  81.4k|                             t->by, 1 + pl, r[0][t->bx - 1].mv.mv[0],
 1682|  81.4k|                             &f->refp[r[0][t->bx - 1].ref.ref[0] - 1],
 1683|  81.4k|                             r[0][t->bx - 1].ref.ref[0] - 1,
 1684|  81.4k|                             t->frame_thread.pass != 2 ? left_filter_2d :
  ------------------
  |  Branch (1684:30): [True: 0, False: 81.4k]
  ------------------
 1685|  81.4k|                                 f->frame_thread.b[(t->by * f->b4_stride) + t->bx - 1].filter2d);
 1686|  81.4k|                    if (res) return res;
  ------------------
  |  Branch (1686:25): [True: 0, False: 81.4k]
  ------------------
 1687|  81.4k|                }
 1688|  40.7k|                h_off = 2;
 1689|  40.7k|            }
 1690|  52.3k|            if (bh4 == ss_ver) {
  ------------------
  |  Branch (1690:17): [True: 43.0k, False: 9.26k]
  ------------------
 1691|  43.0k|                const enum Filter2d top_filter_2d =
 1692|  43.0k|                    dav1d_filter_2d[t->a->filter[1][bx4]][t->a->filter[0][bx4]];
 1693|   129k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1693:34): [True: 86.1k, False: 43.0k]
  ------------------
 1694|  86.1k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + h_off, NULL,
 1695|  86.1k|                             f->cur.stride[1], bw4, bh4, t->bx, t->by - 1,
 1696|  86.1k|                             1 + pl, r[-1][t->bx].mv.mv[0],
 1697|  86.1k|                             &f->refp[r[-1][t->bx].ref.ref[0] - 1],
 1698|  86.1k|                             r[-1][t->bx].ref.ref[0] - 1,
 1699|  86.1k|                             t->frame_thread.pass != 2 ? top_filter_2d :
  ------------------
  |  Branch (1699:30): [True: 0, False: 86.1k]
  ------------------
 1700|  86.1k|                                 f->frame_thread.b[((t->by - 1) * f->b4_stride) + t->bx].filter2d);
 1701|  86.1k|                    if (res) return res;
  ------------------
  |  Branch (1701:25): [True: 0, False: 86.1k]
  ------------------
 1702|  86.1k|                }
 1703|  43.0k|                v_off = 2 * PXSTRIDE(f->cur.stride[1]);
  ------------------
  |  |   53|  43.0k|#define PXSTRIDE(x) (x)
  ------------------
 1704|  43.0k|            }
 1705|   157k|            for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1705:30): [True: 104k, False: 52.3k]
  ------------------
 1706|   104k|                res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + h_off + v_off, NULL, f->cur.stride[1],
 1707|   104k|                         bw4, bh4, t->bx, t->by, 1 + pl, b->mv[0],
 1708|   104k|                         refp, b->ref[0], filter_2d);
 1709|   104k|                if (res) return res;
  ------------------
  |  Branch (1709:21): [True: 0, False: 104k]
  ------------------
 1710|   104k|            }
 1711|   785k|        } else {
 1712|   785k|            if (imin(cbw4, cbh4) > 1 &&
  ------------------
  |  Branch (1712:17): [True: 397k, False: 387k]
  ------------------
 1713|   397k|                ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (1713:19): [True: 38.8k, False: 358k]
  |  Branch (1713:48): [True: 10.5k, False: 28.3k]
  ------------------
 1714|   386k|                 (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (1714:19): [True: 74.6k, False: 312k]
  |  Branch (1714:48): [True: 73.9k, False: 683]
  ------------------
 1715|  84.5k|            {
 1716|   253k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1716:34): [True: 168k, False: 84.5k]
  ------------------
 1717|   168k|                    res = warp_affine(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff, NULL,
 1718|   168k|                                      f->cur.stride[1], b_dim, 1 + pl, refp,
 1719|   168k|                                      b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (1719:39): [True: 147k, False: 21.1k]
  ------------------
 1720|   168k|                                          &f->frame_hdr->gmv[b->ref[0]]);
 1721|   168k|                    if (res) return res;
  ------------------
  |  Branch (1721:25): [True: 0, False: 168k]
  ------------------
 1722|   168k|                }
 1723|   700k|            } else {
 1724|  2.11M|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1724:34): [True: 1.41M, False: 700k]
  ------------------
 1725|  1.41M|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1726|  1.41M|                             NULL, f->cur.stride[1],
 1727|  1.41M|                             bw4 << (bw4 == ss_hor), bh4 << (bh4 == ss_ver),
 1728|  1.41M|                             t->bx & ~ss_hor, t->by & ~ss_ver,
 1729|  1.41M|                             1 + pl, b->mv[0], refp, b->ref[0], filter_2d);
 1730|  1.41M|                    if (res) return res;
  ------------------
  |  Branch (1730:25): [True: 0, False: 1.41M]
  ------------------
 1731|  1.41M|                    if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (1731:25): [True: 573k, False: 838k]
  ------------------
 1732|   573k|                        res = obmc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1733|   573k|                                   f->cur.stride[1], b_dim, 1 + pl, bx4, by4, w4, h4);
 1734|   573k|                        if (res) return res;
  ------------------
  |  Branch (1734:29): [True: 0, False: 573k]
  ------------------
 1735|   573k|                    }
 1736|  1.41M|                }
 1737|   700k|            }
 1738|   785k|            if (b->interintra_type) {
  ------------------
  |  Branch (1738:17): [True: 131k, False: 654k]
  ------------------
 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|   131k|                const uint8_t *const ii_mask = II_MASK(chr_layout_idx, bs, b);
  ------------------
  |  |   83|   131k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   84|   131k|    (size_t)((b)->interintra_type == INTER_INTRA_BLEND ? \
  |  |  ------------------
  |  |  |  Branch (84:14): [True: 97.7k, False: 33.3k]
  |  |  ------------------
  |  |   85|   131k|    dav1d_masks.offsets[c][(bs)-BS_32x32].ii[(b)->interintra_mode] : \
  |  |   86|   131k|    dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
  ------------------
 1743|       |
 1744|   393k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1744:34): [True: 262k, False: 131k]
  ------------------
 1745|   262k|                    pixel *const tmp = bitfn(t->scratch.interintra);
  ------------------
  |  |   51|   262k|#define bitfn(x) x##_8bpc
  ------------------
 1746|   262k|                    pixel *const tl_edge = bitfn(t->scratch.edge) + 32;
  ------------------
  |  |   51|   262k|#define bitfn(x) x##_8bpc
  ------------------
 1747|   262k|                    enum IntraPredMode m =
 1748|   262k|                        b->interintra_mode == II_SMOOTH_PRED ?
  ------------------
  |  Branch (1748:25): [True: 41.2k, False: 221k]
  ------------------
 1749|   221k|                        SMOOTH_PRED : b->interintra_mode;
 1750|   262k|                    int angle = 0;
 1751|   262k|                    pixel *const uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff;
 1752|   262k|                    const pixel *top_sb_edge = NULL;
 1753|   262k|                    if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1753:25): [True: 28.9k, False: 233k]
  ------------------
 1754|  28.9k|                        top_sb_edge = f->ipred_edge[pl + 1];
 1755|  28.9k|                        const int sby = t->by >> f->sb_shift;
 1756|  28.9k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1757|  28.9k|                    }
 1758|   262k|                    m = bytefn(dav1d_prepare_intra_edges)(t->bx >> ss_hor,
  ------------------
  |  |   87|   262k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   262k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1759|   262k|                                                          (t->bx >> ss_hor) >
 1760|   262k|                                                              (ts->tiling.col_start >> ss_hor),
 1761|   262k|                                                          t->by >> ss_ver,
 1762|   262k|                                                          (t->by >> ss_ver) >
 1763|   262k|                                                              (ts->tiling.row_start >> ss_ver),
 1764|   262k|                                                          ts->tiling.col_end >> ss_hor,
 1765|   262k|                                                          ts->tiling.row_end >> ss_ver,
 1766|   262k|                                                          0, uvdst, f->cur.stride[1],
 1767|   262k|                                                          top_sb_edge, m,
 1768|   262k|                                                          &angle, cbw4, cbh4, 0, tl_edge
 1769|   262k|                                                          HIGHBD_CALL_SUFFIX);
 1770|   262k|                    dsp->ipred.intra_pred[m](tmp, cbw4 * 4 * sizeof(pixel),
 1771|   262k|                                             tl_edge, cbw4 * 4, cbh4 * 4, 0, 0, 0
 1772|   262k|                                             HIGHBD_CALL_SUFFIX);
 1773|   262k|                    dsp->mc.blend(uvdst, f->cur.stride[1], tmp,
 1774|   262k|                                  cbw4 * 4, cbh4 * 4, ii_mask);
 1775|   262k|                }
 1776|   131k|            }
 1777|   785k|        }
 1778|       |
 1779|  1.43M|    skip_inter_chroma_pred: {}
 1780|  1.43M|        t->tl_4x4_filter = filter_2d;
 1781|  1.43M|    } else {
 1782|  58.3k|        const enum Filter2d filter_2d = b->filter2d;
 1783|       |        // Maximum super block size is 128x128
 1784|  58.3k|        int16_t (*tmp)[128 * 128] = t->scratch.compinter;
 1785|  58.3k|        int jnt_weight;
 1786|  58.3k|        uint8_t *const seg_mask = t->scratch.seg_mask;
 1787|  58.3k|        const uint8_t *mask;
 1788|       |
 1789|   177k|        for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1789:25): [True: 119k, False: 58.3k]
  ------------------
 1790|   119k|            const Dav1dThreadPicture *const refp = &f->refp[b->ref[i]];
 1791|       |
 1792|   119k|            if (b->inter_mode == GLOBALMV_GLOBALMV && f->gmv_warp_allowed[b->ref[i]]) {
  ------------------
  |  Branch (1792:17): [True: 5.08k, False: 114k]
  |  Branch (1792:55): [True: 808, False: 4.27k]
  ------------------
 1793|    808|                res = warp_affine(t, NULL, tmp[i], bw4 * 4, b_dim, 0, refp,
 1794|    808|                                  &f->frame_hdr->gmv[b->ref[i]]);
 1795|    808|                if (res) return res;
  ------------------
  |  Branch (1795:21): [True: 0, False: 808]
  ------------------
 1796|   118k|            } else {
 1797|   118k|                res = mc(t, NULL, tmp[i], 0, bw4, bh4, t->bx, t->by, 0,
 1798|   118k|                         b->mv[i], refp, b->ref[i], filter_2d);
 1799|   118k|                if (res) return res;
  ------------------
  |  Branch (1799:21): [True: 0, False: 118k]
  ------------------
 1800|   118k|            }
 1801|   119k|        }
 1802|  58.3k|        switch (b->comp_type) {
  ------------------
  |  Branch (1802:17): [True: 60.3k, False: 18.4E]
  ------------------
 1803|  37.0k|        case COMP_INTER_AVG:
  ------------------
  |  Branch (1803:9): [True: 37.0k, False: 21.3k]
  ------------------
 1804|  37.0k|            dsp->mc.avg(dst, f->cur.stride[0], tmp[0], tmp[1],
 1805|  37.0k|                        bw4 * 4, bh4 * 4 HIGHBD_CALL_SUFFIX);
 1806|  37.0k|            break;
 1807|  7.32k|        case COMP_INTER_WEIGHTED_AVG:
  ------------------
  |  Branch (1807:9): [True: 7.32k, False: 51.0k]
  ------------------
 1808|  7.32k|            jnt_weight = f->jnt_weights[b->ref[0]][b->ref[1]];
 1809|  7.32k|            dsp->mc.w_avg(dst, f->cur.stride[0], tmp[0], tmp[1],
 1810|  7.32k|                          bw4 * 4, bh4 * 4, jnt_weight HIGHBD_CALL_SUFFIX);
 1811|  7.32k|            break;
 1812|  6.46k|        case COMP_INTER_SEG:
  ------------------
  |  Branch (1812:9): [True: 6.46k, False: 51.9k]
  ------------------
 1813|  6.46k|            dsp->mc.w_mask[chr_layout_idx](dst, f->cur.stride[0],
 1814|  6.46k|                                           tmp[b->mask_sign], tmp[!b->mask_sign],
 1815|  6.46k|                                           bw4 * 4, bh4 * 4, seg_mask,
 1816|  6.46k|                                           b->mask_sign HIGHBD_CALL_SUFFIX);
 1817|  6.46k|            mask = seg_mask;
 1818|  6.46k|            break;
 1819|  9.54k|        case COMP_INTER_WEDGE:
  ------------------
  |  Branch (1819:9): [True: 9.54k, False: 48.8k]
  ------------------
 1820|  9.54k|            mask = WEDGE_MASK(0, bs, 0, b->wedge_idx);
  ------------------
  |  |   89|  9.54k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   90|  9.54k|    (size_t)dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
  ------------------
 1821|  9.54k|            dsp->mc.mask(dst, f->cur.stride[0],
 1822|  9.54k|                         tmp[b->mask_sign], tmp[!b->mask_sign],
 1823|  9.54k|                         bw4 * 4, bh4 * 4, mask HIGHBD_CALL_SUFFIX);
 1824|  9.54k|            if (has_chroma)
  ------------------
  |  Branch (1824:17): [True: 9.24k, False: 302]
  ------------------
 1825|  9.24k|                mask = WEDGE_MASK(chr_layout_idx, bs, b->mask_sign, b->wedge_idx);
  ------------------
  |  |   89|  9.24k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   90|  9.24k|    (size_t)dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
  ------------------
 1826|  9.54k|            break;
 1827|  58.3k|        }
 1828|       |
 1829|       |        // chroma
 1830|   163k|        if (has_chroma) for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1830:13): [True: 54.7k, False: 5.37k]
  |  Branch (1830:42): [True: 108k, False: 54.7k]
  ------------------
 1831|   325k|            for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1831:29): [True: 216k, False: 108k]
  ------------------
 1832|   216k|                const Dav1dThreadPicture *const refp = &f->refp[b->ref[i]];
 1833|   216k|                if (b->inter_mode == GLOBALMV_GLOBALMV &&
  ------------------
  |  Branch (1833:21): [True: 8.42k, False: 207k]
  ------------------
 1834|  8.42k|                    imin(cbw4, cbh4) > 1 && f->gmv_warp_allowed[b->ref[i]])
  ------------------
  |  Branch (1834:21): [True: 4.24k, False: 4.17k]
  |  Branch (1834:45): [True: 708, False: 3.53k]
  ------------------
 1835|    708|                {
 1836|    708|                    res = warp_affine(t, NULL, tmp[i], bw4 * 4 >> ss_hor,
 1837|    708|                                      b_dim, 1 + pl,
 1838|    708|                                      refp, &f->frame_hdr->gmv[b->ref[i]]);
 1839|    708|                    if (res) return res;
  ------------------
  |  Branch (1839:25): [True: 0, False: 708]
  ------------------
 1840|   215k|                } else {
 1841|   215k|                    res = mc(t, NULL, tmp[i], 0, bw4, bh4, t->bx, t->by,
 1842|   215k|                             1 + pl, b->mv[i], refp, b->ref[i], filter_2d);
 1843|   215k|                    if (res) return res;
  ------------------
  |  Branch (1843:25): [True: 0, False: 215k]
  ------------------
 1844|   215k|                }
 1845|   216k|            }
 1846|   108k|            pixel *const uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff;
 1847|   108k|            switch (b->comp_type) {
  ------------------
  |  Branch (1847:21): [True: 109k, False: 18.4E]
  ------------------
 1848|  69.3k|            case COMP_INTER_AVG:
  ------------------
  |  Branch (1848:13): [True: 69.3k, False: 39.6k]
  ------------------
 1849|  69.3k|                dsp->mc.avg(uvdst, f->cur.stride[1], tmp[0], tmp[1],
 1850|  69.3k|                            bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver
 1851|  69.3k|                            HIGHBD_CALL_SUFFIX);
 1852|  69.3k|                break;
 1853|  12.6k|            case COMP_INTER_WEIGHTED_AVG:
  ------------------
  |  Branch (1853:13): [True: 12.6k, False: 96.3k]
  ------------------
 1854|  12.6k|                dsp->mc.w_avg(uvdst, f->cur.stride[1], tmp[0], tmp[1],
 1855|  12.6k|                              bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver, jnt_weight
 1856|  12.6k|                              HIGHBD_CALL_SUFFIX);
 1857|  12.6k|                break;
 1858|  18.4k|            case COMP_INTER_WEDGE:
  ------------------
  |  Branch (1858:13): [True: 18.4k, False: 90.5k]
  ------------------
 1859|  27.5k|            case COMP_INTER_SEG:
  ------------------
  |  Branch (1859:13): [True: 9.10k, False: 99.8k]
  ------------------
 1860|  27.5k|                dsp->mc.mask(uvdst, f->cur.stride[1],
 1861|  27.5k|                             tmp[b->mask_sign], tmp[!b->mask_sign],
 1862|  27.5k|                             bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver, mask
 1863|  27.5k|                             HIGHBD_CALL_SUFFIX);
 1864|  27.5k|                break;
 1865|   108k|            }
 1866|   108k|        }
 1867|  60.1k|    }
 1868|       |
 1869|  1.49M|    if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  1.49M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.49M]
  |  |  ------------------
  |  |   35|  1.49M|        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.49M|        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|  1.49M|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
 1880|       |
 1881|  1.49M|    if (b->skip) {
  ------------------
  |  Branch (1881:9): [True: 1.07M, False: 423k]
  ------------------
 1882|       |        // reset coef contexts
 1883|  1.07M|        BlockContext *const a = t->a;
 1884|  1.07M|        dav1d_memset_pow2[b_dim[2]](&a->lcoef[bx4], 0x40);
 1885|  1.07M|        dav1d_memset_pow2[b_dim[3]](&t->l.lcoef[by4], 0x40);
 1886|  1.07M|        if (has_chroma) {
  ------------------
  |  Branch (1886:13): [True: 541k, False: 534k]
  ------------------
 1887|   541k|            dav1d_memset_pow2_fn memset_cw = dav1d_memset_pow2[ulog2(cbw4)];
 1888|   541k|            dav1d_memset_pow2_fn memset_ch = dav1d_memset_pow2[ulog2(cbh4)];
 1889|   541k|            memset_cw(&a->ccoef[0][cbx4], 0x40);
 1890|   541k|            memset_cw(&a->ccoef[1][cbx4], 0x40);
 1891|   541k|            memset_ch(&t->l.ccoef[0][cby4], 0x40);
 1892|   541k|            memset_ch(&t->l.ccoef[1][cby4], 0x40);
 1893|   541k|        }
 1894|  1.07M|        return 0;
 1895|  1.07M|    }
 1896|       |
 1897|   423k|    const TxfmInfo *const uvtx = &dav1d_txfm_dimensions[b->uvtx];
 1898|   423k|    const TxfmInfo *const ytx = &dav1d_txfm_dimensions[b->max_ytx];
 1899|   423k|    const uint16_t tx_split[2] = { b->tx_split0, b->tx_split1 };
 1900|       |
 1901|   851k|    for (int init_y = 0; init_y < bh4; init_y += 16) {
  ------------------
  |  Branch (1901:26): [True: 427k, False: 423k]
  ------------------
 1902|   860k|        for (int init_x = 0; init_x < bw4; init_x += 16) {
  ------------------
  |  Branch (1902:30): [True: 432k, False: 427k]
  ------------------
 1903|       |            // coefficient coding & inverse transforms
 1904|   432k|            int y_off = !!init_y, y;
 1905|   432k|            dst += PXSTRIDE(f->cur.stride[0]) * 4 * init_y;
  ------------------
  |  |   53|   432k|#define PXSTRIDE(x) (x)
  ------------------
 1906|   872k|            for (y = init_y, t->by += init_y; y < imin(h4, init_y + 16);
  ------------------
  |  Branch (1906:47): [True: 440k, False: 432k]
  ------------------
 1907|   440k|                 y += ytx->h, y_off++)
 1908|   440k|            {
 1909|   440k|                int x, x_off = !!init_x;
 1910|   890k|                for (x = init_x, t->bx += init_x; x < imin(w4, init_x + 16);
  ------------------
  |  Branch (1910:51): [True: 450k, False: 440k]
  ------------------
 1911|   450k|                     x += ytx->w, x_off++)
 1912|   450k|                {
 1913|   450k|                    read_coef_tree(t, bs, b, b->max_ytx, 0, tx_split,
 1914|   450k|                                   x_off, y_off, &dst[x * 4]);
 1915|   450k|                    t->bx += ytx->w;
 1916|   450k|                }
 1917|   440k|                dst += PXSTRIDE(f->cur.stride[0]) * 4 * ytx->h;
  ------------------
  |  |   53|   440k|#define PXSTRIDE(x) (x)
  ------------------
 1918|   440k|                t->bx -= x;
 1919|   440k|                t->by += ytx->h;
 1920|   440k|            }
 1921|   432k|            dst -= PXSTRIDE(f->cur.stride[0]) * 4 * y;
  ------------------
  |  |   53|   432k|#define PXSTRIDE(x) (x)
  ------------------
 1922|   432k|            t->by -= y;
 1923|       |
 1924|       |            // chroma coefs and inverse transform
 1925|  1.09M|            if (has_chroma) for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1925:17): [True: 364k, False: 68.2k]
  |  Branch (1925:46): [True: 727k, False: 364k]
  ------------------
 1926|   727k|                pixel *uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff +
 1927|   727k|                    (PXSTRIDE(f->cur.stride[1]) * init_y * 4 >> ss_ver);
  ------------------
  |  |   53|   727k|#define PXSTRIDE(x) (x)
  ------------------
 1928|   727k|                for (y = init_y >> ss_ver, t->by += init_y;
 1929|  1.46M|                     y < imin(ch4, (init_y + 16) >> ss_ver); y += uvtx->h)
  ------------------
  |  Branch (1929:22): [True: 734k, False: 727k]
  ------------------
 1930|   734k|                {
 1931|   734k|                    int x;
 1932|   734k|                    for (x = init_x >> ss_hor, t->bx += init_x;
 1933|  1.47M|                         x < imin(cw4, (init_x + 16) >> ss_hor); x += uvtx->w)
  ------------------
  |  Branch (1933:26): [True: 736k, False: 734k]
  ------------------
 1934|   736k|                    {
 1935|   736k|                        coef *cf;
 1936|   736k|                        int eob;
 1937|   736k|                        enum TxfmType txtp;
 1938|   736k|                        if (t->frame_thread.pass) {
  ------------------
  |  Branch (1938:29): [True: 736k, False: 18.4E]
  ------------------
 1939|   736k|                            const int p = t->frame_thread.pass & 1;
 1940|   736k|                            const int cbi = *ts->frame_thread[p].cbi++;
 1941|   736k|                            cf = ts->frame_thread[p].cf;
 1942|   736k|                            ts->frame_thread[p].cf += uvtx->w * uvtx->h * 16;
 1943|   736k|                            eob  = cbi >> 5;
 1944|   736k|                            txtp = cbi & 0x1f;
 1945|  18.4E|                        } else {
 1946|  18.4E|                            uint8_t cf_ctx;
 1947|  18.4E|                            cf = bitfn(t->cf);
  ------------------
  |  |   51|  18.4E|#define bitfn(x) x##_8bpc
  ------------------
 1948|  18.4E|                            txtp = t->scratch.txtp_map[(by4 + (y << ss_ver)) * 32 +
 1949|  18.4E|                                                        bx4 + (x << ss_hor)];
 1950|  18.4E|                            eob = decode_coefs(t, &t->a->ccoef[pl][cbx4 + x],
 1951|  18.4E|                                               &t->l.ccoef[pl][cby4 + y],
 1952|  18.4E|                                               b->uvtx, bs, b, 0, 1 + pl,
 1953|  18.4E|                                               cf, &txtp, &cf_ctx);
 1954|  18.4E|                            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  18.4E|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 18.4E]
  |  |  ------------------
  |  |   35|  18.4E|        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|  18.4E|        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|  18.4E|                            int ctw = imin(uvtx->w, (f->bw - t->bx + ss_hor) >> ss_hor);
 1959|  18.4E|                            int cth = imin(uvtx->h, (f->bh - t->by + ss_ver) >> ss_ver);
 1960|  18.4E|                            dav1d_memset_likely_pow2(&t->a->ccoef[pl][cbx4 + x], cf_ctx, ctw);
 1961|  18.4E|                            dav1d_memset_likely_pow2(&t->l.ccoef[pl][cby4 + y], cf_ctx, cth);
 1962|  18.4E|                        }
 1963|   736k|                        if (eob >= 0) {
  ------------------
  |  Branch (1963:29): [True: 202k, False: 533k]
  ------------------
 1964|   202k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   202k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 202k]
  |  |  ------------------
  |  |   35|   202k|        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|   202k|        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|   202k|                            dsp->itx.itxfm_add[b->uvtx]
 1967|   202k|                                              [txtp](&uvdst[4 * x],
 1968|   202k|                                                     f->cur.stride[1],
 1969|   202k|                                                     cf, eob HIGHBD_CALL_SUFFIX);
 1970|   202k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   202k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 202k]
  |  |  ------------------
  |  |   35|   202k|        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|   202k|        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|   202k|                        }
 1974|   736k|                        t->bx += uvtx->w << ss_hor;
 1975|   736k|                    }
 1976|   734k|                    uvdst += PXSTRIDE(f->cur.stride[1]) * 4 * uvtx->h;
  ------------------
  |  |   53|   734k|#define PXSTRIDE(x) (x)
  ------------------
 1977|   734k|                    t->bx -= x << ss_hor;
 1978|   734k|                    t->by += uvtx->h << ss_ver;
 1979|   734k|                }
 1980|   727k|                t->by -= y << ss_ver;
 1981|   727k|            }
 1982|   432k|        }
 1983|   427k|    }
 1984|   423k|    return 0;
 1985|  1.49M|}
dav1d_filter_sbrow_deblock_cols_8bpc:
 1987|   254k|void bytefn(dav1d_filter_sbrow_deblock_cols)(Dav1dFrameContext *const f, const int sby) {
 1988|   254k|    if (!(f->c->inloop_filters & DAV1D_INLOOPFILTER_DEBLOCK) ||
  ------------------
  |  Branch (1988:9): [True: 18.4E, False: 254k]
  ------------------
 1989|   254k|        (!f->frame_hdr->loopfilter.level_y[0] && !f->frame_hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (1989:10): [True: 12.2k, False: 241k]
  |  Branch (1989:50): [True: 0, False: 12.2k]
  ------------------
 1990|      0|    {
 1991|      0|        return;
 1992|      0|    }
 1993|   254k|    const int y = sby * f->sb_step * 4;
 1994|   254k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1995|   254k|    pixel *const p[3] = {
 1996|   254k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|   254k|#define PXSTRIDE(x) (x)
  ------------------
 1997|   254k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|   254k|#define PXSTRIDE(x) (x)
  ------------------
 1998|   254k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
  ------------------
  |  |   53|   254k|#define PXSTRIDE(x) (x)
  ------------------
 1999|   254k|    };
 2000|   254k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2001|   254k|    bytefn(dav1d_loopfilter_sbrow_cols)(f, p, mask, sby,
  ------------------
  |  |   87|   254k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   254k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2002|   254k|                                        f->lf.start_of_tile_row[sby]);
 2003|   254k|}
dav1d_filter_sbrow_deblock_rows_8bpc:
 2005|   263k|void bytefn(dav1d_filter_sbrow_deblock_rows)(Dav1dFrameContext *const f, const int sby) {
 2006|   263k|    const int y = sby * f->sb_step * 4;
 2007|   263k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2008|   263k|    pixel *const p[3] = {
 2009|   263k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|   263k|#define PXSTRIDE(x) (x)
  ------------------
 2010|   263k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|   263k|#define PXSTRIDE(x) (x)
  ------------------
 2011|   263k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
  ------------------
  |  |   53|   263k|#define PXSTRIDE(x) (x)
  ------------------
 2012|   263k|    };
 2013|   263k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2014|   263k|    if (f->c->inloop_filters & DAV1D_INLOOPFILTER_DEBLOCK &&
  ------------------
  |  Branch (2014:9): [True: 263k, False: 11]
  ------------------
 2015|   263k|        (f->frame_hdr->loopfilter.level_y[0] || f->frame_hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (2015:10): [True: 241k, False: 21.6k]
  |  Branch (2015:49): [True: 12.2k, False: 9.44k]
  ------------------
 2016|   254k|    {
 2017|   254k|        bytefn(dav1d_loopfilter_sbrow_rows)(f, p, mask, sby);
  ------------------
  |  |   87|   254k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   254k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2018|   254k|    }
 2019|   263k|    if (f->lf.cdef_planes || f->lf.restore_planes) {
  ------------------
  |  Branch (2019:9): [True: 30.9k, False: 232k]
  |  Branch (2019:30): [True: 101k, False: 131k]
  ------------------
 2020|       |        // Store loop filtered pixels required by CDEF / LR
 2021|   132k|        bytefn(dav1d_copy_lpf)(f, p, sby);
  ------------------
  |  |   87|   132k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   132k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2022|   132k|    }
 2023|   263k|}
dav1d_filter_sbrow_cdef_8bpc:
 2025|  31.0k|void bytefn(dav1d_filter_sbrow_cdef)(Dav1dTaskContext *const tc, const int sby) {
 2026|  31.0k|    const Dav1dFrameContext *const f = tc->f;
 2027|  31.0k|    const int sbsz = f->sb_step;
 2028|  31.0k|    const int y = sby * sbsz * 4;
 2029|  31.0k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2030|  31.0k|    pixel *const p[3] = {
 2031|  31.0k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|  31.0k|#define PXSTRIDE(x) (x)
  ------------------
 2032|  31.0k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  31.0k|#define PXSTRIDE(x) (x)
  ------------------
 2033|  31.0k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
  ------------------
  |  |   53|  31.0k|#define PXSTRIDE(x) (x)
  ------------------
 2034|  31.0k|    };
 2035|  31.0k|    Av1Filter *prev_mask = f->lf.mask + ((sby - 1) >> !f->seq_hdr->sb128) * f->sb128w;
 2036|  31.0k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2037|  31.0k|    const int start = sby * sbsz;
 2038|  31.0k|    if (sby) {
  ------------------
  |  Branch (2038:9): [True: 29.7k, False: 1.24k]
  ------------------
 2039|  29.7k|        const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2040|  29.7k|        pixel *p_up[3] = {
 2041|  29.7k|            p[0] - 8 * PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|  29.7k|#define PXSTRIDE(x) (x)
  ------------------
 2042|  29.7k|            p[1] - (8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  29.7k|#define PXSTRIDE(x) (x)
  ------------------
 2043|  29.7k|            p[2] - (8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  29.7k|#define PXSTRIDE(x) (x)
  ------------------
 2044|  29.7k|        };
 2045|  29.7k|        bytefn(dav1d_cdef_brow)(tc, p_up, prev_mask, start - 2, start, 1, sby);
  ------------------
  |  |   87|  29.7k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  29.7k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2046|  29.7k|    }
 2047|  31.0k|    const int n_blks = sbsz - 2 * (sby + 1 < f->sbh);
 2048|  31.0k|    const int end = imin(start + n_blks, f->bh);
 2049|  31.0k|    bytefn(dav1d_cdef_brow)(tc, p, mask, start, end, 0, sby);
  ------------------
  |  |   87|  31.0k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  31.0k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2050|  31.0k|}
dav1d_filter_sbrow_resize_8bpc:
 2052|  14.2k|void bytefn(dav1d_filter_sbrow_resize)(Dav1dFrameContext *const f, const int sby) {
 2053|  14.2k|    const int sbsz = f->sb_step;
 2054|  14.2k|    const int y = sby * sbsz * 4;
 2055|  14.2k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2056|  14.2k|    const pixel *const p[3] = {
 2057|  14.2k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|  14.2k|#define PXSTRIDE(x) (x)
  ------------------
 2058|  14.2k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  14.2k|#define PXSTRIDE(x) (x)
  ------------------
 2059|  14.2k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
  ------------------
  |  |   53|  14.2k|#define PXSTRIDE(x) (x)
  ------------------
 2060|  14.2k|    };
 2061|  14.2k|    pixel *const sr_p[3] = {
 2062|  14.2k|        f->lf.sr_p[0] + y * PXSTRIDE(f->sr_cur.p.stride[0]),
  ------------------
  |  |   53|  14.2k|#define PXSTRIDE(x) (x)
  ------------------
 2063|  14.2k|        f->lf.sr_p[1] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  14.2k|#define PXSTRIDE(x) (x)
  ------------------
 2064|  14.2k|        f->lf.sr_p[2] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver)
  ------------------
  |  |   53|  14.2k|#define PXSTRIDE(x) (x)
  ------------------
 2065|  14.2k|    };
 2066|  14.2k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400;
 2067|  53.1k|    for (int pl = 0; pl < 1 + 2 * has_chroma; pl++) {
  ------------------
  |  Branch (2067:22): [True: 38.8k, False: 14.2k]
  ------------------
 2068|  38.8k|        const int ss_ver = pl && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (2068:28): [True: 24.6k, False: 14.2k]
  |  Branch (2068:34): [True: 9.57k, False: 15.0k]
  ------------------
 2069|  38.8k|        const int h_start = 8 * !!sby >> ss_ver;
 2070|  38.8k|        const ptrdiff_t dst_stride = f->sr_cur.p.stride[!!pl];
 2071|  38.8k|        pixel *dst = sr_p[pl] - h_start * PXSTRIDE(dst_stride);
  ------------------
  |  |   53|  38.8k|#define PXSTRIDE(x) (x)
  ------------------
 2072|  38.8k|        const ptrdiff_t src_stride = f->cur.stride[!!pl];
 2073|  38.8k|        const pixel *src = p[pl] - h_start * PXSTRIDE(src_stride);
  ------------------
  |  |   53|  38.8k|#define PXSTRIDE(x) (x)
  ------------------
 2074|  38.8k|        const int h_end = 4 * (sbsz - 2 * (sby + 1 < f->sbh)) >> ss_ver;
 2075|  38.8k|        const int ss_hor = pl && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (2075:28): [True: 24.6k, False: 14.2k]
  |  Branch (2075:34): [True: 20.2k, False: 4.41k]
  ------------------
 2076|  38.8k|        const int dst_w = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
 2077|  38.8k|        const int src_w = (4 * f->bw + ss_hor) >> ss_hor;
 2078|  38.8k|        const int img_h = (f->cur.p.h - sbsz * 4 * sby + ss_ver) >> ss_ver;
 2079|       |
 2080|  38.8k|        f->dsp->mc.resize(dst, dst_stride, src, src_stride, dst_w,
 2081|  38.8k|                          imin(img_h, h_end) + h_start, src_w,
 2082|  38.8k|                          f->resize_step[!!pl], f->resize_start[!!pl]
 2083|  38.8k|                          HIGHBD_CALL_SUFFIX);
 2084|  38.8k|    }
 2085|  14.2k|}
dav1d_filter_sbrow_lr_8bpc:
 2087|   106k|void bytefn(dav1d_filter_sbrow_lr)(Dav1dFrameContext *const f, const int sby) {
 2088|   106k|    if (!(f->c->inloop_filters & DAV1D_INLOOPFILTER_RESTORATION)) return;
  ------------------
  |  Branch (2088:9): [True: 0, False: 106k]
  ------------------
 2089|   106k|    const int y = sby * f->sb_step * 4;
 2090|   106k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2091|   106k|    pixel *const sr_p[3] = {
 2092|   106k|        f->lf.sr_p[0] + y * PXSTRIDE(f->sr_cur.p.stride[0]),
  ------------------
  |  |   53|   106k|#define PXSTRIDE(x) (x)
  ------------------
 2093|   106k|        f->lf.sr_p[1] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver),
  ------------------
  |  |   53|   106k|#define PXSTRIDE(x) (x)
  ------------------
 2094|   106k|        f->lf.sr_p[2] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver)
  ------------------
  |  |   53|   106k|#define PXSTRIDE(x) (x)
  ------------------
 2095|   106k|    };
 2096|   106k|    bytefn(dav1d_lr_sbrow)(f, sr_p, sby);
  ------------------
  |  |   87|   106k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   106k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2097|   106k|}
dav1d_backup_ipred_edge_8bpc:
 2110|   473k|void bytefn(dav1d_backup_ipred_edge)(Dav1dTaskContext *const t) {
 2111|   473k|    const Dav1dFrameContext *const f = t->f;
 2112|   473k|    Dav1dTileState *const ts = t->ts;
 2113|   473k|    const int sby = t->by >> f->sb_shift;
 2114|   473k|    const int sby_off = f->sb128w * 128 * sby;
 2115|   473k|    const int x_off = ts->tiling.col_start;
 2116|       |
 2117|   473k|    const pixel *const y =
 2118|   473k|        ((const pixel *) f->cur.data[0]) + x_off * 4 +
 2119|   473k|                    ((t->by + f->sb_step) * 4 - 1) * PXSTRIDE(f->cur.stride[0]);
  ------------------
  |  |   53|   473k|#define PXSTRIDE(x) (x)
  ------------------
 2120|   473k|    pixel_copy(&f->ipred_edge[0][sby_off + x_off * 4], y,
  ------------------
  |  |   47|   473k|#define pixel_copy memcpy
  ------------------
 2121|   473k|               4 * (ts->tiling.col_end - x_off));
 2122|       |
 2123|   473k|    if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (2123:9): [True: 102k, False: 371k]
  ------------------
 2124|   102k|        const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2125|   102k|        const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 2126|       |
 2127|   102k|        const ptrdiff_t uv_off = (x_off * 4 >> ss_hor) +
 2128|   102k|            (((t->by + f->sb_step) * 4 >> ss_ver) - 1) * PXSTRIDE(f->cur.stride[1]);
  ------------------
  |  |   53|   102k|#define PXSTRIDE(x) (x)
  ------------------
 2129|   307k|        for (int pl = 1; pl <= 2; pl++)
  ------------------
  |  Branch (2129:26): [True: 204k, False: 102k]
  ------------------
 2130|   204k|            pixel_copy(&f->ipred_edge[pl][sby_off + (x_off * 4 >> ss_hor)],
  ------------------
  |  |   47|   204k|#define pixel_copy memcpy
  ------------------
 2131|   204k|                       &((const pixel *) f->cur.data[pl])[uv_off],
 2132|   204k|                       4 * (ts->tiling.col_end - x_off) >> ss_hor);
 2133|   102k|    }
 2134|   473k|}
dav1d_copy_pal_block_y_8bpc:
 2140|   120k|{
 2141|   120k|    const Dav1dFrameContext *const f = t->f;
 2142|   120k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2142:24): [True: 121k, False: 18.4E]
  ------------------
 2143|   121k|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2144|   121k|                            ((t->bx >> 1) + (t->by & 1))][0] :
 2145|  18.4E|        bytefn(t->scratch.pal)[0];
  ------------------
  |  |   87|  18.4E|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   120k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2146|   634k|    for (int x = 0; x < bw4; x++)
  ------------------
  |  Branch (2146:21): [True: 513k, False: 120k]
  ------------------
 2147|   513k|        memcpy(bytefn(t->al_pal)[0][bx4 + x][0], pal, 8 * sizeof(pixel));
  ------------------
  |  |   87|   513k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   513k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2148|   514k|    for (int y = 0; y < bh4; y++)
  ------------------
  |  Branch (2148:21): [True: 393k, False: 120k]
  ------------------
 2149|   393k|        memcpy(bytefn(t->al_pal)[1][by4 + y][0], pal, 8 * sizeof(pixel));
  ------------------
  |  |   87|   393k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   393k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2150|   120k|}
dav1d_copy_pal_block_uv_8bpc:
 2156|  21.4k|{
 2157|  21.4k|    const Dav1dFrameContext *const f = t->f;
 2158|  21.4k|    const pixel (*const pal)[8] = t->frame_thread.pass ?
  ------------------
  |  Branch (2158:35): [True: 21.4k, False: 0]
  ------------------
 2159|  21.4k|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2160|  21.4k|                            ((t->bx >> 1) + (t->by & 1))] :
 2161|  21.4k|        bytefn(t->scratch.pal);
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|      0|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2162|       |    // see aomedia bug 2183 for why we use luma coordinates here
 2163|  64.4k|    for (int pl = 1; pl <= 2; pl++) {
  ------------------
  |  Branch (2163:22): [True: 42.9k, False: 21.4k]
  ------------------
 2164|   280k|        for (int x = 0; x < bw4; x++)
  ------------------
  |  Branch (2164:25): [True: 237k, False: 42.9k]
  ------------------
 2165|   237k|            memcpy(bytefn(t->al_pal)[0][bx4 + x][pl], pal[pl], 8 * sizeof(pixel));
  ------------------
  |  |   87|   237k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   237k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2166|   278k|        for (int y = 0; y < bh4; y++)
  ------------------
  |  Branch (2166:25): [True: 235k, False: 42.9k]
  ------------------
 2167|   235k|            memcpy(bytefn(t->al_pal)[1][by4 + y][pl], pal[pl], 8 * sizeof(pixel));
  ------------------
  |  |   87|   235k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   235k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2168|  42.9k|    }
 2169|  21.4k|}
dav1d_read_pal_plane_8bpc:
 2174|   142k|{
 2175|   142k|    Dav1dTileState *const ts = t->ts;
 2176|   142k|    const Dav1dFrameContext *const f = t->f;
 2177|   142k|    const int pal_sz = b->pal_sz[pl] = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|   142k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 2178|   142k|                                           ts->cdf.m.pal_sz[pl][sz_ctx], 6) + 2;
 2179|   142k|    pixel cache[16], used_cache[8];
 2180|   142k|    int l_cache = pl ? t->pal_sz_uv[1][by4] : t->l.pal_sz[by4];
  ------------------
  |  Branch (2180:19): [True: 21.4k, False: 120k]
  ------------------
 2181|   142k|    int n_cache = 0;
 2182|       |    // don't reuse above palette outside SB64 boundaries
 2183|   142k|    int a_cache = by4 & 15 ? pl ? t->pal_sz_uv[0][bx4] : t->a->pal_sz[bx4] : 0;
  ------------------
  |  Branch (2183:19): [True: 114k, False: 27.4k]
  |  Branch (2183:30): [True: 12.7k, False: 102k]
  ------------------
 2184|   142k|    const pixel *l = bytefn(t->al_pal)[1][by4][pl];
  ------------------
  |  |   87|   142k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   142k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2185|   142k|    const pixel *a = bytefn(t->al_pal)[0][bx4][pl];
  ------------------
  |  |   87|   142k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   142k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2186|       |
 2187|       |    // fill/sort cache
 2188|   275k|    while (l_cache && a_cache) {
  ------------------
  |  Branch (2188:12): [True: 176k, False: 99.6k]
  |  Branch (2188:23): [True: 133k, False: 42.7k]
  ------------------
 2189|   133k|        if (*l < *a) {
  ------------------
  |  Branch (2189:13): [True: 39.5k, False: 94.0k]
  ------------------
 2190|  39.5k|            if (!n_cache || cache[n_cache - 1] != *l)
  ------------------
  |  Branch (2190:17): [True: 7.92k, False: 31.6k]
  |  Branch (2190:29): [True: 31.4k, False: 139]
  ------------------
 2191|  39.4k|                cache[n_cache++] = *l;
 2192|  39.5k|            l++;
 2193|  39.5k|            l_cache--;
 2194|  94.0k|        } else {
 2195|  94.0k|            if (*a == *l) {
  ------------------
  |  Branch (2195:17): [True: 48.2k, False: 45.8k]
  ------------------
 2196|  48.2k|                l++;
 2197|  48.2k|                l_cache--;
 2198|  48.2k|            }
 2199|  94.0k|            if (!n_cache || cache[n_cache - 1] != *a)
  ------------------
  |  Branch (2199:17): [True: 15.2k, False: 78.7k]
  |  Branch (2199:29): [True: 74.5k, False: 4.18k]
  ------------------
 2200|  89.8k|                cache[n_cache++] = *a;
 2201|  94.0k|            a++;
 2202|  94.0k|            a_cache--;
 2203|  94.0k|        }
 2204|   133k|    }
 2205|   142k|    if (l_cache) {
  ------------------
  |  Branch (2205:9): [True: 42.9k, False: 99.4k]
  ------------------
 2206|   169k|        do {
 2207|   169k|            if (!n_cache || cache[n_cache - 1] != *l)
  ------------------
  |  Branch (2207:17): [True: 35.2k, False: 134k]
  |  Branch (2207:29): [True: 114k, False: 19.6k]
  ------------------
 2208|   150k|                cache[n_cache++] = *l;
 2209|   169k|            l++;
 2210|   169k|        } while (--l_cache > 0);
  ------------------
  |  Branch (2210:18): [True: 126k, False: 42.9k]
  ------------------
 2211|  99.4k|    } else if (a_cache) {
  ------------------
  |  Branch (2211:16): [True: 44.8k, False: 54.5k]
  ------------------
 2212|   188k|        do {
 2213|   188k|            if (!n_cache || cache[n_cache - 1] != *a)
  ------------------
  |  Branch (2213:17): [True: 30.4k, False: 158k]
  |  Branch (2213:29): [True: 100k, False: 57.5k]
  ------------------
 2214|   131k|                cache[n_cache++] = *a;
 2215|   188k|            a++;
 2216|   188k|        } while (--a_cache > 0);
  ------------------
  |  Branch (2216:18): [True: 143k, False: 44.8k]
  ------------------
 2217|  44.8k|    }
 2218|       |
 2219|       |    // find reused cache entries
 2220|   142k|    int i = 0;
 2221|   487k|    for (int n = 0; n < n_cache && i < pal_sz; n++)
  ------------------
  |  Branch (2221:21): [True: 363k, False: 124k]
  |  Branch (2221:36): [True: 345k, False: 18.0k]
  ------------------
 2222|   345k|        if (dav1d_msac_decode_bool_equi(&ts->msac))
  ------------------
  |  |   53|   345k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (2222:13): [True: 187k, False: 158k]
  ------------------
 2223|   187k|            used_cache[i++] = cache[n];
 2224|   142k|    const int n_used_cache = i;
 2225|       |
 2226|       |    // parse new entries
 2227|   142k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2227:24): [True: 142k, False: 18.4E]
  ------------------
 2228|   142k|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2229|   142k|                            ((t->bx >> 1) + (t->by & 1))][pl] :
 2230|  18.4E|        bytefn(t->scratch.pal)[pl];
  ------------------
  |  |   87|  18.4E|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   142k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2231|   142k|    if (i < pal_sz) {
  ------------------
  |  Branch (2231:9): [True: 122k, False: 20.1k]
  ------------------
 2232|  18.4E|        const int bpc = BITDEPTH == 8 ? 8 : f->cur.p.bpc;
  ------------------
  |  Branch (2232:25): [True: 122k, Folded]
  ------------------
 2233|   122k|        int prev = pal[i++] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2234|       |
 2235|   122k|        if (i < pal_sz) {
  ------------------
  |  Branch (2235:13): [True: 102k, False: 19.2k]
  ------------------
 2236|   102k|            int bits = bpc - 3 + dav1d_msac_decode_bools(&ts->msac, 2);
 2237|   102k|            const int max = (1 << bpc) - 1;
 2238|       |
 2239|   222k|            do {
 2240|   222k|                const int delta = dav1d_msac_decode_bools(&ts->msac, bits);
 2241|   222k|                prev = pal[i++] = imin(prev + delta + !pl, max);
 2242|   222k|                if (prev + !pl >= max) {
  ------------------
  |  Branch (2242:21): [True: 61.6k, False: 161k]
  ------------------
 2243|   161k|                    for (; i < pal_sz; i++)
  ------------------
  |  Branch (2243:28): [True: 99.4k, False: 61.6k]
  ------------------
 2244|  99.4k|                        pal[i] = max;
 2245|  61.6k|                    break;
 2246|  61.6k|                }
 2247|   161k|                bits = imin(bits, 1 + ulog2(max - prev - !pl));
 2248|   161k|            } while (i < pal_sz);
  ------------------
  |  Branch (2248:22): [True: 119k, False: 41.2k]
  ------------------
 2249|   102k|        }
 2250|       |
 2251|       |        // merge cache+new entries
 2252|   122k|        int n = 0, m = n_used_cache;
 2253|   696k|        for (i = 0; i < pal_sz; i++) {
  ------------------
  |  Branch (2253:21): [True: 574k, False: 122k]
  ------------------
 2254|   574k|            if (n < n_used_cache && (m >= pal_sz || used_cache[n] <= pal[m])) {
  ------------------
  |  Branch (2254:17): [True: 227k, False: 346k]
  |  Branch (2254:38): [True: 46.8k, False: 180k]
  |  Branch (2254:53): [True: 83.4k, False: 97.1k]
  ------------------
 2255|   130k|                pal[i] = used_cache[n++];
 2256|   443k|            } else {
 2257|   443k|                assert(m < pal_sz);
  ------------------
  |  Branch (2257:17): [True: 444k, False: 18.4E]
  ------------------
 2258|   444k|                pal[i] = pal[m++];
 2259|   444k|            }
 2260|   574k|        }
 2261|   122k|    } else {
 2262|  20.1k|        memcpy(pal, used_cache, n_used_cache * sizeof(*used_cache));
 2263|  20.1k|    }
 2264|       |
 2265|   142k|    if (DEBUG_BLOCK_INFO) {
  ------------------
  |  |   34|   142k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 142k]
  |  |  ------------------
  |  |   35|   142k|        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|   142k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2266|      0|        printf("Post-pal[pl=%d,sz=%d,cache_size=%d,used_cache=%d]: r=%d, cache=",
 2267|      0|               pl, pal_sz, n_cache, n_used_cache, ts->msac.rng);
 2268|      0|        for (int n = 0; n < n_cache; n++)
  ------------------
  |  Branch (2268:25): [True: 0, False: 0]
  ------------------
 2269|      0|            printf("%c%02x", n ? ' ' : '[', cache[n]);
  ------------------
  |  Branch (2269:30): [True: 0, False: 0]
  ------------------
 2270|      0|        printf("%s, pal=", n_cache ? "]" : "[]");
  ------------------
  |  Branch (2270:28): [True: 0, False: 0]
  ------------------
 2271|      0|        for (int n = 0; n < pal_sz; n++)
  ------------------
  |  Branch (2271:25): [True: 0, False: 0]
  ------------------
 2272|      0|            printf("%c%02x", n ? ' ' : '[', pal[n]);
  ------------------
  |  Branch (2272:30): [True: 0, False: 0]
  ------------------
 2273|      0|        printf("]\n");
 2274|      0|    }
 2275|   142k|}
dav1d_read_pal_uv_8bpc:
 2279|  21.4k|{
 2280|  21.4k|    bytefn(dav1d_read_pal_plane)(t, b, 1, sz_ctx, bx4, by4);
  ------------------
  |  |   87|  21.4k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  21.4k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2281|       |
 2282|       |    // V pal coding
 2283|  21.4k|    Dav1dTileState *const ts = t->ts;
 2284|  21.4k|    const Dav1dFrameContext *const f = t->f;
 2285|  21.4k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2285:24): [True: 21.4k, False: 0]
  ------------------
 2286|  21.4k|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2287|  21.4k|                            ((t->bx >> 1) + (t->by & 1))][2] :
 2288|  21.4k|        bytefn(t->scratch.pal)[2];
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  21.4k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2289|  21.4k|    const int bpc = BITDEPTH == 8 ? 8 : f->cur.p.bpc;
  ------------------
  |  Branch (2289:21): [True: 21.4k, Folded]
  ------------------
 2290|  21.4k|    if (dav1d_msac_decode_bool_equi(&ts->msac)) {
  ------------------
  |  |   53|  21.4k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (2290:9): [True: 11.8k, False: 9.63k]
  ------------------
 2291|  11.8k|        const int bits = bpc - 4 + dav1d_msac_decode_bools(&ts->msac, 2);
 2292|  11.8k|        int prev = pal[0] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2293|  11.8k|        const int max = (1 << bpc) - 1;
 2294|  47.6k|        for (int i = 1; i < b->pal_sz[1]; i++) {
  ------------------
  |  Branch (2294:25): [True: 35.8k, False: 11.8k]
  ------------------
 2295|  35.8k|            int delta = dav1d_msac_decode_bools(&ts->msac, bits);
 2296|  35.8k|            if (delta) {
  ------------------
  |  Branch (2296:17): [True: 35.4k, False: 382]
  ------------------
 2297|  35.4k|                const int sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  35.4k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
 2298|  35.4k|                delta = apply_sign_bool(delta, sign);
 2299|  35.4k|            }
 2300|  35.8k|            prev = pal[i] = (prev + delta) & max;
 2301|  35.8k|        }
 2302|  11.8k|    } else {
 2303|  53.2k|        for (int i = 0; i < b->pal_sz[1]; i++)
  ------------------
  |  Branch (2303:25): [True: 43.6k, False: 9.63k]
  ------------------
 2304|  43.6k|            pal[i] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2305|  9.63k|    }
 2306|  21.4k|    if (DEBUG_BLOCK_INFO) {
  ------------------
  |  |   34|  21.4k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 21.4k]
  |  |  ------------------
  |  |   35|  21.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|  21.4k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2307|      0|        printf("Post-pal[pl=2]: r=%d ", ts->msac.rng);
 2308|      0|        for (int n = 0; n < b->pal_sz[1]; n++)
  ------------------
  |  Branch (2308:25): [True: 0, False: 0]
  ------------------
 2309|      0|            printf("%c%02x", n ? ' ' : '[', pal[n]);
  ------------------
  |  Branch (2309:30): [True: 0, False: 0]
  ------------------
 2310|      0|        printf("]\n");
 2311|      0|    }
 2312|  21.4k|}
recon_tmpl.c:read_coef_tree:
  736|  6.64M|{
  737|  6.64M|    const Dav1dFrameContext *const f = t->f;
  738|  6.64M|    Dav1dTileState *const ts = t->ts;
  739|  6.64M|    const Dav1dDSPContext *const dsp = f->dsp;
  740|  6.64M|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[ytx];
  741|  6.64M|    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|  6.64M|    if (depth < 2 && tx_split[depth] &&
  ------------------
  |  Branch (745:9): [True: 6.28M, False: 359k]
  |  Branch (745:22): [True: 436k, False: 5.84M]
  ------------------
  746|   436k|        tx_split[depth] & (1 << (y_off * 4 + x_off)))
  ------------------
  |  Branch (746:9): [True: 355k, False: 81.9k]
  ------------------
  747|   354k|    {
  748|   354k|        const enum RectTxfmSize sub = t_dim->sub;
  749|   354k|        const TxfmInfo *const sub_t_dim = &dav1d_txfm_dimensions[sub];
  750|   354k|        const int txsw = sub_t_dim->w, txsh = sub_t_dim->h;
  751|       |
  752|   354k|        read_coef_tree(t, bs, b, sub, depth + 1, tx_split,
  753|   354k|                       x_off * 2 + 0, y_off * 2 + 0, dst);
  754|   354k|        t->bx += txsw;
  755|   354k|        if (txw >= txh && t->bx < f->bw)
  ------------------
  |  Branch (755:13): [True: 283k, False: 71.1k]
  |  Branch (755:27): [True: 282k, False: 1.34k]
  ------------------
  756|   282k|            read_coef_tree(t, bs, b, sub, depth + 1, tx_split, x_off * 2 + 1,
  757|   282k|                           y_off * 2 + 0, dst ? &dst[4 * txsw] : NULL);
  ------------------
  |  Branch (757:43): [True: 116k, False: 166k]
  ------------------
  758|   354k|        t->bx -= txsw;
  759|   354k|        t->by += txsh;
  760|   354k|        if (txh >= txw && t->by < f->bh) {
  ------------------
  |  Branch (760:13): [True: 248k, False: 105k]
  |  Branch (760:27): [True: 247k, False: 1.10k]
  ------------------
  761|   247k|            if (dst)
  ------------------
  |  Branch (761:17): [True: 103k, False: 144k]
  ------------------
  762|   103k|                dst += 4 * txsh * PXSTRIDE(f->cur.stride[0]);
  ------------------
  |  |   53|   103k|#define PXSTRIDE(x) (x)
  ------------------
  763|   247k|            read_coef_tree(t, bs, b, sub, depth + 1, tx_split,
  764|   247k|                           x_off * 2 + 0, y_off * 2 + 1, dst);
  765|   247k|            t->bx += txsw;
  766|   247k|            if (txw >= txh && t->bx < f->bw)
  ------------------
  |  Branch (766:17): [True: 177k, False: 70.1k]
  |  Branch (766:31): [True: 176k, False: 1.28k]
  ------------------
  767|   176k|                read_coef_tree(t, bs, b, sub, depth + 1, tx_split, x_off * 2 + 1,
  768|   176k|                               y_off * 2 + 1, dst ? &dst[4 * txsw] : NULL);
  ------------------
  |  Branch (768:47): [True: 72.9k, False: 103k]
  ------------------
  769|   247k|            t->bx -= txsw;
  770|   247k|        }
  771|   354k|        t->by -= txsh;
  772|  6.29M|    } else {
  773|  6.29M|        const int bx4 = t->bx & 31, by4 = t->by & 31;
  774|  6.29M|        enum TxfmType txtp;
  775|  6.29M|        uint8_t cf_ctx;
  776|  6.29M|        int eob;
  777|  6.29M|        coef *cf;
  778|       |
  779|  6.29M|        if (t->frame_thread.pass) {
  ------------------
  |  Branch (779:13): [True: 6.29M, False: 18.4E]
  ------------------
  780|  6.29M|            const int p = t->frame_thread.pass & 1;
  781|  6.29M|            assert(ts->frame_thread[p].cf);
  ------------------
  |  Branch (781:13): [True: 6.30M, False: 18.4E]
  ------------------
  782|  6.30M|            cf = ts->frame_thread[p].cf;
  783|  6.30M|            ts->frame_thread[p].cf += imin(t_dim->w, 8) * imin(t_dim->h, 8) * 16;
  784|  18.4E|        } else {
  785|  18.4E|            cf = bitfn(t->cf);
  ------------------
  |  |   51|  18.4E|#define bitfn(x) x##_8bpc
  ------------------
  786|  18.4E|        }
  787|  6.29M|        if (t->frame_thread.pass != 2) {
  ------------------
  |  Branch (787:13): [True: 5.29M, False: 994k]
  ------------------
  788|  5.29M|            eob = decode_coefs(t, &t->a->lcoef[bx4], &t->l.lcoef[by4],
  789|  5.29M|                               ytx, bs, b, 0, 0, cf, &txtp, &cf_ctx);
  790|  5.29M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  5.29M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 5.29M]
  |  |  ------------------
  |  |   35|  5.29M|        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.29M|        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|  5.29M|            dav1d_memset_likely_pow2(&t->a->lcoef[bx4], cf_ctx, imin(txw, f->bw - t->bx));
  794|  5.29M|            dav1d_memset_likely_pow2(&t->l.lcoef[by4], cf_ctx, imin(txh, f->bh - t->by));
  795|  5.29M|#define set_ctx(rep_macro) \
  796|  5.29M|            for (int y = 0; y < txh; y++) { \
  797|  5.29M|                rep_macro(txtp_map, 0, txtp); \
  798|  5.29M|                txtp_map += 32; \
  799|  5.29M|            }
  800|  5.29M|            uint8_t *txtp_map = &t->scratch.txtp_map[by4 * 32 + bx4];
  801|  5.29M|            case_set_upto16(t_dim->lw);
  ------------------
  |  |   80|  5.29M|    switch (var) { \
  |  |   81|  3.49M|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  |  796|  7.24M|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 3.74M, False: 3.49M]
  |  |  |  |  ------------------
  |  |  |  |  797|  3.74M|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  3.74M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  3.74M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|  3.74M|                txtp_map += 32; \
  |  |  |  |  799|  3.74M|            }
  |  |  ------------------
  |  |  |  Branch (81:5): [True: 3.49M, False: 1.79M]
  |  |  ------------------
  |  |   82|   771k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  |  796|  2.65M|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 1.88M, False: 771k]
  |  |  |  |  ------------------
  |  |  |  |  797|  1.88M|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  1.88M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.88M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|  1.88M|                txtp_map += 32; \
  |  |  |  |  799|  1.88M|            }
  |  |  ------------------
  |  |  |  Branch (82:5): [True: 771k, False: 4.52M]
  |  |  ------------------
  |  |   83|   648k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  |  796|  2.72M|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 2.07M, False: 648k]
  |  |  |  |  ------------------
  |  |  |  |  797|  2.07M|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  2.07M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  2.07M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|  2.07M|                txtp_map += 32; \
  |  |  |  |  799|  2.07M|            }
  |  |  ------------------
  |  |  |  Branch (83:5): [True: 648k, False: 4.65M]
  |  |  ------------------
  |  |   84|   276k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  |  796|  1.87M|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 1.60M, False: 276k]
  |  |  |  |  ------------------
  |  |  |  |  797|  1.60M|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  1.60M|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  1.60M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|  1.60M|                txtp_map += 32; \
  |  |  |  |  799|  1.60M|            }
  |  |  ------------------
  |  |  |  Branch (84:5): [True: 276k, False: 5.02M]
  |  |  ------------------
  |  |   85|   136k|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  |  796|  2.07M|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 1.93M, False: 136k]
  |  |  |  |  ------------------
  |  |  |  |  797|  1.93M|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  1.93M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  1.93M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  1.93M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  1.93M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 1.93M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|  1.93M|                txtp_map += 32; \
  |  |  |  |  799|  1.93M|            }
  |  |  ------------------
  |  |  |  Branch (85:5): [True: 136k, False: 5.16M]
  |  |  ------------------
  |  |   86|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (86:5): [True: 0, False: 5.29M]
  |  |  ------------------
  |  |   87|  5.29M|    }
  ------------------
  |  Branch (801:13): [Folded, False: 0]
  ------------------
  802|  5.29M|#undef set_ctx
  803|  5.29M|            if (t->frame_thread.pass == 1)
  ------------------
  |  Branch (803:17): [True: 5.29M, False: 833]
  ------------------
  804|  5.29M|                *ts->frame_thread[1].cbi++ = eob * (1 << 5) + txtp;
  805|  5.29M|        } else {
  806|   994k|            const int cbi = *ts->frame_thread[0].cbi++;
  807|   994k|            eob  = cbi >> 5;
  808|   994k|            txtp = cbi & 0x1f;
  809|   994k|        }
  810|  6.28M|        if (!(t->frame_thread.pass & 1)) {
  ------------------
  |  Branch (810:13): [True: 1.03M, False: 5.25M]
  ------------------
  811|  1.03M|            assert(dst);
  ------------------
  |  Branch (811:13): [True: 1.03M, False: 18.4E]
  ------------------
  812|  1.03M|            if (eob >= 0) {
  ------------------
  |  Branch (812:17): [True: 837k, False: 200k]
  ------------------
  813|   837k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   837k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 837k]
  |  |  ------------------
  |  |   35|   837k|        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|   837k|        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|   837k|                dsp->itx.itxfm_add[ytx][txtp](dst, f->cur.stride[0], cf, eob
  816|   837k|                                              HIGHBD_CALL_SUFFIX);
  817|   837k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   837k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 837k]
  |  |  ------------------
  |  |   35|   837k|        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|   837k|        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|   837k|            }
  820|  1.03M|        }
  821|  6.28M|    }
  822|  6.64M|}
recon_tmpl.c:decode_coefs:
  327|  40.5M|{
  328|  40.5M|    Dav1dTileState *const ts = t->ts;
  329|  40.5M|    const int chroma = !!plane;
  330|  40.5M|    const Dav1dFrameContext *const f = t->f;
  331|  40.5M|    const int lossless = f->frame_hdr->segmentation.lossless[b->seg_id];
  332|  40.5M|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[tx];
  333|  40.5M|    const int dbg = DEBUG_BLOCK_INFO && plane && 0;
  ------------------
  |  |   34|  40.5M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 40.5M]
  |  |  ------------------
  |  |   35|  40.5M|        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|  40.5M|        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|  40.5M|    if (dbg)
  ------------------
  |  Branch (335:9): [Folded, False: 40.5M]
  ------------------
  336|      0|        printf("Start: r=%d\n", ts->msac.rng);
  337|       |
  338|       |    // does this block have any non-zero coefficients
  339|  40.5M|    const int sctx = get_skip_ctx(t_dim, bs, a, l, chroma, f->cur.p.layout);
  340|  40.5M|    const int all_skip = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  40.5M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  341|  40.5M|                             ts->cdf.coef.skip[t_dim->ctx][sctx]);
  342|  40.5M|    if (dbg)
  ------------------
  |  Branch (342:9): [Folded, False: 40.5M]
  ------------------
  343|      0|        printf("Post-non-zero[%d][%d][%d]: r=%d\n",
  344|      0|               t_dim->ctx, sctx, all_skip, ts->msac.rng);
  345|  40.5M|    if (all_skip) {
  ------------------
  |  Branch (345:9): [True: 26.6M, False: 13.9M]
  ------------------
  346|  26.6M|        *res_ctx = 0x40;
  347|  26.6M|        *txtp = lossless * WHT_WHT; /* lossless ? WHT_WHT : DCT_DCT */
  348|  26.6M|        return -1;
  349|  26.6M|    }
  350|       |
  351|       |    // transform type (chroma: derived, luma: explicitly coded)
  352|  13.9M|    if (lossless) {
  ------------------
  |  Branch (352:9): [True: 5.13M, False: 8.80M]
  ------------------
  353|  5.13M|        assert(t_dim->max == TX_4X4);
  ------------------
  |  Branch (353:9): [True: 5.15M, False: 18.4E]
  ------------------
  354|  5.15M|        *txtp = WHT_WHT;
  355|  8.80M|    } else if (t_dim->max + intra >= TX_64X64) {
  ------------------
  |  Branch (355:16): [True: 3.35M, False: 5.45M]
  ------------------
  356|  3.35M|        *txtp = DCT_DCT;
  357|  5.45M|    } else if (chroma) {
  ------------------
  |  Branch (357:16): [True: 2.49M, False: 2.95M]
  ------------------
  358|       |        // inferred from either the luma txtp (inter) or a LUT (intra)
  359|  2.49M|        *txtp = intra ? dav1d_txtp_from_uvmode[b->uv_mode] :
  ------------------
  |  Branch (359:17): [True: 1.66M, False: 834k]
  ------------------
  360|  2.49M|                        get_uv_inter_txtp(t_dim, *txtp);
  361|  2.95M|    } else if (!f->frame_hdr->segmentation.qidx[b->seg_id]) {
  ------------------
  |  Branch (361:16): [True: 7.00k, False: 2.94M]
  ------------------
  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|  7.00k|        *txtp = DCT_DCT;
  366|  2.94M|    } else {
  367|  2.94M|        unsigned idx;
  368|  4.37M|        if (intra) {
  ------------------
  |  Branch (368:13): [True: 4.37M, False: 18.4E]
  ------------------
  369|  4.37M|            const enum IntraPredMode y_mode_nofilt = b->y_mode == FILTER_PRED ?
  ------------------
  |  Branch (369:54): [True: 936k, False: 3.43M]
  ------------------
  370|  3.43M|                dav1d_filter_mode_to_y_mode[b->y_angle] : b->y_mode;
  371|  4.37M|            if (f->frame_hdr->reduced_txtp_set || t_dim->min == TX_16X16) {
  ------------------
  |  Branch (371:17): [True: 544k, False: 3.83M]
  |  Branch (371:51): [True: 572k, False: 3.25M]
  ------------------
  372|  1.14M|                idx = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|  1.14M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  373|  1.14M|                          ts->cdf.m.txtp_intra2[t_dim->min][y_mode_nofilt], 4);
  374|  1.14M|                *txtp = dav1d_tx_types_per_set[idx + 0];
  375|  3.22M|            } else {
  376|  3.22M|                idx = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|  3.22M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  377|  3.22M|                          ts->cdf.m.txtp_intra1[t_dim->min][y_mode_nofilt], 6);
  378|  3.22M|                *txtp = dav1d_tx_types_per_set[idx + 5];
  379|  3.22M|            }
  380|  4.37M|            if (dbg)
  ------------------
  |  Branch (380:17): [Folded, False: 4.37M]
  ------------------
  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|  18.4E|        } else {
  384|  18.4E|            if (f->frame_hdr->reduced_txtp_set || t_dim->max == TX_32X32) {
  ------------------
  |  Branch (384:17): [True: 18.4E, False: 1.51M]
  |  Branch (384:51): [True: 278k, False: 1.23M]
  ------------------
  385|   597k|                idx = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   597k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  386|   597k|                          ts->cdf.m.txtp_inter3[t_dim->min]);
  387|   597k|                *txtp = (idx - 1) & IDTX; /* idx ? DCT_DCT : IDTX */
  388|  18.4E|            } else if (t_dim->min == TX_16X16) {
  ------------------
  |  Branch (388:24): [True: 190k, False: 18.4E]
  ------------------
  389|   190k|                idx = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|   190k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
  390|   190k|                          ts->cdf.m.txtp_inter2, 11);
  391|   190k|                *txtp = dav1d_tx_types_per_set[idx + 12];
  392|  18.4E|            } else {
  393|  18.4E|                idx = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|  18.4E|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
  394|  18.4E|                          ts->cdf.m.txtp_inter1[t_dim->min], 15);
  395|  18.4E|                *txtp = dav1d_tx_types_per_set[idx + 24];
  396|  18.4E|            }
  397|  18.4E|            if (dbg)
  ------------------
  |  Branch (397:17): [Folded, False: 18.4E]
  ------------------
  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|  18.4E|        }
  401|  2.94M|    }
  402|       |
  403|       |    // find end-of-block (eob)
  404|  13.9M|    int eob;
  405|  13.9M|    const int slw = imin(t_dim->lw, TX_32X32), slh = imin(t_dim->lh, TX_32X32);
  406|  13.9M|    const int tx2dszctx = slw + slh;
  407|  13.9M|    const enum TxClass tx_class = dav1d_tx_type_class[*txtp];
  408|  13.9M|    const int is_1d = tx_class != TX_CLASS_2D;
  409|  13.9M|    switch (tx2dszctx) {
  ------------------
  |  Branch (409:13): [True: 17.3M, 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|  6.64M|    case_sz(0,   16,  8, [is_1d]);
  ------------------
  |  |  411|  6.64M|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 6.64M, False: 7.31M]
  |  |  ------------------
  |  |  412|  6.64M|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|  6.64M|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   48|  6.64M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  |  |  ------------------
  |  |  414|  6.64M|        break; \
  |  |  415|  6.64M|    }
  ------------------
  417|  1.39M|    case_sz(1,   32,  8, [is_1d]);
  ------------------
  |  |  411|  1.39M|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 1.39M, False: 12.5M]
  |  |  ------------------
  |  |  412|  1.39M|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|  1.39M|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   48|  1.39M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  |  |  ------------------
  |  |  414|  1.39M|        break; \
  |  |  415|  1.39M|    }
  ------------------
  418|  2.61M|    case_sz(2,   64,  8, [is_1d]);
  ------------------
  |  |  411|  2.61M|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 2.61M, False: 11.3M]
  |  |  ------------------
  |  |  412|  2.61M|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|  2.61M|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   48|  2.61M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  |  |  ------------------
  |  |  414|  2.61M|        break; \
  |  |  415|  2.61M|    }
  ------------------
  419|  1.59M|    case_sz(3,  128,  8, [is_1d]);
  ------------------
  |  |  411|  1.59M|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 1.59M, False: 12.3M]
  |  |  ------------------
  |  |  412|  1.59M|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|  1.59M|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   48|  1.59M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  |  |  ------------------
  |  |  414|  1.59M|        break; \
  |  |  415|  1.59M|    }
  ------------------
  420|  2.01M|    case_sz(4,  256, 16, [is_1d]);
  ------------------
  |  |  411|  2.01M|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 2.01M, False: 11.9M]
  |  |  ------------------
  |  |  412|  2.01M|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|  2.01M|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   57|  2.01M|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  |  |  ------------------
  |  |  414|  2.01M|        break; \
  |  |  415|  2.01M|    }
  ------------------
  421|   675k|    case_sz(5,  512, 16,        );
  ------------------
  |  |  411|   675k|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 675k, False: 13.2M]
  |  |  ------------------
  |  |  412|   675k|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|   675k|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   57|   675k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  |  |  ------------------
  |  |  414|   675k|        break; \
  |  |  415|   675k|    }
  ------------------
  422|  2.38M|    case_sz(6, 1024, 16,        );
  ------------------
  |  |  411|  2.38M|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 2.38M, False: 11.5M]
  |  |  ------------------
  |  |  412|  2.38M|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|  2.38M|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   57|  2.38M|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  |  |  ------------------
  |  |  414|  2.38M|        break; \
  |  |  415|  2.38M|    }
  ------------------
  423|  13.9M|#undef case_sz
  424|  13.9M|    }
  425|  16.9M|    if (dbg)
  ------------------
  |  Branch (425:9): [Folded, False: 16.9M]
  ------------------
  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|  16.9M|    if (eob > 1) {
  ------------------
  |  Branch (428:9): [True: 11.9M, False: 4.94M]
  ------------------
  429|  11.9M|        const int eob_bin = eob - 2;
  430|  11.9M|        uint16_t *const eob_hi_bit_cdf =
  431|  11.9M|            ts->cdf.coef.eob_hi_bit[t_dim->ctx][chroma][eob_bin];
  432|  11.9M|        const int eob_hi_bit = dav1d_msac_decode_bool_adapt(&ts->msac, eob_hi_bit_cdf);
  ------------------
  |  |   52|  11.9M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  433|  11.9M|        if (dbg)
  ------------------
  |  Branch (433:13): [Folded, False: 11.9M]
  ------------------
  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|  11.9M|        eob = ((eob_hi_bit | 2) << eob_bin) | dav1d_msac_decode_bools(&ts->msac, eob_bin);
  437|  11.9M|        if (dbg)
  ------------------
  |  Branch (437:13): [Folded, False: 11.9M]
  ------------------
  438|      0|            printf("Post-eob[%d]: r=%d\n", eob, ts->msac.rng);
  439|  11.9M|    }
  440|  16.9M|    assert(eob >= 0);
  ------------------
  |  Branch (440:5): [True: 16.8M, False: 73.4k]
  ------------------
  441|       |
  442|       |    // base tokens
  443|  16.8M|    uint16_t (*const eob_cdf)[4] = ts->cdf.coef.eob_base_tok[t_dim->ctx][chroma];
  444|  16.8M|    uint16_t (*const hi_cdf)[4] = ts->cdf.coef.br_tok[imin(t_dim->ctx, 3)][chroma];
  445|  16.8M|    unsigned rc, dc_tok;
  446|       |
  447|  16.8M|    if (eob) {
  ------------------
  |  Branch (447:9): [True: 12.6M, False: 4.18M]
  ------------------
  448|  12.6M|        uint16_t (*const lo_cdf)[4] = ts->cdf.coef.base_tok[t_dim->ctx][chroma];
  449|  12.6M|        uint8_t *const levels = t->scratch.levels; // bits 0-5: tok, 6-7: lo_tok
  450|       |
  451|       |        /* eob */
  452|  12.6M|        unsigned ctx = 1 + (eob > 2 << tx2dszctx) + (eob > 4 << tx2dszctx);
  453|  12.6M|        int eob_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, eob_cdf[ctx], 2);
  ------------------
  |  |   47|  12.6M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
  454|  12.6M|        int tok = eob_tok + 1;
  455|  12.6M|        int level_tok = tok * 0x41;
  456|  12.6M|        unsigned mag;
  457|       |
  458|  12.6M|#define DECODE_COEFS_CLASS(tx_class) \
  459|  12.6M|        unsigned x, y; \
  460|  12.6M|        uint8_t *level; \
  461|  12.6M|        if (tx_class == TX_CLASS_2D) \
  462|  12.6M|            rc = scan[eob], x = rc >> shift, y = rc & mask; \
  463|  12.6M|        else if (tx_class == TX_CLASS_H) \
  464|       |            /* Transposing reduces the stride and padding requirements */ \
  465|  12.6M|            x = eob & mask, y = eob >> shift, rc = eob; \
  466|  12.6M|        else /* tx_class == TX_CLASS_V */ \
  467|  12.6M|            x = eob & mask, y = eob >> shift, rc = (x << shift2) | y; \
  468|  12.6M|        if (dbg) \
  469|  12.6M|            printf("Post-lo_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  470|  12.6M|                   t_dim->ctx, chroma, ctx, eob, rc, tok, ts->msac.rng); \
  471|  12.6M|        if (eob_tok == 2) { \
  472|  12.6M|            ctx = (tx_class == TX_CLASS_2D ? (x | y) > 1 : y != 0) ? 14 : 7; \
  473|  12.6M|            tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  474|  12.6M|            level_tok = tok + (3 << 6); \
  475|  12.6M|            if (dbg) \
  476|  12.6M|                printf("Post-hi_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  477|  12.6M|                       imin(t_dim->ctx, 3), chroma, ctx, eob, rc, tok, \
  478|  12.6M|                       ts->msac.rng); \
  479|  12.6M|        } \
  480|  12.6M|        cf[rc] = tok << 11; \
  481|  12.6M|        if (tx_class == TX_CLASS_2D) \
  482|  12.6M|            level = levels + rc; \
  483|  12.6M|        else \
  484|  12.6M|            level = levels + x * stride + y; \
  485|  12.6M|        *level = (uint8_t) level_tok; \
  486|  12.6M|        for (int i = eob - 1; i > 0; i--) { /* ac */ \
  487|  12.6M|            unsigned rc_i; \
  488|  12.6M|            if (tx_class == TX_CLASS_2D) \
  489|  12.6M|                rc_i = scan[i], x = rc_i >> shift, y = rc_i & mask; \
  490|  12.6M|            else if (tx_class == TX_CLASS_H) \
  491|  12.6M|                x = i & mask, y = i >> shift, rc_i = i; \
  492|  12.6M|            else /* tx_class == TX_CLASS_V */ \
  493|  12.6M|                x = i & mask, y = i >> shift, rc_i = (x << shift2) | y; \
  494|  12.6M|            assert(x < 32 && y < 32); \
  495|  12.6M|            if (tx_class == TX_CLASS_2D) \
  496|  12.6M|                level = levels + rc_i; \
  497|  12.6M|            else \
  498|  12.6M|                level = levels + x * stride + y; \
  499|  12.6M|            ctx = get_lo_ctx(level, tx_class, &mag, lo_ctx_offsets, x, y, stride); \
  500|  12.6M|            if (tx_class == TX_CLASS_2D) \
  501|  12.6M|                y |= x; \
  502|  12.6M|            tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  503|  12.6M|            if (dbg) \
  504|  12.6M|                printf("Post-lo_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  505|  12.6M|                       t_dim->ctx, chroma, ctx, i, rc_i, tok, ts->msac.rng); \
  506|  12.6M|            if (tok == 3) { \
  507|  12.6M|                mag &= 63; \
  508|  12.6M|                ctx = (y > (tx_class == TX_CLASS_2D) ? 14 : 7) + \
  509|  12.6M|                      (mag > 12 ? 6 : (mag + 1) >> 1); \
  510|  12.6M|                tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  511|  12.6M|                if (dbg) \
  512|  12.6M|                    printf("Post-hi_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  513|  12.6M|                           imin(t_dim->ctx, 3), chroma, ctx, i, rc_i, tok, \
  514|  12.6M|                           ts->msac.rng); \
  515|  12.6M|                *level = (uint8_t) (tok + (3 << 6)); \
  516|  12.6M|                cf[rc_i] = (tok << 11) | rc; \
  517|  12.6M|                rc = rc_i; \
  518|  12.6M|            } else { \
  519|       |                /* 0x1 for tok, 0x7ff as bitmask for rc, 0x41 for level_tok */ \
  520|  12.6M|                tok *= 0x17ff41; \
  521|  12.6M|                *level = (uint8_t) tok; \
  522|       |                /* tok ? (tok << 11) | rc : 0 */ \
  523|  12.6M|                tok = (tok >> 9) & (rc + ~0x7ffu); \
  524|  12.6M|                if (tok) rc = rc_i; \
  525|  12.6M|                cf[rc_i] = tok; \
  526|  12.6M|            } \
  527|  12.6M|        } \
  528|       |        /* dc */ \
  529|  12.6M|        ctx = (tx_class == TX_CLASS_2D) ? 0 : \
  530|  12.6M|            get_lo_ctx(levels, tx_class, &mag, lo_ctx_offsets, 0, 0, stride); \
  531|  12.6M|        dc_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  532|  12.6M|        if (dbg) \
  533|  12.6M|            printf("Post-dc_lo_tok[%d][%d][%d][%d]: r=%d\n", \
  534|  12.6M|                   t_dim->ctx, chroma, ctx, dc_tok, ts->msac.rng); \
  535|  12.6M|        if (dc_tok == 3) { \
  536|  12.6M|            if (tx_class == TX_CLASS_2D) \
  537|  12.6M|                mag = levels[0 * stride + 1] + levels[1 * stride + 0] + \
  538|  12.6M|                      levels[1 * stride + 1]; \
  539|  12.6M|            mag &= 63; \
  540|  12.6M|            ctx = mag > 12 ? 6 : (mag + 1) >> 1; \
  541|  12.6M|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  542|  12.6M|            if (dbg) \
  543|  12.6M|                printf("Post-dc_hi_tok[%d][%d][0][%d]: r=%d\n", \
  544|  12.6M|                       imin(t_dim->ctx, 3), chroma, dc_tok, ts->msac.rng); \
  545|  12.6M|        } \
  546|  12.6M|        break
  547|       |
  548|  12.6M|        const uint16_t *scan;
  549|  12.6M|        switch (tx_class) {
  550|  11.8M|        case TX_CLASS_2D: {
  ------------------
  |  Branch (550:9): [True: 11.8M, False: 827k]
  ------------------
  551|  11.8M|            const unsigned nonsquare_tx = tx >= RTX_4X8;
  552|  11.8M|            const uint8_t (*const lo_ctx_offsets)[5] =
  553|  11.8M|                dav1d_lo_ctx_offsets[nonsquare_tx + (tx & nonsquare_tx)];
  554|  11.8M|            scan = dav1d_scans[tx];
  555|  11.8M|            const ptrdiff_t stride = 4 << slh;
  556|  11.8M|            const unsigned shift = slh + 2, shift2 = 0;
  557|  11.8M|            const unsigned mask = (4 << slh) - 1;
  558|  11.8M|            memset(levels, 0, stride * ((4 << slw) + 2));
  559|  11.8M|            DECODE_COEFS_CLASS(TX_CLASS_2D);
  ------------------
  |  |  459|  11.8M|        unsigned x, y; \
  |  |  460|  11.8M|        uint8_t *level; \
  |  |  461|  11.8M|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (461:13): [True: 11.9M, Folded]
  |  |  ------------------
  |  |  462|  11.9M|            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|  11.8M|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (468:13): [Folded, False: 11.8M]
  |  |  ------------------
  |  |  469|  11.8M|            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|  11.8M|        if (eob_tok == 2) { \
  |  |  ------------------
  |  |  |  Branch (471:13): [True: 315k, False: 11.5M]
  |  |  ------------------
  |  |  472|  18.4E|            ctx = (tx_class == TX_CLASS_2D ? (x | y) > 1 : y != 0) ? 14 : 7; \
  |  |  ------------------
  |  |  |  Branch (472:19): [True: 309k, False: 6.09k]
  |  |  |  Branch (472:20): [True: 315k, Folded]
  |  |  ------------------
  |  |  473|   315k|            tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|   315k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  474|   315k|            level_tok = tok + (3 << 6); \
  |  |  475|   315k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (475:17): [Folded, False: 315k]
  |  |  ------------------
  |  |  476|   315k|                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|   315k|        } \
  |  |  480|  11.8M|        cf[rc] = tok << 11; \
  |  |  481|  11.8M|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (481:13): [True: 11.9M, Folded]
  |  |  ------------------
  |  |  482|  11.9M|            level = levels + rc; \
  |  |  483|  11.8M|        else \
  |  |  484|  18.4E|            level = levels + x * stride + y; \
  |  |  485|  11.8M|        *level = (uint8_t) level_tok; \
  |  |  486|   202M|        for (int i = eob - 1; i > 0; i--) { /* ac */ \
  |  |  ------------------
  |  |  |  Branch (486:31): [True: 190M, False: 11.8M]
  |  |  ------------------
  |  |  487|   190M|            unsigned rc_i; \
  |  |  488|   190M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (488:17): [True: 190M, Folded]
  |  |  ------------------
  |  |  489|   190M|                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|   190M|            assert(x < 32 && y < 32); \
  |  |  495|   190M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (495:17): [True: 190M, Folded]
  |  |  ------------------
  |  |  496|   190M|                level = levels + rc_i; \
  |  |  497|   190M|            else \
  |  |  498|  18.4E|                level = levels + x * stride + y; \
  |  |  499|   190M|            ctx = get_lo_ctx(level, tx_class, &mag, lo_ctx_offsets, x, y, stride); \
  |  |  500|   190M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (500:17): [True: 190M, Folded]
  |  |  ------------------
  |  |  501|   190M|                y |= x; \
  |  |  502|   190M|            tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|   190M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  503|   190M|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (503:17): [Folded, False: 190M]
  |  |  ------------------
  |  |  504|   190M|                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|   190M|            if (tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (506:17): [True: 15.0M, False: 175M]
  |  |  ------------------
  |  |  507|  15.0M|                mag &= 63; \
  |  |  508|  15.0M|                ctx = (y > (tx_class == TX_CLASS_2D) ? 14 : 7) + \
  |  |  ------------------
  |  |  |  Branch (508:24): [True: 10.2M, False: 4.78M]
  |  |  ------------------
  |  |  509|  15.0M|                      (mag > 12 ? 6 : (mag + 1) >> 1); \
  |  |  ------------------
  |  |  |  Branch (509:24): [True: 2.46M, False: 12.6M]
  |  |  ------------------
  |  |  510|  15.0M|                tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  15.0M|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  511|  15.0M|                if (dbg) \
  |  |  ------------------
  |  |  |  Branch (511:21): [Folded, False: 15.0M]
  |  |  ------------------
  |  |  512|  15.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|  15.0M|                *level = (uint8_t) (tok + (3 << 6)); \
  |  |  516|  15.0M|                cf[rc_i] = (tok << 11) | rc; \
  |  |  517|  15.0M|                rc = rc_i; \
  |  |  518|   175M|            } else { \
  |  |  519|   175M|                /* 0x1 for tok, 0x7ff as bitmask for rc, 0x41 for level_tok */ \
  |  |  520|   175M|                tok *= 0x17ff41; \
  |  |  521|   175M|                *level = (uint8_t) tok; \
  |  |  522|   175M|                /* tok ? (tok << 11) | rc : 0 */ \
  |  |  523|   175M|                tok = (tok >> 9) & (rc + ~0x7ffu); \
  |  |  524|   175M|                if (tok) rc = rc_i; \
  |  |  ------------------
  |  |  |  Branch (524:21): [True: 57.8M, False: 117M]
  |  |  ------------------
  |  |  525|   175M|                cf[rc_i] = tok; \
  |  |  526|   175M|            } \
  |  |  527|   190M|        } \
  |  |  528|  11.8M|        /* dc */ \
  |  |  529|  11.8M|        ctx = (tx_class == TX_CLASS_2D) ? 0 : \
  |  |  ------------------
  |  |  |  Branch (529:15): [True: 11.8M, Folded]
  |  |  ------------------
  |  |  530|  18.4E|            get_lo_ctx(levels, tx_class, &mag, lo_ctx_offsets, 0, 0, stride); \
  |  |  531|  11.8M|        dc_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|  11.8M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  532|  11.8M|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (532:13): [Folded, False: 11.8M]
  |  |  ------------------
  |  |  533|  11.8M|            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|  11.8M|        if (dc_tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (535:13): [True: 4.73M, False: 7.11M]
  |  |  ------------------
  |  |  536|  4.73M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (536:17): [True: 4.73M, Folded]
  |  |  ------------------
  |  |  537|  4.73M|                mag = levels[0 * stride + 1] + levels[1 * stride + 0] + \
  |  |  538|  4.73M|                      levels[1 * stride + 1]; \
  |  |  539|  4.73M|            mag &= 63; \
  |  |  540|  4.73M|            ctx = mag > 12 ? 6 : (mag + 1) >> 1; \
  |  |  ------------------
  |  |  |  Branch (540:19): [True: 614k, False: 4.12M]
  |  |  ------------------
  |  |  541|  4.73M|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  4.73M|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  542|  4.73M|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (542:17): [Folded, False: 4.73M]
  |  |  ------------------
  |  |  543|  4.73M|                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|  4.73M|        } \
  |  |  546|  11.8M|        break
  ------------------
  |  Branch (559:13): [True: 190M, False: 18.4E]
  |  Branch (559:13): [True: 190M, False: 18.4E]
  ------------------
  560|  11.8M|        }
  561|   579k|        case TX_CLASS_H: {
  ------------------
  |  Branch (561:9): [True: 579k, False: 12.0M]
  ------------------
  562|   579k|            const uint8_t (*const lo_ctx_offsets)[5] = NULL;
  563|   579k|            const ptrdiff_t stride = 16;
  564|   579k|            const unsigned shift = slh + 2, shift2 = 0;
  565|   579k|            const unsigned mask = (4 << slh) - 1;
  566|   579k|            memset(levels, 0, stride * ((4 << slh) + 2));
  567|   579k|            DECODE_COEFS_CLASS(TX_CLASS_H);
  ------------------
  |  |  459|   579k|        unsigned x, y; \
  |  |  460|   579k|        uint8_t *level; \
  |  |  461|   579k|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (461:13): [Folded, False: 579k]
  |  |  ------------------
  |  |  462|   579k|            rc = scan[eob], x = rc >> shift, y = rc & mask; \
  |  |  463|   579k|        else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (463:18): [True: 579k, Folded]
  |  |  ------------------
  |  |  464|   579k|            /* Transposing reduces the stride and padding requirements */ \
  |  |  465|   579k|            x = eob & mask, y = eob >> shift, rc = eob; \
  |  |  466|   579k|        else /* tx_class == TX_CLASS_V */ \
  |  |  467|  18.4E|            x = eob & mask, y = eob >> shift, rc = (x << shift2) | y; \
  |  |  468|   579k|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (468:13): [Folded, False: 579k]
  |  |  ------------------
  |  |  469|   579k|            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|   579k|        if (eob_tok == 2) { \
  |  |  ------------------
  |  |  |  Branch (471:13): [True: 9.40k, False: 570k]
  |  |  ------------------
  |  |  472|  9.40k|            ctx = (tx_class == TX_CLASS_2D ? (x | y) > 1 : y != 0) ? 14 : 7; \
  |  |  ------------------
  |  |  |  Branch (472:19): [True: 6.02k, False: 3.37k]
  |  |  |  Branch (472:20): [Folded, False: 9.40k]
  |  |  ------------------
  |  |  473|  9.40k|            tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  9.40k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  474|  9.40k|            level_tok = tok + (3 << 6); \
  |  |  475|  9.40k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (475:17): [Folded, False: 9.40k]
  |  |  ------------------
  |  |  476|  9.40k|                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|  9.40k|        } \
  |  |  480|   579k|        cf[rc] = tok << 11; \
  |  |  481|   579k|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (481:13): [Folded, False: 579k]
  |  |  ------------------
  |  |  482|   579k|            level = levels + rc; \
  |  |  483|   579k|        else \
  |  |  484|   579k|            level = levels + x * stride + y; \
  |  |  485|   579k|        *level = (uint8_t) level_tok; \
  |  |  486|  10.3M|        for (int i = eob - 1; i > 0; i--) { /* ac */ \
  |  |  ------------------
  |  |  |  Branch (486:31): [True: 9.75M, False: 579k]
  |  |  ------------------
  |  |  487|  9.75M|            unsigned rc_i; \
  |  |  488|  9.75M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (488:17): [Folded, False: 9.75M]
  |  |  ------------------
  |  |  489|  9.75M|                rc_i = scan[i], x = rc_i >> shift, y = rc_i & mask; \
  |  |  490|  9.75M|            else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (490:22): [True: 9.75M, Folded]
  |  |  ------------------
  |  |  491|  9.75M|                x = i & mask, y = i >> shift, rc_i = i; \
  |  |  492|  9.75M|            else /* tx_class == TX_CLASS_V */ \
  |  |  493|  18.4E|                x = i & mask, y = i >> shift, rc_i = (x << shift2) | y; \
  |  |  494|  9.75M|            assert(x < 32 && y < 32); \
  |  |  495|  9.75M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (495:17): [Folded, False: 9.75M]
  |  |  ------------------
  |  |  496|  9.75M|                level = levels + rc_i; \
  |  |  497|  9.75M|            else \
  |  |  498|  9.75M|                level = levels + x * stride + y; \
  |  |  499|  9.75M|            ctx = get_lo_ctx(level, tx_class, &mag, lo_ctx_offsets, x, y, stride); \
  |  |  500|  9.75M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (500:17): [Folded, False: 9.75M]
  |  |  ------------------
  |  |  501|  9.75M|                y |= x; \
  |  |  502|  9.75M|            tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|  9.75M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  503|  9.75M|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (503:17): [Folded, False: 9.75M]
  |  |  ------------------
  |  |  504|  9.75M|                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|  9.75M|            if (tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (506:17): [True: 395k, False: 9.36M]
  |  |  ------------------
  |  |  507|   395k|                mag &= 63; \
  |  |  508|   395k|                ctx = (y > (tx_class == TX_CLASS_2D) ? 14 : 7) + \
  |  |  ------------------
  |  |  |  Branch (508:24): [True: 225k, False: 170k]
  |  |  ------------------
  |  |  509|   395k|                      (mag > 12 ? 6 : (mag + 1) >> 1); \
  |  |  ------------------
  |  |  |  Branch (509:24): [True: 45.3k, False: 350k]
  |  |  ------------------
  |  |  510|   395k|                tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|   395k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  511|   395k|                if (dbg) \
  |  |  ------------------
  |  |  |  Branch (511:21): [Folded, False: 395k]
  |  |  ------------------
  |  |  512|   395k|                    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|   395k|                *level = (uint8_t) (tok + (3 << 6)); \
  |  |  516|   395k|                cf[rc_i] = (tok << 11) | rc; \
  |  |  517|   395k|                rc = rc_i; \
  |  |  518|  9.36M|            } else { \
  |  |  519|  9.36M|                /* 0x1 for tok, 0x7ff as bitmask for rc, 0x41 for level_tok */ \
  |  |  520|  9.36M|                tok *= 0x17ff41; \
  |  |  521|  9.36M|                *level = (uint8_t) tok; \
  |  |  522|  9.36M|                /* tok ? (tok << 11) | rc : 0 */ \
  |  |  523|  9.36M|                tok = (tok >> 9) & (rc + ~0x7ffu); \
  |  |  524|  9.36M|                if (tok) rc = rc_i; \
  |  |  ------------------
  |  |  |  Branch (524:21): [True: 2.16M, False: 7.20M]
  |  |  ------------------
  |  |  525|  9.36M|                cf[rc_i] = tok; \
  |  |  526|  9.36M|            } \
  |  |  527|  9.75M|        } \
  |  |  528|   579k|        /* dc */ \
  |  |  529|   579k|        ctx = (tx_class == TX_CLASS_2D) ? 0 : \
  |  |  ------------------
  |  |  |  Branch (529:15): [Folded, False: 579k]
  |  |  ------------------
  |  |  530|   579k|            get_lo_ctx(levels, tx_class, &mag, lo_ctx_offsets, 0, 0, stride); \
  |  |  531|   579k|        dc_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|   579k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  532|   579k|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (532:13): [Folded, False: 579k]
  |  |  ------------------
  |  |  533|   579k|            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|   579k|        if (dc_tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (535:13): [True: 51.9k, False: 528k]
  |  |  ------------------
  |  |  536|  51.9k|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (536:17): [Folded, False: 51.9k]
  |  |  ------------------
  |  |  537|  51.9k|                mag = levels[0 * stride + 1] + levels[1 * stride + 0] + \
  |  |  538|      0|                      levels[1 * stride + 1]; \
  |  |  539|  51.9k|            mag &= 63; \
  |  |  540|  51.9k|            ctx = mag > 12 ? 6 : (mag + 1) >> 1; \
  |  |  ------------------
  |  |  |  Branch (540:19): [True: 5.33k, False: 46.5k]
  |  |  ------------------
  |  |  541|  51.9k|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  51.9k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  542|  51.9k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (542:17): [Folded, False: 51.9k]
  |  |  ------------------
  |  |  543|  51.9k|                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|  51.9k|        } \
  |  |  546|   579k|        break
  ------------------
  |  Branch (567:13): [True: 9.75M, False: 18.4E]
  |  Branch (567:13): [True: 9.75M, False: 18.4E]
  ------------------
  568|   579k|        }
  569|   386k|        case TX_CLASS_V: {
  ------------------
  |  Branch (569:9): [True: 386k, False: 12.2M]
  ------------------
  570|   386k|            const uint8_t (*const lo_ctx_offsets)[5] = NULL;
  571|   386k|            const ptrdiff_t stride = 16;
  572|   386k|            const unsigned shift = slw + 2, shift2 = slh + 2;
  573|   386k|            const unsigned mask = (4 << slw) - 1;
  574|   386k|            memset(levels, 0, stride * ((4 << slw) + 2));
  575|   386k|            DECODE_COEFS_CLASS(TX_CLASS_V);
  ------------------
  |  |  459|   386k|        unsigned x, y; \
  |  |  460|   386k|        uint8_t *level; \
  |  |  461|   386k|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (461:13): [Folded, False: 386k]
  |  |  ------------------
  |  |  462|   386k|            rc = scan[eob], x = rc >> shift, y = rc & mask; \
  |  |  463|   386k|        else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (463:18): [Folded, False: 386k]
  |  |  ------------------
  |  |  464|   386k|            /* Transposing reduces the stride and padding requirements */ \
  |  |  465|   386k|            x = eob & mask, y = eob >> shift, rc = eob; \
  |  |  466|   386k|        else /* tx_class == TX_CLASS_V */ \
  |  |  467|   386k|            x = eob & mask, y = eob >> shift, rc = (x << shift2) | y; \
  |  |  468|   386k|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (468:13): [Folded, False: 386k]
  |  |  ------------------
  |  |  469|   386k|            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|   386k|        if (eob_tok == 2) { \
  |  |  ------------------
  |  |  |  Branch (471:13): [True: 2.92k, False: 383k]
  |  |  ------------------
  |  |  472|  2.92k|            ctx = (tx_class == TX_CLASS_2D ? (x | y) > 1 : y != 0) ? 14 : 7; \
  |  |  ------------------
  |  |  |  Branch (472:19): [True: 2.70k, False: 216]
  |  |  |  Branch (472:20): [Folded, False: 2.92k]
  |  |  ------------------
  |  |  473|  2.92k|            tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  2.92k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  474|  2.92k|            level_tok = tok + (3 << 6); \
  |  |  475|  2.92k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (475:17): [Folded, False: 2.92k]
  |  |  ------------------
  |  |  476|  2.92k|                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|  2.92k|        } \
  |  |  480|   386k|        cf[rc] = tok << 11; \
  |  |  481|   386k|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (481:13): [Folded, False: 386k]
  |  |  ------------------
  |  |  482|   386k|            level = levels + rc; \
  |  |  483|   386k|        else \
  |  |  484|   386k|            level = levels + x * stride + y; \
  |  |  485|   386k|        *level = (uint8_t) level_tok; \
  |  |  486|  6.70M|        for (int i = eob - 1; i > 0; i--) { /* ac */ \
  |  |  ------------------
  |  |  |  Branch (486:31): [True: 6.32M, False: 386k]
  |  |  ------------------
  |  |  487|  6.32M|            unsigned rc_i; \
  |  |  488|  6.32M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (488:17): [Folded, False: 6.32M]
  |  |  ------------------
  |  |  489|  6.32M|                rc_i = scan[i], x = rc_i >> shift, y = rc_i & mask; \
  |  |  490|  6.32M|            else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (490:22): [Folded, False: 6.32M]
  |  |  ------------------
  |  |  491|  6.32M|                x = i & mask, y = i >> shift, rc_i = i; \
  |  |  492|  6.32M|            else /* tx_class == TX_CLASS_V */ \
  |  |  493|  6.32M|                x = i & mask, y = i >> shift, rc_i = (x << shift2) | y; \
  |  |  494|  6.32M|            assert(x < 32 && y < 32); \
  |  |  495|  6.32M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (495:17): [Folded, False: 6.32M]
  |  |  ------------------
  |  |  496|  6.32M|                level = levels + rc_i; \
  |  |  497|  6.32M|            else \
  |  |  498|  6.32M|                level = levels + x * stride + y; \
  |  |  499|  6.32M|            ctx = get_lo_ctx(level, tx_class, &mag, lo_ctx_offsets, x, y, stride); \
  |  |  500|  6.32M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (500:17): [Folded, False: 6.32M]
  |  |  ------------------
  |  |  501|  6.32M|                y |= x; \
  |  |  502|  6.32M|            tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|  6.32M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  503|  6.32M|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (503:17): [Folded, False: 6.32M]
  |  |  ------------------
  |  |  504|  6.32M|                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|  6.32M|            if (tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (506:17): [True: 166k, False: 6.15M]
  |  |  ------------------
  |  |  507|   166k|                mag &= 63; \
  |  |  508|   166k|                ctx = (y > (tx_class == TX_CLASS_2D) ? 14 : 7) + \
  |  |  ------------------
  |  |  |  Branch (508:24): [True: 103k, False: 62.7k]
  |  |  ------------------
  |  |  509|   166k|                      (mag > 12 ? 6 : (mag + 1) >> 1); \
  |  |  ------------------
  |  |  |  Branch (509:24): [True: 10.5k, False: 155k]
  |  |  ------------------
  |  |  510|   166k|                tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|   166k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  511|   166k|                if (dbg) \
  |  |  ------------------
  |  |  |  Branch (511:21): [Folded, False: 166k]
  |  |  ------------------
  |  |  512|   166k|                    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|   166k|                *level = (uint8_t) (tok + (3 << 6)); \
  |  |  516|   166k|                cf[rc_i] = (tok << 11) | rc; \
  |  |  517|   166k|                rc = rc_i; \
  |  |  518|  6.15M|            } else { \
  |  |  519|  6.15M|                /* 0x1 for tok, 0x7ff as bitmask for rc, 0x41 for level_tok */ \
  |  |  520|  6.15M|                tok *= 0x17ff41; \
  |  |  521|  6.15M|                *level = (uint8_t) tok; \
  |  |  522|  6.15M|                /* tok ? (tok << 11) | rc : 0 */ \
  |  |  523|  6.15M|                tok = (tok >> 9) & (rc + ~0x7ffu); \
  |  |  524|  6.15M|                if (tok) rc = rc_i; \
  |  |  ------------------
  |  |  |  Branch (524:21): [True: 1.30M, False: 4.84M]
  |  |  ------------------
  |  |  525|  6.15M|                cf[rc_i] = tok; \
  |  |  526|  6.15M|            } \
  |  |  527|  6.32M|        } \
  |  |  528|   386k|        /* dc */ \
  |  |  529|   386k|        ctx = (tx_class == TX_CLASS_2D) ? 0 : \
  |  |  ------------------
  |  |  |  Branch (529:15): [Folded, False: 386k]
  |  |  ------------------
  |  |  530|   386k|            get_lo_ctx(levels, tx_class, &mag, lo_ctx_offsets, 0, 0, stride); \
  |  |  531|   386k|        dc_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|   386k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  532|   386k|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (532:13): [Folded, False: 386k]
  |  |  ------------------
  |  |  533|   386k|            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|   386k|        if (dc_tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (535:13): [True: 44.3k, False: 342k]
  |  |  ------------------
  |  |  536|  44.3k|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (536:17): [Folded, False: 44.3k]
  |  |  ------------------
  |  |  537|  44.3k|                mag = levels[0 * stride + 1] + levels[1 * stride + 0] + \
  |  |  538|      0|                      levels[1 * stride + 1]; \
  |  |  539|  44.3k|            mag &= 63; \
  |  |  540|  44.3k|            ctx = mag > 12 ? 6 : (mag + 1) >> 1; \
  |  |  ------------------
  |  |  |  Branch (540:19): [True: 1.98k, False: 42.4k]
  |  |  ------------------
  |  |  541|  44.3k|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  44.3k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  542|  44.3k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (542:17): [Folded, False: 44.3k]
  |  |  ------------------
  |  |  543|  44.3k|                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|  44.3k|        } \
  |  |  546|   386k|        break
  ------------------
  |  Branch (575:13): [True: 6.32M, False: 29]
  |  Branch (575:13): [True: 6.32M, False: 18.4E]
  ------------------
  576|   386k|        }
  577|      0|#undef DECODE_COEFS_CLASS
  578|      0|        default: assert(0);
  ------------------
  |  Branch (578:9): [True: 0, False: 12.6M]
  |  Branch (578:18): [Folded, False: 0]
  ------------------
  579|  12.6M|        }
  580|  12.6M|    } else { // dc-only
  581|  4.18M|        int tok_br = dav1d_msac_decode_symbol_adapt4(&ts->msac, eob_cdf[0], 2);
  ------------------
  |  |   47|  4.18M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
  582|  4.18M|        dc_tok = 1 + tok_br;
  583|  4.18M|        if (dbg)
  ------------------
  |  Branch (583:13): [Folded, False: 4.18M]
  ------------------
  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|  4.18M|        if (tok_br == 2) {
  ------------------
  |  Branch (586:13): [True: 230k, False: 3.95M]
  ------------------
  587|   230k|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[0]);
  ------------------
  |  |   49|   230k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  ------------------
  588|   230k|            if (dbg)
  ------------------
  |  Branch (588:17): [Folded, False: 230k]
  ------------------
  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|   230k|        }
  592|  4.18M|        rc = 0;
  593|  4.18M|    }
  594|       |
  595|       |    // residual and sign
  596|  17.0M|    const uint16_t *const dq_tbl = ts->dq[b->seg_id][plane];
  597|  17.0M|    const uint8_t *const qm_tbl = *txtp < IDTX ? f->qm[tx][plane] : NULL;
  ------------------
  |  Branch (597:35): [True: 10.2M, False: 6.75M]
  ------------------
  598|  17.0M|    const int dq_shift = imax(0, t_dim->ctx - 2);
  599|  17.0M|    const int cf_max = ~(~127U << (BITDEPTH == 8 ? 8 : f->cur.p.bpc));
  ------------------
  |  Branch (599:36): [True: 5.11M, Folded]
  ------------------
  600|  17.0M|    unsigned cul_level, dc_sign_level;
  601|       |
  602|  17.0M|    if (!dc_tok) {
  ------------------
  |  Branch (602:9): [True: 3.20M, False: 13.8M]
  ------------------
  603|  3.20M|        cul_level = 0;
  604|  3.20M|        dc_sign_level = 1 << 6;
  605|  3.20M|        if (qm_tbl) goto ac_qm;
  ------------------
  |  Branch (605:13): [True: 156k, False: 3.04M]
  ------------------
  606|  3.04M|        goto ac_noqm;
  607|  3.20M|    }
  608|       |
  609|  13.8M|    const int dc_sign_ctx = get_dc_sign_ctx(tx, a, l);
  610|  13.8M|    uint16_t *const dc_sign_cdf = ts->cdf.coef.dc_sign[chroma][dc_sign_ctx];
  611|  13.8M|    const int dc_sign = dav1d_msac_decode_bool_adapt(&ts->msac, dc_sign_cdf);
  ------------------
  |  |   52|  13.8M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  612|  13.8M|    if (dbg)
  ------------------
  |  Branch (612:9): [Folded, False: 13.8M]
  ------------------
  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|  13.8M|    int dc_dq = dq_tbl[0];
  617|  13.8M|    dc_sign_level = (dc_sign - 1) & (2 << 6);
  618|       |
  619|  13.8M|    if (qm_tbl) {
  ------------------
  |  Branch (619:9): [True: 1.09M, False: 12.7M]
  ------------------
  620|  1.09M|        dc_dq = (dc_dq * qm_tbl[0] + 16) >> 5;
  621|       |
  622|  1.09M|        if (dc_tok == 15) {
  ------------------
  |  Branch (622:13): [True: 21.8k, False: 1.07M]
  ------------------
  623|  21.8k|            dc_tok = read_golomb(&ts->msac) + 15;
  624|  21.8k|            if (dbg)
  ------------------
  |  Branch (624:17): [Folded, False: 21.8k]
  ------------------
  625|      0|                printf("Post-dc_residual[%d->%d]: r=%d\n",
  626|      0|                       dc_tok - 15, dc_tok, ts->msac.rng);
  627|       |
  628|  21.8k|            dc_tok &= 0xfffff;
  629|  21.8k|            dc_dq = (dc_dq * dc_tok) & 0xffffff;
  630|  1.07M|        } else {
  631|  1.07M|            dc_dq *= dc_tok;
  632|  1.07M|            assert(dc_dq <= 0xffffff);
  ------------------
  |  Branch (632:13): [True: 1.07M, False: 18.4E]
  ------------------
  633|  1.07M|        }
  634|  1.09M|        cul_level = dc_tok;
  635|  1.09M|        dc_dq >>= dq_shift;
  636|  1.09M|        dc_dq = umin(dc_dq, cf_max + dc_sign);
  637|  1.09M|        cf[0] = (coef) apply_sign_bool(dc_dq, dc_sign);
  638|       |
  639|  1.14M|        if (rc) ac_qm: {
  ------------------
  |  Branch (639:13): [True: 496k, False: 595k]
  ------------------
  640|  1.14M|            const unsigned ac_dq = dq_tbl[1];
  641|  8.12M|            do {
  642|  8.12M|                const int sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  8.12M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  643|  8.12M|                if (dbg)
  ------------------
  |  Branch (643:21): [Folded, False: 8.12M]
  ------------------
  644|      0|                    printf("Post-sign[%d=%d]: r=%d\n", rc, sign, ts->msac.rng);
  645|  8.12M|                const unsigned rc_tok = cf[rc];
  646|  8.12M|                unsigned tok, dq = (ac_dq * qm_tbl[rc] + 16) >> 5;
  647|  8.12M|                int dq_sat;
  648|       |
  649|  8.12M|                if (rc_tok >= (15 << 11)) {
  ------------------
  |  Branch (649:21): [True: 335k, False: 7.78M]
  ------------------
  650|   335k|                    tok = read_golomb(&ts->msac) + 15;
  651|   335k|                    if (dbg)
  ------------------
  |  Branch (651:25): [Folded, False: 335k]
  ------------------
  652|      0|                        printf("Post-residual[%d=%d->%d]: r=%d\n",
  653|      0|                               rc, tok - 15, tok, ts->msac.rng);
  654|       |
  655|   335k|                    tok &= 0xfffff;
  656|   335k|                    dq = (dq * tok) & 0xffffff;
  657|  7.78M|                } else {
  658|  7.78M|                    tok = rc_tok >> 11;
  659|  7.78M|                    dq *= tok;
  660|  7.78M|                    assert(dq <= 0xffffff);
  ------------------
  |  Branch (660:21): [True: 7.78M, False: 18.4E]
  ------------------
  661|  7.78M|                }
  662|  8.12M|                cul_level += tok;
  663|  8.12M|                dq >>= dq_shift;
  664|  8.12M|                dq_sat = umin(dq, cf_max + sign);
  665|  8.12M|                cf[rc] = (coef) apply_sign_bool(dq_sat, sign);
  666|       |
  667|  8.12M|                rc = rc_tok & 0x3ff;
  668|  8.12M|            } while (rc);
  ------------------
  |  Branch (668:22): [True: 7.47M, False: 653k]
  ------------------
  669|  1.14M|        }
  670|  12.7M|    } else {
  671|       |        // non-qmatrix is the common case and allows for additional optimizations
  672|  12.7M|        if (dc_tok == 15) {
  ------------------
  |  Branch (672:13): [True: 539k, False: 12.2M]
  ------------------
  673|   539k|            dc_tok = read_golomb(&ts->msac) + 15;
  674|   539k|            if (dbg)
  ------------------
  |  Branch (674:17): [Folded, False: 539k]
  ------------------
  675|      0|                printf("Post-dc_residual[%d->%d]: r=%d\n",
  676|      0|                       dc_tok - 15, dc_tok, ts->msac.rng);
  677|       |
  678|   539k|            dc_tok &= 0xfffff;
  679|   539k|            dc_dq = ((dc_dq * dc_tok) & 0xffffff) >> dq_shift;
  680|   539k|            dc_dq = umin(dc_dq, cf_max + dc_sign);
  681|  12.2M|        } else {
  682|  12.2M|            dc_dq = ((dc_dq * dc_tok) >> dq_shift);
  683|  12.2M|            assert(dc_dq <= cf_max);
  ------------------
  |  Branch (683:13): [True: 12.5M, False: 18.4E]
  ------------------
  684|  12.2M|        }
  685|  13.0M|        cul_level = dc_tok;
  686|  13.0M|        cf[0] = (coef) apply_sign_bool(dc_dq, dc_sign);
  687|       |
  688|  21.5M|        if (rc) ac_noqm: {
  ------------------
  |  Branch (688:13): [True: 9.36M, False: 3.68M]
  ------------------
  689|  21.5M|            const unsigned ac_dq = dq_tbl[1];
  690|  90.0M|            do {
  691|  90.0M|                const int sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  90.0M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  692|  90.0M|                if (dbg)
  ------------------
  |  Branch (692:21): [Folded, False: 90.0M]
  ------------------
  693|      0|                    printf("Post-sign[%d=%d]: r=%d\n", rc, sign, ts->msac.rng);
  694|  90.0M|                const unsigned rc_tok = cf[rc];
  695|  90.0M|                unsigned tok;
  696|  90.0M|                int dq;
  697|       |
  698|       |                // residual
  699|  90.0M|                if (rc_tok >= (15 << 11)) {
  ------------------
  |  Branch (699:21): [True: 1.43M, False: 88.6M]
  ------------------
  700|  1.43M|                    tok = read_golomb(&ts->msac) + 15;
  701|  1.43M|                    if (dbg)
  ------------------
  |  Branch (701:25): [Folded, False: 1.43M]
  ------------------
  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|  1.43M|                    tok &= 0xfffff;
  707|       |
  708|       |                    // dequant, see 7.12.3
  709|  1.43M|                    dq = ((ac_dq * tok) & 0xffffff) >> dq_shift;
  710|  1.43M|                    dq = umin(dq, cf_max + sign);
  711|  88.6M|                } else {
  712|       |                    // cannot exceed cf_max, so we can avoid the clipping
  713|  88.6M|                    tok = rc_tok >> 11;
  714|  88.6M|                    dq = ((ac_dq * tok) >> dq_shift);
  715|  88.6M|                    assert(dq <= cf_max);
  ------------------
  |  Branch (715:21): [True: 88.2M, False: 426k]
  ------------------
  716|  88.6M|                }
  717|  89.6M|                cul_level += tok;
  718|  89.6M|                cf[rc] = (coef) apply_sign_bool(dq, sign);
  719|       |
  720|  89.6M|                rc = rc_tok & 0x3ff; // next non-zero rc, zero if eob
  721|  89.6M|            } while (rc);
  ------------------
  |  Branch (721:22): [True: 77.9M, False: 11.7M]
  ------------------
  722|  21.5M|        }
  723|  13.0M|    }
  724|       |
  725|       |    // context
  726|  16.6M|    *res_ctx = umin(cul_level, 63) | dc_sign_level;
  727|       |
  728|  16.6M|    return eob;
  729|  13.8M|}
recon_tmpl.c:get_skip_ctx:
   65|  40.5M|{
   66|  40.5M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
   67|       |
   68|  40.5M|    if (chroma) {
  ------------------
  |  Branch (68:9): [True: 26.9M, False: 13.5M]
  ------------------
   69|  26.9M|        const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
   70|  26.9M|        const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
   71|  26.9M|        const int not_one_blk = b_dim[2] - (!!b_dim[2] && ss_hor) > t_dim->lw ||
  ------------------
  |  Branch (71:33): [True: 14.5M, False: 12.3M]
  |  Branch (71:45): [True: 25.2M, False: 1.68M]
  |  Branch (71:59): [True: 4.23M, False: 21.0M]
  ------------------
   72|  12.3M|                                b_dim[3] - (!!b_dim[3] && ss_ver) > t_dim->lh;
  ------------------
  |  Branch (72:33): [True: 206k, False: 12.1M]
  |  Branch (72:45): [True: 10.0M, False: 2.29M]
  |  Branch (72:59): [True: 3.31M, False: 6.78M]
  ------------------
   73|  26.9M|        unsigned ca, cl;
   74|       |
   75|  26.9M|#define MERGE_CTX(dir, type, no_val) \
   76|  26.9M|        c##dir = *(const type *) dir != no_val; \
   77|  26.9M|        break
   78|       |
   79|  26.9M|        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 */
  ------------------
  |  Branch (85:9): [True: 0, False: 26.9M]
  |  Branch (85:18): [Folded, False: 0]
  ------------------
   86|  14.9M|        case TX_4X4:   MERGE_CTX(a, uint8_t,  0x40);
  ------------------
  |  |   76|  14.9M|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  14.9M|        break
  ------------------
  |  Branch (86:9): [True: 14.9M, False: 12.0M]
  ------------------
   87|  4.08M|        case TX_8X8:   MERGE_CTX(a, uint16_t, 0x4040);
  ------------------
  |  |   76|  4.08M|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  4.08M|        break
  ------------------
  |  Branch (87:9): [True: 4.08M, False: 22.8M]
  ------------------
   88|  3.26M|        case TX_16X16: MERGE_CTX(a, uint32_t, 0x40404040U);
  ------------------
  |  |   76|  3.26M|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  3.26M|        break
  ------------------
  |  Branch (88:9): [True: 3.26M, False: 23.6M]
  ------------------
   89|  5.46M|        case TX_32X32: MERGE_CTX(a, uint64_t, 0x4040404040404040ULL);
  ------------------
  |  |   76|  5.46M|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  5.46M|        break
  ------------------
  |  Branch (89:9): [True: 5.46M, False: 21.4M]
  ------------------
   90|  26.9M|        }
   91|  26.9M|        switch (t_dim->lh) {
   92|      0|        default: assert(0); /* fall-through */
  ------------------
  |  Branch (92:9): [True: 0, False: 26.9M]
  |  Branch (92:18): [Folded, False: 0]
  ------------------
   93|  15.9M|        case TX_4X4:   MERGE_CTX(l, uint8_t,  0x40);
  ------------------
  |  |   76|  15.9M|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  15.9M|        break
  ------------------
  |  Branch (93:9): [True: 15.9M, False: 11.0M]
  ------------------
   94|  4.72M|        case TX_8X8:   MERGE_CTX(l, uint16_t, 0x4040);
  ------------------
  |  |   76|  4.72M|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  4.72M|        break
  ------------------
  |  Branch (94:9): [True: 4.72M, False: 22.2M]
  ------------------
   95|  2.61M|        case TX_16X16: MERGE_CTX(l, uint32_t, 0x40404040U);
  ------------------
  |  |   76|  2.61M|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  2.61M|        break
  ------------------
  |  Branch (95:9): [True: 2.61M, False: 24.3M]
  ------------------
   96|  4.49M|        case TX_32X32: MERGE_CTX(l, uint64_t, 0x4040404040404040ULL);
  ------------------
  |  |   76|  4.49M|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  4.49M|        break
  ------------------
  |  Branch (96:9): [True: 4.49M, False: 22.4M]
  ------------------
   97|  26.9M|        }
   98|  26.9M|#undef MERGE_CTX
   99|       |
  100|  26.9M|        return 7 + not_one_blk * 3 + ca + cl;
  101|  26.9M|    } else if (b_dim[2] == t_dim->lw && b_dim[3] == t_dim->lh) {
  ------------------
  |  Branch (101:16): [True: 7.36M, False: 6.22M]
  |  Branch (101:41): [True: 7.16M, False: 204k]
  ------------------
  102|  7.16M|        return 0;
  103|  7.16M|    } else {
  104|  6.42M|        unsigned la, ll;
  105|       |
  106|  6.42M|#define MERGE_CTX(dir, type, tx) \
  107|  6.42M|        if (tx == TX_64X64) { \
  108|  6.42M|            uint64_t tmp = *(const uint64_t *) dir; \
  109|  6.42M|            tmp |= *(const uint64_t *) &dir[8]; \
  110|  6.42M|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  111|  6.42M|        } else \
  112|  6.42M|            l##dir = *(const type *) dir; \
  113|  6.42M|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  114|  6.42M|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  115|  6.42M|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  116|  6.42M|        break
  117|       |
  118|  6.42M|        switch (t_dim->lw) {
  119|      0|        default: assert(0); /* fall-through */
  ------------------
  |  Branch (119:9): [True: 0, False: 6.42M]
  |  Branch (119:18): [Folded, False: 0]
  ------------------
  120|  7.19M|        case TX_4X4:   MERGE_CTX(a, uint8_t,  TX_4X4);
  ------------------
  |  |  107|  7.19M|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 7.19M]
  |  |  ------------------
  |  |  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|  7.19M|            l##dir = *(const type *) dir; \
  |  |  113|  7.19M|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 7.19M]
  |  |  ------------------
  |  |  114|  7.19M|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [Folded, False: 7.19M]
  |  |  ------------------
  |  |  115|  7.19M|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [Folded, False: 7.19M]
  |  |  ------------------
  |  |  116|  7.19M|        break
  ------------------
  |  Branch (120:9): [True: 7.19M, False: 18.4E]
  ------------------
  121|   699k|        case TX_8X8:   MERGE_CTX(a, uint16_t, TX_8X8);
  ------------------
  |  |  107|   699k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 699k]
  |  |  ------------------
  |  |  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|   699k|            l##dir = *(const type *) dir; \
  |  |  113|   699k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 699k]
  |  |  ------------------
  |  |  114|   699k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [Folded, False: 699k]
  |  |  ------------------
  |  |  115|   699k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 699k, Folded]
  |  |  ------------------
  |  |  116|   699k|        break
  ------------------
  |  Branch (121:9): [True: 699k, False: 5.72M]
  ------------------
  122|   341k|        case TX_16X16: MERGE_CTX(a, uint32_t, TX_16X16);
  ------------------
  |  |  107|   341k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 341k]
  |  |  ------------------
  |  |  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|   341k|            l##dir = *(const type *) dir; \
  |  |  113|   341k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 341k]
  |  |  ------------------
  |  |  114|   341k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 341k, Folded]
  |  |  ------------------
  |  |  115|   341k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 341k, Folded]
  |  |  ------------------
  |  |  116|   341k|        break
  ------------------
  |  Branch (122:9): [True: 341k, False: 6.08M]
  ------------------
  123|  31.3k|        case TX_32X32: MERGE_CTX(a, uint32_t, TX_32X32);
  ------------------
  |  |  107|  31.3k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 31.3k]
  |  |  ------------------
  |  |  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|  31.3k|            l##dir = *(const type *) dir; \
  |  |  113|  31.3k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 31.3k, Folded]
  |  |  ------------------
  |  |  114|  31.3k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 31.3k, Folded]
  |  |  ------------------
  |  |  115|  31.3k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 31.3k, Folded]
  |  |  ------------------
  |  |  116|  31.3k|        break
  ------------------
  |  Branch (123:9): [True: 31.3k, False: 6.39M]
  ------------------
  124|   595k|        case TX_64X64: MERGE_CTX(a, uint32_t, TX_64X64);
  ------------------
  |  |  107|   595k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [True: 595k, Folded]
  |  |  ------------------
  |  |  108|   595k|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|   595k|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|   595k|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|   595k|        } else \
  |  |  112|  18.4E|            l##dir = *(const type *) dir; \
  |  |  113|   595k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 595k]
  |  |  ------------------
  |  |  114|   595k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 595k, Folded]
  |  |  ------------------
  |  |  115|   595k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 595k, Folded]
  |  |  ------------------
  |  |  116|   595k|        break
  ------------------
  |  Branch (124:9): [True: 595k, False: 5.83M]
  ------------------
  125|  6.42M|        }
  126|  8.84M|        switch (t_dim->lh) {
  127|      0|        default: assert(0); /* fall-through */
  ------------------
  |  Branch (127:9): [True: 0, False: 8.84M]
  |  Branch (127:18): [Folded, False: 0]
  ------------------
  128|  7.20M|        case TX_4X4:   MERGE_CTX(l, uint8_t,  TX_4X4);
  ------------------
  |  |  107|  7.20M|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 7.20M]
  |  |  ------------------
  |  |  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|  7.20M|            l##dir = *(const type *) dir; \
  |  |  113|  7.20M|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 7.20M]
  |  |  ------------------
  |  |  114|  7.20M|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [Folded, False: 7.20M]
  |  |  ------------------
  |  |  115|  7.20M|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [Folded, False: 7.20M]
  |  |  ------------------
  |  |  116|  7.20M|        break
  ------------------
  |  Branch (128:9): [True: 7.20M, False: 1.63M]
  ------------------
  129|   712k|        case TX_8X8:   MERGE_CTX(l, uint16_t, TX_8X8);
  ------------------
  |  |  107|   712k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 712k]
  |  |  ------------------
  |  |  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|   712k|            l##dir = *(const type *) dir; \
  |  |  113|   712k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 712k]
  |  |  ------------------
  |  |  114|   712k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [Folded, False: 712k]
  |  |  ------------------
  |  |  115|   712k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 712k, Folded]
  |  |  ------------------
  |  |  116|   712k|        break
  ------------------
  |  Branch (129:9): [True: 712k, False: 8.12M]
  ------------------
  130|   315k|        case TX_16X16: MERGE_CTX(l, uint32_t, TX_16X16);
  ------------------
  |  |  107|   315k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 315k]
  |  |  ------------------
  |  |  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|   315k|            l##dir = *(const type *) dir; \
  |  |  113|   315k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 315k]
  |  |  ------------------
  |  |  114|   315k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 315k, Folded]
  |  |  ------------------
  |  |  115|   315k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 315k, Folded]
  |  |  ------------------
  |  |  116|   315k|        break
  ------------------
  |  Branch (130:9): [True: 315k, False: 8.52M]
  ------------------
  131|  30.2k|        case TX_32X32: MERGE_CTX(l, uint32_t, TX_32X32);
  ------------------
  |  |  107|  30.2k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 30.2k]
  |  |  ------------------
  |  |  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|  30.2k|            l##dir = *(const type *) dir; \
  |  |  113|  30.2k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 30.2k, Folded]
  |  |  ------------------
  |  |  114|  30.2k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 30.2k, Folded]
  |  |  ------------------
  |  |  115|  30.2k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 30.2k, Folded]
  |  |  ------------------
  |  |  116|  30.2k|        break
  ------------------
  |  Branch (131:9): [True: 30.2k, False: 8.81M]
  ------------------
  132|   596k|        case TX_64X64: MERGE_CTX(l, uint32_t, TX_64X64);
  ------------------
  |  |  107|   596k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [True: 596k, Folded]
  |  |  ------------------
  |  |  108|   596k|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|   596k|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|   596k|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|   596k|        } else \
  |  |  112|  18.4E|            l##dir = *(const type *) dir; \
  |  |  113|   596k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 596k]
  |  |  ------------------
  |  |  114|   596k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 596k, Folded]
  |  |  ------------------
  |  |  115|   596k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 596k, Folded]
  |  |  ------------------
  |  |  116|   596k|        break
  ------------------
  |  Branch (132:9): [True: 596k, False: 8.24M]
  ------------------
  133|  8.84M|        }
  134|  8.84M|#undef MERGE_CTX
  135|       |
  136|  8.84M|        return dav1d_skip_ctx[umin(la & 0x3F, 4)][umin(ll & 0x3F, 4)];
  137|  8.84M|    }
  138|  40.5M|}
recon_tmpl.c:get_lo_ctx:
  304|   201M|{
  305|   201M|    unsigned mag = levels[0 * stride + 1] + levels[1 * stride + 0];
  306|   201M|    unsigned offset;
  307|   201M|    if (tx_class == TX_CLASS_2D) {
  ------------------
  |  Branch (307:9): [True: 190M, False: 10.5M]
  ------------------
  308|   190M|        mag += levels[1 * stride + 1];
  309|   190M|        *hi_mag = mag;
  310|   190M|        mag += levels[0 * stride + 2] + levels[2 * stride + 0];
  311|   190M|        offset = ctx_offsets[umin(y, 4)][umin(x, 4)];
  312|   190M|    } else {
  313|  10.5M|        mag += levels[0 * stride + 2];
  314|  10.5M|        *hi_mag = mag;
  315|  10.5M|        mag += levels[0 * stride + 3] + levels[0 * stride + 4];
  316|  10.5M|        offset = 26 + (y > 1 ? 10 : y * 5);
  ------------------
  |  Branch (316:24): [True: 6.93M, False: 3.64M]
  ------------------
  317|  10.5M|    }
  318|   201M|    return offset + (mag > 512 ? 4 : (mag + 64) >> 7);
  ------------------
  |  Branch (318:22): [True: 9.69M, False: 191M]
  ------------------
  319|   201M|}
recon_tmpl.c:get_dc_sign_ctx:
  143|  14.0M|{
  144|  14.0M|    uint64_t mask = 0xC0C0C0C0C0C0C0C0ULL, mul = 0x0101010101010101ULL;
  145|  14.0M|    int s;
  146|       |
  147|  14.0M|#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|  14.0M|    __asm__("" : "+r"(mask), "+r"(mul));
  151|  14.0M|#endif
  152|       |
  153|  14.0M|    switch(tx) {
  154|      0|    default: assert(0); /* fall-through */
  ------------------
  |  Branch (154:5): [True: 0, False: 14.0M]
  |  Branch (154:14): [Folded, False: 0]
  ------------------
  155|  5.80M|    case TX_4X4: {
  ------------------
  |  Branch (155:5): [True: 5.80M, False: 8.27M]
  ------------------
  156|  5.80M|        int t = *(const uint8_t *) a >> 6;
  157|  5.80M|        t    += *(const uint8_t *) l >> 6;
  158|  5.80M|        s = t - 1 - 1;
  159|  5.80M|        break;
  160|      0|    }
  161|  1.37M|    case TX_8X8: {
  ------------------
  |  Branch (161:5): [True: 1.37M, False: 12.7M]
  ------------------
  162|  1.37M|        uint32_t t = *(const uint16_t *) a & (uint32_t) mask;
  163|  1.37M|        t         += *(const uint16_t *) l & (uint32_t) mask;
  164|  1.37M|        t *= 0x04040404U;
  165|  1.37M|        s = (int) (t >> 24) - 2 - 2;
  166|  1.37M|        break;
  167|      0|    }
  168|   900k|    case TX_16X16: {
  ------------------
  |  Branch (168:5): [True: 900k, False: 13.1M]
  ------------------
  169|   900k|        uint32_t t = (*(const uint32_t *) a & (uint32_t) mask) >> 6;
  170|   900k|        t         += (*(const uint32_t *) l & (uint32_t) mask) >> 6;
  171|   900k|        t *= (uint32_t) mul;
  172|   900k|        s = (int) (t >> 24) - 4 - 4;
  173|   900k|        break;
  174|      0|    }
  175|  1.51M|    case TX_32X32: {
  ------------------
  |  Branch (175:5): [True: 1.51M, False: 12.5M]
  ------------------
  176|  1.51M|        uint64_t t = (*(const uint64_t *) a & mask) >> 6;
  177|  1.51M|        t         += (*(const uint64_t *) l & mask) >> 6;
  178|  1.51M|        t *= mul;
  179|  1.51M|        s = (int) (t >> 56) - 8 - 8;
  180|  1.51M|        break;
  181|      0|    }
  182|   512k|    case TX_64X64: {
  ------------------
  |  Branch (182:5): [True: 512k, False: 13.5M]
  ------------------
  183|   512k|        uint64_t t = (*(const uint64_t *) &a[0] & mask) >> 6;
  184|   512k|        t         += (*(const uint64_t *) &a[8] & mask) >> 6;
  185|   512k|        t         += (*(const uint64_t *) &l[0] & mask) >> 6;
  186|   512k|        t         += (*(const uint64_t *) &l[8] & mask) >> 6;
  187|   512k|        t *= mul;
  188|   512k|        s = (int) (t >> 56) - 16 - 16;
  189|   512k|        break;
  190|      0|    }
  191|   417k|    case RTX_4X8: {
  ------------------
  |  Branch (191:5): [True: 417k, False: 13.6M]
  ------------------
  192|   417k|        uint32_t t = *(const uint8_t  *) a & (uint32_t) mask;
  193|   417k|        t         += *(const uint16_t *) l & (uint32_t) mask;
  194|   417k|        t *= 0x04040404U;
  195|   417k|        s = (int) (t >> 24) - 1 - 2;
  196|   417k|        break;
  197|      0|    }
  198|   652k|    case RTX_8X4: {
  ------------------
  |  Branch (198:5): [True: 652k, False: 13.4M]
  ------------------
  199|   652k|        uint32_t t = *(const uint16_t *) a & (uint32_t) mask;
  200|   652k|        t         += *(const uint8_t  *) l & (uint32_t) mask;
  201|   652k|        t *= 0x04040404U;
  202|   652k|        s = (int) (t >> 24) - 2 - 1;
  203|   652k|        break;
  204|      0|    }
  205|   360k|    case RTX_8X16: {
  ------------------
  |  Branch (205:5): [True: 360k, False: 13.7M]
  ------------------
  206|   360k|        uint32_t t = *(const uint16_t *) a & (uint32_t) mask;
  207|   360k|        t         += *(const uint32_t *) l & (uint32_t) mask;
  208|   360k|        t = (t >> 6) * (uint32_t) mul;
  209|   360k|        s = (int) (t >> 24) - 2 - 4;
  210|   360k|        break;
  211|      0|    }
  212|   861k|    case RTX_16X8: {
  ------------------
  |  Branch (212:5): [True: 861k, False: 13.2M]
  ------------------
  213|   861k|        uint32_t t = *(const uint32_t *) a & (uint32_t) mask;
  214|   861k|        t         += *(const uint16_t *) l & (uint32_t) mask;
  215|   861k|        t = (t >> 6) * (uint32_t) mul;
  216|   861k|        s = (int) (t >> 24) - 4 - 2;
  217|   861k|        break;
  218|      0|    }
  219|   144k|    case RTX_16X32: {
  ------------------
  |  Branch (219:5): [True: 144k, False: 13.9M]
  ------------------
  220|   144k|        uint64_t t = *(const uint32_t *) a & (uint32_t) mask;
  221|   144k|        t         += *(const uint64_t *) l & mask;
  222|   144k|        t = (t >> 6) * mul;
  223|   144k|        s = (int) (t >> 56) - 4 - 8;
  224|   144k|        break;
  225|      0|    }
  226|   331k|    case RTX_32X16: {
  ------------------
  |  Branch (226:5): [True: 331k, False: 13.7M]
  ------------------
  227|   331k|        uint64_t t = *(const uint64_t *) a & mask;
  228|   331k|        t         += *(const uint32_t *) l & (uint32_t) mask;
  229|   331k|        t = (t >> 6) * mul;
  230|   331k|        s = (int) (t >> 56) - 8 - 4;
  231|   331k|        break;
  232|      0|    }
  233|  34.8k|    case RTX_32X64: {
  ------------------
  |  Branch (233:5): [True: 34.8k, False: 14.0M]
  ------------------
  234|  34.8k|        uint64_t t = (*(const uint64_t *) &a[0] & mask) >> 6;
  235|  34.8k|        t         += (*(const uint64_t *) &l[0] & mask) >> 6;
  236|  34.8k|        t         += (*(const uint64_t *) &l[8] & mask) >> 6;
  237|  34.8k|        t *= mul;
  238|  34.8k|        s = (int) (t >> 56) - 8 - 16;
  239|  34.8k|        break;
  240|      0|    }
  241|  53.0k|    case RTX_64X32: {
  ------------------
  |  Branch (241:5): [True: 53.0k, False: 14.0M]
  ------------------
  242|  53.0k|        uint64_t t = (*(const uint64_t *) &a[0] & mask) >> 6;
  243|  53.0k|        t         += (*(const uint64_t *) &a[8] & mask) >> 6;
  244|  53.0k|        t         += (*(const uint64_t *) &l[0] & mask) >> 6;
  245|  53.0k|        t *= mul;
  246|  53.0k|        s = (int) (t >> 56) - 16 - 8;
  247|  53.0k|        break;
  248|      0|    }
  249|   205k|    case RTX_4X16: {
  ------------------
  |  Branch (249:5): [True: 205k, False: 13.8M]
  ------------------
  250|   205k|        uint32_t t = *(const uint8_t  *) a & (uint32_t) mask;
  251|   205k|        t         += *(const uint32_t *) l & (uint32_t) mask;
  252|   205k|        t = (t >> 6) * (uint32_t) mul;
  253|   205k|        s = (int) (t >> 24) - 1 - 4;
  254|   205k|        break;
  255|      0|    }
  256|   473k|    case RTX_16X4: {
  ------------------
  |  Branch (256:5): [True: 473k, False: 13.6M]
  ------------------
  257|   473k|        uint32_t t = *(const uint32_t *) a & (uint32_t) mask;
  258|   473k|        t         += *(const uint8_t  *) l & (uint32_t) mask;
  259|   473k|        t = (t >> 6) * (uint32_t) mul;
  260|   473k|        s = (int) (t >> 24) - 4 - 1;
  261|   473k|        break;
  262|      0|    }
  263|   130k|    case RTX_8X32: {
  ------------------
  |  Branch (263:5): [True: 130k, False: 13.9M]
  ------------------
  264|   130k|        uint64_t t = *(const uint16_t *) a & (uint32_t) mask;
  265|   130k|        t         += *(const uint64_t *) l & mask;
  266|   130k|        t = (t >> 6) * mul;
  267|   130k|        s = (int) (t >> 56) - 2 - 8;
  268|   130k|        break;
  269|      0|    }
  270|   584k|    case RTX_32X8: {
  ------------------
  |  Branch (270:5): [True: 584k, False: 13.4M]
  ------------------
  271|   584k|        uint64_t t = *(const uint64_t *) a & mask;
  272|   584k|        t         += *(const uint16_t *) l & (uint32_t) mask;
  273|   584k|        t = (t >> 6) * mul;
  274|   584k|        s = (int) (t >> 56) - 8 - 2;
  275|   584k|        break;
  276|      0|    }
  277|  34.3k|    case RTX_16X64: {
  ------------------
  |  Branch (277:5): [True: 34.3k, False: 14.0M]
  ------------------
  278|  34.3k|        uint64_t t = *(const uint32_t *) a & (uint32_t) mask;
  279|  34.3k|        t         += *(const uint64_t *) &l[0] & mask;
  280|  34.3k|        t = (t >> 6) + ((*(const uint64_t *) &l[8] & mask) >> 6);
  281|  34.3k|        t *= mul;
  282|  34.3k|        s = (int) (t >> 56) - 4 - 16;
  283|  34.3k|        break;
  284|      0|    }
  285|  56.3k|    case RTX_64X16: {
  ------------------
  |  Branch (285:5): [True: 56.3k, False: 14.0M]
  ------------------
  286|  56.3k|        uint64_t t = *(const uint64_t *) &a[0] & mask;
  287|  56.3k|        t         += *(const uint32_t *) l & (uint32_t) mask;
  288|  56.3k|        t = (t >> 6) + ((*(const uint64_t *) &a[8] & mask) >> 6);
  289|  56.3k|        t *= mul;
  290|  56.3k|        s = (int) (t >> 56) - 16 - 4;
  291|  56.3k|        break;
  292|      0|    }
  293|  14.0M|    }
  294|       |
  295|  14.0M|    return (s != 0) + (s > 0);
  296|  14.0M|}
recon_tmpl.c:read_golomb:
   49|  2.31M|static inline unsigned read_golomb(MsacContext *const msac) {
   50|  2.31M|    int len = 0;
   51|  2.31M|    unsigned val = 1;
   52|       |
   53|  5.18M|    while (!dav1d_msac_decode_bool_equi(msac) && len < 32) len++;
  ------------------
  |  |   53|  5.18M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (53:12): [True: 2.86M, False: 2.31M]
  |  Branch (53:50): [True: 2.86M, False: 139]
  ------------------
   54|  5.19M|    while (len--) val = (val << 1) + dav1d_msac_decode_bool_equi(msac);
  ------------------
  |  |   53|  2.87M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (54:12): [True: 2.87M, False: 2.31M]
  ------------------
   55|       |
   56|  2.31M|    return val - 1;
   57|  2.31M|}
recon_tmpl.c:mc:
  944|  9.09M|{
  945|  9.09M|    assert((dst8 != NULL) ^ (dst16 != NULL));
  ------------------
  |  Branch (945:5): [True: 9.09M, False: 18.4E]
  ------------------
  946|  9.09M|    const Dav1dFrameContext *const f = t->f;
  947|  9.09M|    const int ss_ver = !!pl && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (947:24): [True: 3.78M, False: 5.30M]
  |  Branch (947:32): [True: 3.18M, False: 599k]
  ------------------
  948|  9.09M|    const int ss_hor = !!pl && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (948:24): [True: 3.78M, False: 5.30M]
  |  Branch (948:32): [True: 3.19M, False: 593k]
  ------------------
  949|  9.09M|    const int h_mul = 4 >> ss_hor, v_mul = 4 >> ss_ver;
  950|  9.09M|    const int mvx = mv.x, mvy = mv.y;
  951|  9.09M|    const int mx = mvx & (15 >> !ss_hor), my = mvy & (15 >> !ss_ver);
  952|  9.09M|    ptrdiff_t ref_stride = refp->p.stride[!!pl];
  953|  9.09M|    const pixel *ref;
  954|       |
  955|  9.09M|    if (refp->p.p.w == f->cur.p.w && refp->p.p.h == f->cur.p.h) {
  ------------------
  |  Branch (955:9): [True: 8.61M, False: 475k]
  |  Branch (955:38): [True: 8.47M, False: 139k]
  ------------------
  956|  8.48M|        const int dx = bx * h_mul + (mvx >> (3 + ss_hor));
  957|  8.48M|        const int dy = by * v_mul + (mvy >> (3 + ss_ver));
  958|  8.48M|        int w, h;
  959|       |
  960|  8.48M|        if (refp->p.data[0] != f->cur.data[0]) { // i.e. not for intrabc
  ------------------
  |  Branch (960:13): [True: 8.45M, False: 25.7k]
  ------------------
  961|  8.45M|            w = (f->cur.p.w + ss_hor) >> ss_hor;
  962|  8.45M|            h = (f->cur.p.h + ss_ver) >> ss_ver;
  963|  8.45M|        } else {
  964|  25.7k|            w = f->bw * 4 >> ss_hor;
  965|  25.7k|            h = f->bh * 4 >> ss_ver;
  966|  25.7k|        }
  967|  8.48M|        if (dx < !!mx * 3 || dy < !!my * 3 ||
  ------------------
  |  Branch (967:13): [True: 78.3k, False: 8.40M]
  |  Branch (967:30): [True: 66.3k, False: 8.33M]
  ------------------
  968|  8.33M|            dx + bw4 * h_mul + !!mx * 4 > w ||
  ------------------
  |  Branch (968:13): [True: 2.81M, False: 5.52M]
  ------------------
  969|  5.52M|            dy + bh4 * v_mul + !!my * 4 > h)
  ------------------
  |  Branch (969:13): [True: 85.6k, False: 5.43M]
  ------------------
  970|  3.07M|        {
  971|  3.07M|            pixel *const emu_edge_buf = bitfn(t->scratch.emu_edge);
  ------------------
  |  |   51|  3.07M|#define bitfn(x) x##_8bpc
  ------------------
  972|  3.07M|            f->dsp->mc.emu_edge(bw4 * h_mul + !!mx * 7, bh4 * v_mul + !!my * 7,
  973|  3.07M|                                w, h, dx - !!mx * 3, dy - !!my * 3,
  974|  3.07M|                                emu_edge_buf, 192 * sizeof(pixel),
  975|  3.07M|                                refp->p.data[pl], ref_stride);
  976|  3.07M|            ref = &emu_edge_buf[192 * !!my * 3 + !!mx * 3];
  977|  3.07M|            ref_stride = 192 * sizeof(pixel);
  978|  5.41M|        } else {
  979|  5.41M|            ref = ((pixel *) refp->p.data[pl]) + PXSTRIDE(ref_stride) * dy + dx;
  ------------------
  |  |   53|  5.41M|#define PXSTRIDE(x) (x)
  ------------------
  980|  5.41M|        }
  981|       |
  982|  8.48M|        if (dst8 != NULL) {
  ------------------
  |  Branch (982:13): [True: 8.12M, False: 354k]
  ------------------
  983|  8.12M|            f->dsp->mc.mc[filter_2d](dst8, dst_stride, ref, ref_stride, bw4 * h_mul,
  984|  8.12M|                                     bh4 * v_mul, mx << !ss_hor, my << !ss_ver
  985|  8.12M|                                     HIGHBD_CALL_SUFFIX);
  986|  8.12M|        } else {
  987|   354k|            f->dsp->mc.mct[filter_2d](dst16, ref, ref_stride, bw4 * h_mul,
  988|   354k|                                      bh4 * v_mul, mx << !ss_hor, my << !ss_ver
  989|   354k|                                      HIGHBD_CALL_SUFFIX);
  990|   354k|        }
  991|  8.48M|    } else {
  992|   614k|        assert(refp != &f->sr_cur);
  ------------------
  |  Branch (992:9): [True: 629k, False: 18.4E]
  ------------------
  993|       |
  994|   629k|        const int orig_pos_y = (by * v_mul << 4) + mvy * (1 << !ss_ver);
  995|   629k|        const int orig_pos_x = (bx * h_mul << 4) + mvx * (1 << !ss_hor);
  996|   629k|#define scale_mv(res, val, scale) do { \
  997|   629k|            const int64_t tmp = (int64_t)(val) * scale + (scale - 0x4000) * 8; \
  998|   629k|            res = apply_sign64((int) ((llabs(tmp) + 128) >> 8), tmp) + 32;     \
  999|   629k|        } while (0)
 1000|   629k|        int pos_y, pos_x;
 1001|   629k|        scale_mv(pos_x, orig_pos_x, f->svc[refidx][0].scale);
  ------------------
  |  |  996|   629k|#define scale_mv(res, val, scale) do { \
  |  |  997|   629k|            const int64_t tmp = (int64_t)(val) * scale + (scale - 0x4000) * 8; \
  |  |  998|   629k|            res = apply_sign64((int) ((llabs(tmp) + 128) >> 8), tmp) + 32;     \
  |  |  999|   629k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (999:18): [Folded, False: 629k]
  |  |  ------------------
  ------------------
 1002|   629k|        scale_mv(pos_y, orig_pos_y, f->svc[refidx][1].scale);
  ------------------
  |  |  996|   629k|#define scale_mv(res, val, scale) do { \
  |  |  997|   629k|            const int64_t tmp = (int64_t)(val) * scale + (scale - 0x4000) * 8; \
  |  |  998|   629k|            res = apply_sign64((int) ((llabs(tmp) + 128) >> 8), tmp) + 32;     \
  |  |  999|   629k|        } while (0)
  |  |  ------------------
  |  |  |  Branch (999:18): [Folded, False: 629k]
  |  |  ------------------
  ------------------
 1003|   629k|#undef scale_mv
 1004|   629k|        const int left = pos_x >> 10;
 1005|   629k|        const int top = pos_y >> 10;
 1006|   629k|        const int right =
 1007|   629k|            ((pos_x + (bw4 * h_mul - 1) * f->svc[refidx][0].step) >> 10) + 1;
 1008|   629k|        const int bottom =
 1009|   629k|            ((pos_y + (bh4 * v_mul - 1) * f->svc[refidx][1].step) >> 10) + 1;
 1010|       |
 1011|   629k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
 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|   629k|        const int w = (refp->p.p.w + ss_hor) >> ss_hor;
 1018|   629k|        const int h = (refp->p.p.h + ss_ver) >> ss_ver;
 1019|   629k|        if (left < 3 || top < 3 || right + 4 > w || bottom + 4 > h) {
  ------------------
  |  Branch (1019:13): [True: 238k, False: 391k]
  |  Branch (1019:25): [True: 35.0k, False: 356k]
  |  Branch (1019:36): [True: 61.5k, False: 295k]
  |  Branch (1019:53): [True: 19.3k, False: 275k]
  ------------------
 1020|   355k|            pixel *const emu_edge_buf = bitfn(t->scratch.emu_edge);
  ------------------
  |  |   51|   355k|#define bitfn(x) x##_8bpc
  ------------------
 1021|   355k|            f->dsp->mc.emu_edge(right - left + 7, bottom - top + 7,
 1022|   355k|                                w, h, left - 3, top - 3,
 1023|   355k|                                emu_edge_buf, 320 * sizeof(pixel),
 1024|   355k|                                refp->p.data[pl], ref_stride);
 1025|   355k|            ref = &emu_edge_buf[320 * 3 + 3];
 1026|   355k|            ref_stride = 320 * sizeof(pixel);
 1027|   355k|            if (DEBUG_BLOCK_INFO) printf("Emu\n");
  ------------------
  |  |   34|   355k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 355k]
  |  |  ------------------
  |  |   35|   355k|        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|   355k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1028|   355k|        } else {
 1029|   274k|            ref = ((pixel *) refp->p.data[pl]) + PXSTRIDE(ref_stride) * top + left;
  ------------------
  |  |   53|   274k|#define PXSTRIDE(x) (x)
  ------------------
 1030|   274k|        }
 1031|       |
 1032|   629k|        if (dst8 != NULL) {
  ------------------
  |  Branch (1032:13): [True: 530k, False: 99.4k]
  ------------------
 1033|   530k|            f->dsp->mc.mc_scaled[filter_2d](dst8, dst_stride, ref, ref_stride,
 1034|   530k|                                            bw4 * h_mul, bh4 * v_mul,
 1035|   530k|                                            pos_x & 0x3ff, pos_y & 0x3ff,
 1036|   530k|                                            f->svc[refidx][0].step,
 1037|   530k|                                            f->svc[refidx][1].step
 1038|   530k|                                            HIGHBD_CALL_SUFFIX);
 1039|   530k|        } else {
 1040|  99.4k|            f->dsp->mc.mct_scaled[filter_2d](dst16, ref, ref_stride,
 1041|  99.4k|                                             bw4 * h_mul, bh4 * v_mul,
 1042|  99.4k|                                             pos_x & 0x3ff, pos_y & 0x3ff,
 1043|  99.4k|                                             f->svc[refidx][0].step,
 1044|  99.4k|                                             f->svc[refidx][1].step
 1045|  99.4k|                                             HIGHBD_CALL_SUFFIX);
 1046|  99.4k|        }
 1047|   629k|    }
 1048|       |
 1049|  9.10M|    return 0;
 1050|  9.09M|}
recon_tmpl.c:warp_affine:
 1120|  1.44M|{
 1121|  1.44M|    assert((dst8 != NULL) ^ (dst16 != NULL));
  ------------------
  |  Branch (1121:5): [True: 1.44M, False: 18.4E]
  ------------------
 1122|  1.44M|    const Dav1dFrameContext *const f = t->f;
 1123|  1.44M|    const Dav1dDSPContext *const dsp = f->dsp;
 1124|  1.44M|    const int ss_ver = !!pl && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (1124:24): [True: 224k, False: 1.21M]
  |  Branch (1124:32): [True: 180k, False: 43.8k]
  ------------------
 1125|  1.44M|    const int ss_hor = !!pl && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (1125:24): [True: 224k, False: 1.21M]
  |  Branch (1125:32): [True: 180k, False: 43.7k]
  ------------------
 1126|  1.44M|    const int h_mul = 4 >> ss_hor, v_mul = 4 >> ss_ver;
 1127|  1.44M|    assert(!((b_dim[0] * h_mul) & 7) && !((b_dim[1] * v_mul) & 7));
  ------------------
  |  Branch (1127:5): [True: 1.44M, False: 8]
  |  Branch (1127:5): [True: 1.44M, False: 9]
  ------------------
 1128|  1.44M|    const int32_t *const mat = wmp->matrix;
 1129|  1.44M|    const int width = (refp->p.p.w + ss_hor) >> ss_hor;
 1130|  1.44M|    const int height = (refp->p.p.h + ss_ver) >> ss_ver;
 1131|       |
 1132|  17.4M|    for (int y = 0; y < b_dim[1] * v_mul; y += 8) {
  ------------------
  |  Branch (1132:21): [True: 15.9M, False: 1.44M]
  ------------------
 1133|  15.9M|        const int src_y = t->by * 4 + ((y + 4) << ss_ver);
 1134|  15.9M|        const int64_t mat3_y = (int64_t) mat[3] * src_y + mat[0];
 1135|  15.9M|        const int64_t mat5_y = (int64_t) mat[5] * src_y + mat[1];
 1136|   210M|        for (int x = 0; x < b_dim[0] * h_mul; x += 8) {
  ------------------
  |  Branch (1136:25): [True: 194M, False: 15.9M]
  ------------------
 1137|       |            // calculate transformation relative to center of 8x8 block in
 1138|       |            // luma pixel units
 1139|   194M|            const int src_x = t->bx * 4 + ((x + 4) << ss_hor);
 1140|   194M|            const int64_t mvx = ((int64_t) mat[2] * src_x + mat3_y) >> ss_hor;
 1141|   194M|            const int64_t mvy = ((int64_t) mat[4] * src_x + mat5_y) >> ss_ver;
 1142|       |
 1143|   194M|            const int dx = (int) (mvx >> 16) - 4;
 1144|   194M|            const int mx = (((int) mvx & 0xffff) - wmp->u.p.alpha * 4 -
 1145|   194M|                                                   wmp->u.p.beta  * 7) & ~0x3f;
 1146|   194M|            const int dy = (int) (mvy >> 16) - 4;
 1147|   194M|            const int my = (((int) mvy & 0xffff) - wmp->u.p.gamma * 4 -
 1148|   194M|                                                   wmp->u.p.delta * 4) & ~0x3f;
 1149|       |
 1150|   194M|            const pixel *ref_ptr;
 1151|   194M|            ptrdiff_t ref_stride = refp->p.stride[!!pl];
 1152|       |
 1153|   194M|            if (dx < 3 || dx + 8 + 4 > width || dy < 3 || dy + 8 + 4 > height) {
  ------------------
  |  Branch (1153:17): [True: 9.89M, False: 184M]
  |  Branch (1153:27): [True: 54.4M, False: 129M]
  |  Branch (1153:49): [True: 94.1k, False: 129M]
  |  Branch (1153:59): [True: 382k, False: 128M]
  ------------------
 1154|  80.6M|                pixel *const emu_edge_buf = bitfn(t->scratch.emu_edge);
  ------------------
  |  |   51|  80.6M|#define bitfn(x) x##_8bpc
  ------------------
 1155|  80.6M|                f->dsp->mc.emu_edge(15, 15, width, height, dx - 3, dy - 3,
 1156|  80.6M|                                    emu_edge_buf, 32 * sizeof(pixel),
 1157|  80.6M|                                    refp->p.data[pl], ref_stride);
 1158|  80.6M|                ref_ptr = &emu_edge_buf[32 * 3 + 3];
 1159|  80.6M|                ref_stride = 32 * sizeof(pixel);
 1160|   113M|            } else {
 1161|   113M|                ref_ptr = ((pixel *) refp->p.data[pl]) + PXSTRIDE(ref_stride) * dy + dx;
  ------------------
  |  |   53|   113M|#define PXSTRIDE(x) (x)
  ------------------
 1162|   113M|            }
 1163|   194M|            if (dst16 != NULL)
  ------------------
  |  Branch (1163:17): [True: 53.6k, False: 194M]
  ------------------
 1164|  53.6k|                dsp->mc.warp8x8t(&dst16[x], dstride, ref_ptr, ref_stride,
 1165|  53.6k|                                 wmp->u.abcd, mx, my HIGHBD_CALL_SUFFIX);
 1166|   194M|            else
 1167|   194M|                dsp->mc.warp8x8(&dst8[x], dstride, ref_ptr, ref_stride,
 1168|   194M|                                wmp->u.abcd, mx, my HIGHBD_CALL_SUFFIX);
 1169|   194M|        }
 1170|  16.0M|        if (dst8) dst8  += 8 * PXSTRIDE(dstride);
  ------------------
  |  |   53|  16.0M|#define PXSTRIDE(x) (x)
  ------------------
  |  Branch (1170:13): [True: 16.0M, False: 18.4E]
  ------------------
 1171|  18.4E|        else      dst16 += 8 * dstride;
 1172|  15.9M|    }
 1173|  1.44M|    return 0;
 1174|  1.44M|}
recon_tmpl.c:obmc:
 1056|  1.10M|{
 1057|  1.10M|    assert(!(t->bx & 1) && !(t->by & 1));
  ------------------
  |  Branch (1057:5): [True: 1.10M, False: 18.4E]
  |  Branch (1057:5): [True: 1.10M, False: 18.4E]
  ------------------
 1058|  1.10M|    const Dav1dFrameContext *const f = t->f;
 1059|  1.10M|    /*const*/ refmvs_block **r = &t->rt.r[(t->by & 31) + 5];
 1060|  1.10M|    pixel *const lap = bitfn(t->scratch.lap);
  ------------------
  |  |   51|  1.10M|#define bitfn(x) x##_8bpc
  ------------------
 1061|  1.10M|    const int ss_ver = !!pl && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (1061:24): [True: 729k, False: 379k]
  |  Branch (1061:32): [True: 616k, False: 112k]
  ------------------
 1062|  1.10M|    const int ss_hor = !!pl && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (1062:24): [True: 729k, False: 379k]
  |  Branch (1062:32): [True: 617k, False: 112k]
  ------------------
 1063|  1.10M|    const int h_mul = 4 >> ss_hor, v_mul = 4 >> ss_ver;
 1064|  1.10M|    int res;
 1065|       |
 1066|  1.10M|    if (t->by > t->ts->tiling.row_start &&
  ------------------
  |  Branch (1066:9): [True: 1.07M, False: 29.8k]
  ------------------
 1067|  1.07M|        (!pl || b_dim[0] * h_mul + b_dim[1] * v_mul >= 16))
  ------------------
  |  Branch (1067:10): [True: 367k, False: 711k]
  |  Branch (1067:17): [True: 240k, False: 470k]
  ------------------
 1068|   612k|    {
 1069|  1.30M|        for (int i = 0, x = 0; x < w4 && i < imin(b_dim[2], 4); ) {
  ------------------
  |  Branch (1069:32): [True: 692k, False: 610k]
  |  Branch (1069:42): [True: 690k, False: 1.99k]
  ------------------
 1070|       |            // only odd blocks are considered for overlap handling, hence +1
 1071|   690k|            const refmvs_block *const a_r = &r[-1][t->bx + x + 1];
 1072|   690k|            const uint8_t *const a_b_dim = dav1d_block_dimensions[a_r->bs];
 1073|   690k|            const int step4 = iclip(a_b_dim[0], 2, 16);
 1074|       |
 1075|   690k|            if (a_r->ref.ref[0] > 0) {
  ------------------
  |  Branch (1075:17): [True: 664k, False: 25.8k]
  ------------------
 1076|   664k|                const int ow4 = imin(step4, b_dim[0]);
 1077|   664k|                const int oh4 = imin(b_dim[1], 16) >> 1;
 1078|   664k|                res = mc(t, lap, NULL, ow4 * h_mul * sizeof(pixel), ow4, (oh4 * 3 + 3) >> 2,
 1079|   664k|                         t->bx + x, t->by, pl, a_r->mv.mv[0],
 1080|   664k|                         &f->refp[a_r->ref.ref[0] - 1], a_r->ref.ref[0] - 1,
 1081|   664k|                         dav1d_filter_2d[t->a->filter[1][bx4 + x + 1]][t->a->filter[0][bx4 + x + 1]]);
 1082|   664k|                if (res) return res;
  ------------------
  |  Branch (1082:21): [True: 0, False: 664k]
  ------------------
 1083|   664k|                f->dsp->mc.blend_h(&dst[x * h_mul], dst_stride, lap,
 1084|   664k|                                   h_mul * ow4, v_mul * oh4);
 1085|   664k|                i++;
 1086|   664k|            }
 1087|   690k|            x += step4;
 1088|   690k|        }
 1089|   612k|    }
 1090|       |
 1091|  1.10M|    if (t->bx > t->ts->tiling.col_start)
  ------------------
  |  Branch (1091:9): [True: 1.09M, False: 16.1k]
  ------------------
 1092|  2.26M|        for (int i = 0, y = 0; y < h4 && i < imin(b_dim[3], 4); ) {
  ------------------
  |  Branch (1092:32): [True: 1.17M, False: 1.08M]
  |  Branch (1092:42): [True: 1.17M, False: 3.12k]
  ------------------
 1093|       |            // only odd blocks are considered for overlap handling, hence +1
 1094|  1.17M|            const refmvs_block *const l_r = &r[y + 1][t->bx - 1];
 1095|  1.17M|            const uint8_t *const l_b_dim = dav1d_block_dimensions[l_r->bs];
 1096|  1.17M|            const int step4 = iclip(l_b_dim[1], 2, 16);
 1097|       |
 1098|  1.17M|            if (l_r->ref.ref[0] > 0) {
  ------------------
  |  Branch (1098:17): [True: 1.12M, False: 43.8k]
  ------------------
 1099|  1.12M|                const int ow4 = imin(b_dim[0], 16) >> 1;
 1100|  1.12M|                const int oh4 = imin(step4, b_dim[1]);
 1101|  1.12M|                res = mc(t, lap, NULL, h_mul * ow4 * sizeof(pixel), ow4, oh4,
 1102|  1.12M|                         t->bx, t->by + y, pl, l_r->mv.mv[0],
 1103|  1.12M|                         &f->refp[l_r->ref.ref[0] - 1], l_r->ref.ref[0] - 1,
 1104|  1.12M|                         dav1d_filter_2d[t->l.filter[1][by4 + y + 1]][t->l.filter[0][by4 + y + 1]]);
 1105|  1.12M|                if (res) return res;
  ------------------
  |  Branch (1105:21): [True: 0, False: 1.12M]
  ------------------
 1106|  1.12M|                f->dsp->mc.blend_v(&dst[y * v_mul * PXSTRIDE(dst_stride)],
  ------------------
  |  |   53|  1.12M|#define PXSTRIDE(x) (x)
  ------------------
 1107|  1.12M|                                   dst_stride, lap, h_mul * ow4, v_mul * oh4);
 1108|  1.12M|                i++;
 1109|  1.12M|            }
 1110|  1.17M|            y += step4;
 1111|  1.17M|        }
 1112|  1.10M|    return 0;
 1113|  1.10M|}
dav1d_read_coef_blocks_16bpc:
  826|  9.95M|{
  827|  9.95M|    const Dav1dFrameContext *const f = t->f;
  828|  9.95M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  829|  9.95M|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  830|  9.95M|    const int bx4 = t->bx & 31, by4 = t->by & 31;
  831|  9.95M|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
  832|  9.95M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  833|  9.95M|    const int bw4 = b_dim[0], bh4 = b_dim[1];
  834|  9.95M|    const int cbw4 = (bw4 + ss_hor) >> ss_hor, cbh4 = (bh4 + ss_ver) >> ss_ver;
  835|  9.95M|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (835:28): [True: 5.31M, False: 4.63M]
  ------------------
  836|  5.31M|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (836:29): [True: 4.88M, False: 429k]
  |  Branch (836:45): [True: 208k, False: 220k]
  ------------------
  837|  5.11M|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (837:29): [True: 4.75M, False: 366k]
  |  Branch (837:45): [True: 182k, False: 184k]
  ------------------
  838|       |
  839|  9.95M|    if (b->skip) {
  ------------------
  |  Branch (839:9): [True: 5.31M, False: 4.64M]
  ------------------
  840|  5.31M|        BlockContext *const a = t->a;
  841|  5.31M|        dav1d_memset_pow2[b_dim[2]](&a->lcoef[bx4], 0x40);
  842|  5.31M|        dav1d_memset_pow2[b_dim[3]](&t->l.lcoef[by4], 0x40);
  843|  5.31M|        if (has_chroma) {
  ------------------
  |  Branch (843:13): [True: 1.02M, False: 4.29M]
  ------------------
  844|  1.02M|            dav1d_memset_pow2_fn memset_cw = dav1d_memset_pow2[ulog2(cbw4)];
  845|  1.02M|            dav1d_memset_pow2_fn memset_ch = dav1d_memset_pow2[ulog2(cbh4)];
  846|  1.02M|            memset_cw(&a->ccoef[0][cbx4], 0x40);
  847|  1.02M|            memset_cw(&a->ccoef[1][cbx4], 0x40);
  848|  1.02M|            memset_ch(&t->l.ccoef[0][cby4], 0x40);
  849|  1.02M|            memset_ch(&t->l.ccoef[1][cby4], 0x40);
  850|  1.02M|        }
  851|  5.31M|        return;
  852|  5.31M|    }
  853|       |
  854|  4.64M|    Dav1dTileState *const ts = t->ts;
  855|  4.64M|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
  856|  4.64M|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
  857|  4.64M|    assert(t->frame_thread.pass == 1);
  ------------------
  |  Branch (857:5): [True: 4.64M, False: 18.4E]
  ------------------
  858|  4.64M|    assert(!b->skip);
  ------------------
  |  Branch (858:5): [True: 4.64M, False: 18.4E]
  ------------------
  859|  4.64M|    const TxfmInfo *const uv_t_dim = &dav1d_txfm_dimensions[b->uvtx];
  860|  4.64M|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[b->intra ? b->tx : b->max_ytx];
  ------------------
  |  Branch (860:58): [True: 3.54M, False: 1.10M]
  ------------------
  861|  4.64M|    const uint16_t tx_split[2] = { b->tx_split0, b->tx_split1 };
  862|       |
  863|  9.39M|    for (int init_y = 0; init_y < h4; init_y += 16) {
  ------------------
  |  Branch (863:26): [True: 4.74M, False: 4.64M]
  ------------------
  864|  4.74M|        const int sub_h4 = imin(h4, 16 + init_y);
  865|  9.63M|        for (int init_x = 0; init_x < w4; init_x += 16) {
  ------------------
  |  Branch (865:30): [True: 4.88M, False: 4.74M]
  ------------------
  866|  4.88M|            const int sub_w4 = imin(w4, init_x + 16);
  867|  4.88M|            int y_off = !!init_y, y, x;
  868|  10.2M|            for (y = init_y, t->by += init_y; y < sub_h4;
  ------------------
  |  Branch (868:47): [True: 5.40M, False: 4.88M]
  ------------------
  869|  5.40M|                 y += t_dim->h, t->by += t_dim->h, y_off++)
  870|  5.40M|            {
  871|  5.40M|                int x_off = !!init_x;
  872|  16.8M|                for (x = init_x, t->bx += init_x; x < sub_w4;
  ------------------
  |  Branch (872:51): [True: 11.4M, False: 5.40M]
  ------------------
  873|  11.4M|                     x += t_dim->w, t->bx += t_dim->w, x_off++)
  874|  11.4M|                {
  875|  11.4M|                    if (!b->intra) {
  ------------------
  |  Branch (875:25): [True: 4.03M, False: 7.43M]
  ------------------
  876|  4.03M|                        read_coef_tree(t, bs, b, b->max_ytx, 0, tx_split,
  877|  4.03M|                                       x_off, y_off, NULL);
  878|  7.43M|                    } else {
  879|  7.43M|                        uint8_t cf_ctx = 0x40;
  880|  7.43M|                        enum TxfmType txtp;
  881|  7.43M|                        const int eob =
  882|  7.43M|                            decode_coefs(t, &t->a->lcoef[bx4 + x],
  883|  7.43M|                                         &t->l.lcoef[by4 + y], b->tx, bs, b, 1,
  884|  7.43M|                                         0, ts->frame_thread[1].cf, &txtp, &cf_ctx);
  885|  7.43M|                        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  7.43M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 7.43M]
  |  |  ------------------
  |  |   35|  7.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|  7.43M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  886|      0|                            printf("Post-y-cf-blk[tx=%d,txtp=%d,eob=%d]: r=%d\n",
  887|      0|                                   b->tx, txtp, eob, ts->msac.rng);
  888|  7.43M|                        *ts->frame_thread[1].cbi++ = eob * (1 << 5) + txtp;
  889|  7.43M|                        ts->frame_thread[1].cf += imin(t_dim->w, 8) * imin(t_dim->h, 8) * 16;
  890|  7.43M|                        dav1d_memset_likely_pow2(&t->a->lcoef[bx4 + x], cf_ctx, imin(t_dim->w, f->bw - t->bx));
  891|  7.43M|                        dav1d_memset_likely_pow2(&t->l.lcoef[by4 + y], cf_ctx, imin(t_dim->h, f->bh - t->by));
  892|  7.43M|                    }
  893|  11.4M|                }
  894|  5.40M|                t->bx -= x;
  895|  5.40M|            }
  896|  4.88M|            t->by -= y;
  897|       |
  898|  4.88M|            if (!has_chroma) continue;
  ------------------
  |  Branch (898:17): [True: 727k, False: 4.15M]
  ------------------
  899|       |
  900|  4.15M|            const int sub_ch4 = imin(ch4, (init_y + 16) >> ss_ver);
  901|  4.15M|            const int sub_cw4 = imin(cw4, (init_x + 16) >> ss_hor);
  902|  12.0M|            for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (902:30): [True: 7.90M, False: 4.15M]
  ------------------
  903|  16.7M|                for (y = init_y >> ss_ver, t->by += init_y; y < sub_ch4;
  ------------------
  |  Branch (903:61): [True: 8.89M, False: 7.90M]
  ------------------
  904|  8.89M|                     y += uv_t_dim->h, t->by += uv_t_dim->h << ss_ver)
  905|  8.89M|                {
  906|  28.7M|                    for (x = init_x >> ss_hor, t->bx += init_x; x < sub_cw4;
  ------------------
  |  Branch (906:65): [True: 19.8M, False: 8.89M]
  ------------------
  907|  19.8M|                         x += uv_t_dim->w, t->bx += uv_t_dim->w << ss_hor)
  908|  19.8M|                    {
  909|  19.8M|                        uint8_t cf_ctx = 0x40;
  910|  19.8M|                        enum TxfmType txtp;
  911|  19.8M|                        if (!b->intra)
  ------------------
  |  Branch (911:29): [True: 7.22M, False: 12.6M]
  ------------------
  912|  7.22M|                            txtp = t->scratch.txtp_map[(by4 + (y << ss_ver)) * 32 +
  913|  7.22M|                                                        bx4 + (x << ss_hor)];
  914|  19.8M|                        const int eob =
  915|  19.8M|                            decode_coefs(t, &t->a->ccoef[pl][cbx4 + x],
  916|  19.8M|                                         &t->l.ccoef[pl][cby4 + y], b->uvtx, bs,
  917|  19.8M|                                         b, b->intra, 1 + pl, ts->frame_thread[1].cf,
  918|  19.8M|                                         &txtp, &cf_ctx);
  919|  19.8M|                        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  19.8M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 19.8M]
  |  |  ------------------
  |  |   35|  19.8M|        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|  19.8M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  920|      0|                            printf("Post-uv-cf-blk[pl=%d,tx=%d,"
  921|      0|                                   "txtp=%d,eob=%d]: r=%d\n",
  922|      0|                                   pl, b->uvtx, txtp, eob, ts->msac.rng);
  923|  19.8M|                        *ts->frame_thread[1].cbi++ = eob * (1 << 5) + txtp;
  924|  19.8M|                        ts->frame_thread[1].cf += uv_t_dim->w * uv_t_dim->h * 16;
  925|  19.8M|                        int ctw = imin(uv_t_dim->w, (f->bw - t->bx + ss_hor) >> ss_hor);
  926|  19.8M|                        int cth = imin(uv_t_dim->h, (f->bh - t->by + ss_ver) >> ss_ver);
  927|  19.8M|                        dav1d_memset_likely_pow2(&t->a->ccoef[pl][cbx4 + x], cf_ctx, ctw);
  928|  19.8M|                        dav1d_memset_likely_pow2(&t->l.ccoef[pl][cby4 + y], cf_ctx, cth);
  929|  19.8M|                    }
  930|  8.89M|                    t->bx -= x << ss_hor;
  931|  8.89M|                }
  932|  7.90M|                t->by -= y << ss_ver;
  933|  7.90M|            }
  934|  4.15M|        }
  935|  4.74M|    }
  936|  4.64M|}
dav1d_recon_b_intra_16bpc:
 1179|   760k|{
 1180|   760k|    Dav1dTileState *const ts = t->ts;
 1181|   760k|    const Dav1dFrameContext *const f = t->f;
 1182|   760k|    const Dav1dDSPContext *const dsp = f->dsp;
 1183|   760k|    const int bx4 = t->bx & 31, by4 = t->by & 31;
 1184|   760k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1185|   760k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 1186|   760k|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
 1187|   760k|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
 1188|   760k|    const int bw4 = b_dim[0], bh4 = b_dim[1];
 1189|   760k|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
 1190|   760k|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
 1191|   760k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (1191:28): [True: 468k, False: 291k]
  ------------------
 1192|   468k|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (1192:29): [True: 402k, False: 65.9k]
  |  Branch (1192:45): [True: 33.2k, False: 32.7k]
  ------------------
 1193|   435k|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (1193:29): [True: 373k, False: 62.0k]
  |  Branch (1193:45): [True: 31.4k, False: 30.6k]
  ------------------
 1194|   760k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[b->tx];
 1195|   760k|    const TxfmInfo *const uv_t_dim = &dav1d_txfm_dimensions[b->uvtx];
 1196|       |
 1197|       |    // coefficient coding
 1198|   760k|    pixel *const edge = bitfn(t->scratch.edge) + 128;
  ------------------
  |  |   77|   760k|#define bitfn(x) x##_16bpc
  ------------------
 1199|   760k|    const int cbw4 = (bw4 + ss_hor) >> ss_hor, cbh4 = (bh4 + ss_ver) >> ss_ver;
 1200|       |
 1201|   760k|    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: 837k, False: 778k]
  ------------------
 1204|   837k|        const int sub_h4 = imin(h4, 16 + init_y);
 1205|   837k|        const int sub_ch4 = imin(ch4, (init_y + 16) >> ss_ver);
 1206|  1.83M|        for (int init_x = 0; init_x < w4; init_x += 16) {
  ------------------
  |  Branch (1206:30): [True: 982k, False: 856k]
  ------------------
 1207|   982k|            if (b->pal_sz[0]) {
  ------------------
  |  Branch (1207:17): [True: 5.54k, False: 977k]
  ------------------
 1208|  5.54k|                pixel *dst = ((pixel *) f->cur.data[0]) +
 1209|  5.54k|                             4 * (t->by * PXSTRIDE(f->cur.stride[0]) + t->bx);
 1210|  5.54k|                const uint8_t *pal_idx;
 1211|  5.54k|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (1211:21): [True: 5.54k, False: 0]
  ------------------
 1212|  5.54k|                    const int p = t->frame_thread.pass & 1;
 1213|  5.54k|                    assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  Branch (1213:21): [True: 5.54k, False: 0]
  ------------------
 1214|  5.54k|                    pal_idx = ts->frame_thread[p].pal_idx;
 1215|  5.54k|                    ts->frame_thread[p].pal_idx += bw4 * bh4 * 8;
 1216|  5.54k|                } else {
 1217|      0|                    pal_idx = t->scratch.pal_idx_y;
 1218|      0|                }
 1219|  5.54k|                const pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (1219:42): [True: 5.54k, False: 0]
  ------------------
 1220|  5.54k|                    f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 1221|  5.54k|                                        ((t->bx >> 1) + (t->by & 1))][0] :
 1222|  5.54k|                    bytefn(t->scratch.pal)[0];
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  5.54k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1223|  5.54k|                f->dsp->ipred.pal_pred(dst, f->cur.stride[0], pal,
 1224|  5.54k|                                       pal_idx, bw4 * 4, bh4 * 4);
 1225|  5.54k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|  5.54k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 5.54k]
  |  |  ------------------
  |  |   35|  5.54k|        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.54k|        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|  5.54k|            }
 1229|       |
 1230|   982k|            const int intra_flags = (sm_flag(t->a, bx4) |
 1231|   982k|                                     sm_flag(&t->l, by4) |
 1232|   982k|                                     intra_edge_filter_flag);
 1233|   982k|            const int sb_has_tr = init_x + 16 < w4 ? 1 : init_y ? 0 :
  ------------------
  |  Branch (1233:35): [True: 145k, False: 837k]
  |  Branch (1233:58): [True: 76.5k, False: 761k]
  ------------------
 1234|   837k|                              intra_edge_flags & EDGE_I444_TOP_HAS_RIGHT;
 1235|   982k|            const int sb_has_bl = init_x ? 0 : init_y + 16 < h4 ? 1 :
  ------------------
  |  Branch (1235:35): [True: 145k, False: 837k]
  |  Branch (1235:48): [True: 76.5k, False: 761k]
  ------------------
 1236|   837k|                              intra_edge_flags & EDGE_I444_LEFT_HAS_BOTTOM;
 1237|   982k|            int y, x;
 1238|   982k|            const int sub_w4 = imin(w4, init_x + 16);
 1239|  2.35M|            for (y = init_y, t->by += init_y; y < sub_h4;
  ------------------
  |  Branch (1239:47): [True: 1.36M, False: 986k]
  ------------------
 1240|  1.37M|                 y += t_dim->h, t->by += t_dim->h)
 1241|  1.36M|            {
 1242|  1.36M|                pixel *dst = ((pixel *) f->cur.data[0]) +
 1243|  1.36M|                               4 * (t->by * PXSTRIDE(f->cur.stride[0]) +
 1244|  1.36M|                                    t->bx + init_x);
 1245|  6.83M|                for (x = init_x, t->bx += init_x; x < sub_w4;
  ------------------
  |  Branch (1245:51): [True: 5.46M, False: 1.37M]
  ------------------
 1246|  5.46M|                     x += t_dim->w, t->bx += t_dim->w)
 1247|  5.46M|                {
 1248|  5.46M|                    if (b->pal_sz[0]) goto skip_y_pred;
  ------------------
  |  Branch (1248:25): [True: 30.4k, False: 5.43M]
  ------------------
 1249|       |
 1250|  5.43M|                    int angle = b->y_angle;
 1251|  5.43M|                    const enum EdgeFlags edge_flags =
 1252|  5.43M|                        (((y > init_y || !sb_has_tr) && (x + t_dim->w >= sub_w4)) ?
  ------------------
  |  Branch (1252:28): [True: 4.08M, False: 1.35M]
  |  Branch (1252:42): [True: 376k, False: 973k]
  |  Branch (1252:57): [True: 649k, False: 3.82M]
  ------------------
 1253|  4.79M|                             0 : EDGE_I444_TOP_HAS_RIGHT) |
 1254|  5.43M|                        ((x > init_x || (!sb_has_bl && y + t_dim->h >= sub_h4)) ?
  ------------------
  |  Branch (1254:27): [True: 4.07M, False: 1.35M]
  |  Branch (1254:42): [True: 947k, False: 409k]
  |  Branch (1254:56): [True: 667k, False: 279k]
  ------------------
 1255|  4.75M|                             0 : EDGE_I444_LEFT_HAS_BOTTOM);
 1256|  5.43M|                    const pixel *top_sb_edge = NULL;
 1257|  5.43M|                    if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1257:25): [True: 597k, False: 4.83M]
  ------------------
 1258|   597k|                        top_sb_edge = f->ipred_edge[0];
 1259|   597k|                        const int sby = t->by >> f->sb_shift;
 1260|   597k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1261|   597k|                    }
 1262|  5.43M|                    const enum IntraPredMode m =
 1263|  5.43M|                        bytefn(dav1d_prepare_intra_edges)(t->bx,
  ------------------
  |  |   87|  5.43M|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  5.43M|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1264|  5.43M|                                                          t->bx > ts->tiling.col_start,
 1265|  5.43M|                                                          t->by,
 1266|  5.43M|                                                          t->by > ts->tiling.row_start,
 1267|  5.43M|                                                          ts->tiling.col_end,
 1268|  5.43M|                                                          ts->tiling.row_end,
 1269|  5.43M|                                                          edge_flags, dst,
 1270|  5.43M|                                                          f->cur.stride[0], top_sb_edge,
 1271|  5.43M|                                                          b->y_mode, &angle,
 1272|  5.43M|                                                          t_dim->w, t_dim->h,
 1273|  5.43M|                                                          f->seq_hdr->intra_edge_filter,
 1274|  5.43M|                                                          edge HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  5.43M|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1275|  5.43M|                    dsp->ipred.intra_pred[m](dst, f->cur.stride[0], edge,
 1276|  5.43M|                                             t_dim->w * 4, t_dim->h * 4,
 1277|  5.43M|                                             angle | intra_flags,
 1278|  5.43M|                                             4 * f->bw - 4 * t->bx,
 1279|  5.43M|                                             4 * f->bh - 4 * t->by
 1280|  5.43M|                                             HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  5.43M|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1281|       |
 1282|  5.43M|                    if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  5.43M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 5.43M]
  |  |  ------------------
  |  |   35|  5.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|  5.43M|        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|  5.46M|                skip_y_pred: {}
 1293|  5.46M|                    if (!b->skip) {
  ------------------
  |  Branch (1293:25): [True: 586k, False: 4.87M]
  ------------------
 1294|   586k|                        coef *cf;
 1295|   586k|                        int eob;
 1296|   586k|                        enum TxfmType txtp;
 1297|   587k|                        if (t->frame_thread.pass) {
  ------------------
  |  Branch (1297:29): [True: 587k, False: 18.4E]
  ------------------
 1298|   587k|                            const int p = t->frame_thread.pass & 1;
 1299|   587k|                            const int cbi = *ts->frame_thread[p].cbi++;
 1300|   587k|                            cf = ts->frame_thread[p].cf;
 1301|   587k|                            ts->frame_thread[p].cf += imin(t_dim->w, 8) * imin(t_dim->h, 8) * 16;
 1302|   587k|                            eob  = cbi >> 5;
 1303|   587k|                            txtp = cbi & 0x1f;
 1304|  18.4E|                        } else {
 1305|  18.4E|                            uint8_t cf_ctx;
 1306|  18.4E|                            cf = bitfn(t->cf);
  ------------------
  |  |   77|  18.4E|#define bitfn(x) x##_16bpc
  ------------------
 1307|  18.4E|                            eob = decode_coefs(t, &t->a->lcoef[bx4 + x],
 1308|  18.4E|                                               &t->l.lcoef[by4 + y], b->tx, bs,
 1309|  18.4E|                                               b, 1, 0, cf, &txtp, &cf_ctx);
 1310|  18.4E|                            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  18.4E|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 18.4E]
  |  |  ------------------
  |  |   35|  18.4E|        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|  18.4E|        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|  18.4E|                            dav1d_memset_likely_pow2(&t->a->lcoef[bx4 + x], cf_ctx, imin(t_dim->w, f->bw - t->bx));
 1314|  18.4E|                            dav1d_memset_likely_pow2(&t->l.lcoef[by4 + y], cf_ctx, imin(t_dim->h, f->bh - t->by));
 1315|  18.4E|                        }
 1316|   586k|                        if (eob >= 0) {
  ------------------
  |  Branch (1316:29): [True: 404k, False: 182k]
  ------------------
 1317|   404k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   404k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 404k]
  |  |  ------------------
  |  |   35|   404k|        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|   404k|        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|   404k|                            dsp->itx.itxfm_add[b->tx]
 1321|   404k|                                              [txtp](dst,
 1322|   404k|                                                     f->cur.stride[0],
 1323|   404k|                                                     cf, eob HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   404k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1324|   404k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   404k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 404k]
  |  |  ------------------
  |  |   35|   404k|        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|   404k|        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|   404k|                        }
 1328|  4.87M|                    } else if (!t->frame_thread.pass) {
  ------------------
  |  Branch (1328:32): [True: 0, False: 4.87M]
  ------------------
 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|  5.46M|                    dst += 4 * t_dim->w;
 1333|  5.46M|                }
 1334|  1.37M|                t->bx -= x;
 1335|  1.37M|            }
 1336|   986k|            t->by -= y;
 1337|       |
 1338|   986k|            if (!has_chroma) continue;
  ------------------
  |  Branch (1338:17): [True: 409k, False: 577k]
  ------------------
 1339|       |
 1340|   577k|            const ptrdiff_t stride = f->cur.stride[1];
 1341|       |
 1342|   577k|            if (b->uv_mode == CFL_PRED) {
  ------------------
  |  Branch (1342:17): [True: 28.2k, False: 548k]
  ------------------
 1343|  28.2k|                assert(!init_x && !init_y);
  ------------------
  |  Branch (1343:17): [True: 28.2k, False: 0]
  |  Branch (1343:17): [True: 28.2k, False: 0]
  ------------------
 1344|       |
 1345|  28.2k|                int16_t *const ac = t->scratch.ac;
 1346|  28.2k|                pixel *y_src = ((pixel *) f->cur.data[0]) + 4 * (t->bx & ~ss_hor) +
 1347|  28.2k|                                 4 * (t->by & ~ss_ver) * PXSTRIDE(f->cur.stride[0]);
 1348|  28.2k|                const ptrdiff_t uv_off = 4 * ((t->bx >> ss_hor) +
 1349|  28.2k|                                              (t->by >> ss_ver) * PXSTRIDE(stride));
 1350|  28.2k|                pixel *const uv_dst[2] = { ((pixel *) f->cur.data[1]) + uv_off,
 1351|  28.2k|                                           ((pixel *) f->cur.data[2]) + uv_off };
 1352|       |
 1353|  28.2k|                const int furthest_r =
 1354|  28.2k|                    ((cw4 << ss_hor) + t_dim->w - 1) & ~(t_dim->w - 1);
 1355|  28.2k|                const int furthest_b =
 1356|  28.2k|                    ((ch4 << ss_ver) + t_dim->h - 1) & ~(t_dim->h - 1);
 1357|  28.2k|                dsp->ipred.cfl_ac[f->cur.p.layout - 1](ac, y_src, f->cur.stride[0],
 1358|  28.2k|                                                         cbw4 - (furthest_r >> ss_hor),
 1359|  28.2k|                                                         cbh4 - (furthest_b >> ss_ver),
 1360|  28.2k|                                                         cbw4 * 4, cbh4 * 4);
 1361|  84.7k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1361:34): [True: 56.4k, False: 28.2k]
  ------------------
 1362|  56.4k|                    if (!b->cfl_alpha[pl]) continue;
  ------------------
  |  Branch (1362:25): [True: 11.9k, False: 44.5k]
  ------------------
 1363|  44.5k|                    int angle = 0;
 1364|  44.5k|                    const pixel *top_sb_edge = NULL;
 1365|  44.5k|                    if (!((t->by & ~ss_ver) & (f->sb_step - 1))) {
  ------------------
  |  Branch (1365:25): [True: 7.67k, False: 36.8k]
  ------------------
 1366|  7.67k|                        top_sb_edge = f->ipred_edge[pl + 1];
 1367|  7.67k|                        const int sby = t->by >> f->sb_shift;
 1368|  7.67k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1369|  7.67k|                    }
 1370|  44.5k|                    const int xpos = t->bx >> ss_hor, ypos = t->by >> ss_ver;
 1371|  44.5k|                    const int xstart = ts->tiling.col_start >> ss_hor;
 1372|  44.5k|                    const int ystart = ts->tiling.row_start >> ss_ver;
 1373|  44.5k|                    const enum IntraPredMode m =
 1374|  44.5k|                        bytefn(dav1d_prepare_intra_edges)(xpos, xpos > xstart,
  ------------------
  |  |   87|  44.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  44.5k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1375|  44.5k|                                                          ypos, ypos > ystart,
 1376|  44.5k|                                                          ts->tiling.col_end >> ss_hor,
 1377|  44.5k|                                                          ts->tiling.row_end >> ss_ver,
 1378|  44.5k|                                                          0, uv_dst[pl], stride,
 1379|  44.5k|                                                          top_sb_edge, DC_PRED, &angle,
 1380|  44.5k|                                                          uv_t_dim->w, uv_t_dim->h, 0,
 1381|  44.5k|                                                          edge HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  44.5k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1382|  44.5k|                    dsp->ipred.cfl_pred[m](uv_dst[pl], stride, edge,
 1383|  44.5k|                                           uv_t_dim->w * 4,
 1384|  44.5k|                                           uv_t_dim->h * 4,
 1385|  44.5k|                                           ac, b->cfl_alpha[pl]
 1386|  44.5k|                                           HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  44.5k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1387|  44.5k|                }
 1388|  28.2k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  28.2k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 28.2k]
  |  |  ------------------
  |  |   35|  28.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|  28.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]
  |  |  ------------------
  ------------------
 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|   548k|            } else if (b->pal_sz[1]) {
  ------------------
  |  Branch (1393:24): [True: 2.78k, False: 546k]
  ------------------
 1394|  2.78k|                const ptrdiff_t uv_dstoff = 4 * ((t->bx >> ss_hor) +
 1395|  2.78k|                                              (t->by >> ss_ver) * PXSTRIDE(f->cur.stride[1]));
 1396|  2.78k|                const pixel (*pal)[8];
 1397|  2.78k|                const uint8_t *pal_idx;
 1398|  2.78k|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (1398:21): [True: 2.78k, False: 0]
  ------------------
 1399|  2.78k|                    const int p = t->frame_thread.pass & 1;
 1400|  2.78k|                    assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  Branch (1400:21): [True: 2.78k, False: 0]
  ------------------
 1401|  2.78k|                    pal = f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 1402|  2.78k|                                              ((t->bx >> 1) + (t->by & 1))];
 1403|  2.78k|                    pal_idx = ts->frame_thread[p].pal_idx;
 1404|  2.78k|                    ts->frame_thread[p].pal_idx += cbw4 * cbh4 * 8;
 1405|  2.78k|                } else {
 1406|      0|                    pal = bytefn(t->scratch.pal);
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|      0|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1407|      0|                    pal_idx = t->scratch.pal_idx_uv;
 1408|      0|                }
 1409|       |
 1410|  2.78k|                f->dsp->ipred.pal_pred(((pixel *) f->cur.data[1]) + uv_dstoff,
 1411|  2.78k|                                       f->cur.stride[1], pal[1],
 1412|  2.78k|                                       pal_idx, cbw4 * 4, cbh4 * 4);
 1413|  2.78k|                f->dsp->ipred.pal_pred(((pixel *) f->cur.data[2]) + uv_dstoff,
 1414|  2.78k|                                       f->cur.stride[1], pal[2],
 1415|  2.78k|                                       pal_idx, cbw4 * 4, cbh4 * 4);
 1416|  2.78k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  2.78k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 2.78k]
  |  |  ------------------
  |  |   35|  2.78k|        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|  2.78k|        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|  2.78k|            }
 1425|       |
 1426|   577k|            const int sm_uv_fl = sm_uv_flag(t->a, cbx4) |
 1427|   577k|                                 sm_uv_flag(&t->l, cby4);
 1428|   577k|            const int uv_sb_has_tr =
 1429|   577k|                ((init_x + 16) >> ss_hor) < cw4 ? 1 : init_y ? 0 :
  ------------------
  |  Branch (1429:17): [True: 110k, False: 467k]
  |  Branch (1429:55): [True: 57.3k, False: 409k]
  ------------------
 1430|   467k|                intra_edge_flags & (EDGE_I420_TOP_HAS_RIGHT >> (f->cur.p.layout - 1));
 1431|   577k|            const int uv_sb_has_bl =
 1432|   577k|                init_x ? 0 : ((init_y + 16) >> ss_ver) < ch4 ? 1 :
  ------------------
  |  Branch (1432:17): [True: 110k, False: 467k]
  |  Branch (1432:30): [True: 57.3k, False: 409k]
  ------------------
 1433|   467k|                intra_edge_flags & (EDGE_I420_LEFT_HAS_BOTTOM >> (f->cur.p.layout - 1));
 1434|   577k|            const int sub_cw4 = imin(cw4, (init_x + 16) >> ss_hor);
 1435|  1.73M|            for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1435:30): [True: 1.14M, False: 592k]
  ------------------
 1436|  2.94M|                for (y = init_y >> ss_ver, t->by += init_y; y < sub_ch4;
  ------------------
  |  Branch (1436:61): [True: 1.78M, False: 1.15M]
  ------------------
 1437|  1.80M|                     y += uv_t_dim->h, t->by += uv_t_dim->h << ss_ver)
 1438|  1.78M|                {
 1439|  1.78M|                    pixel *dst = ((pixel *) f->cur.data[1 + pl]) +
 1440|  1.78M|                                   4 * ((t->by >> ss_ver) * PXSTRIDE(stride) +
 1441|  1.78M|                                        ((t->bx + init_x) >> ss_hor));
 1442|  10.3M|                    for (x = init_x >> ss_hor, t->bx += init_x; x < sub_cw4;
  ------------------
  |  Branch (1442:65): [True: 8.52M, False: 1.80M]
  ------------------
 1443|  8.53M|                         x += uv_t_dim->w, t->bx += uv_t_dim->w << ss_hor)
 1444|  8.52M|                    {
 1445|  8.52M|                        if ((b->uv_mode == CFL_PRED && b->cfl_alpha[pl]) ||
  ------------------
  |  Branch (1445:30): [True: 56.4k, False: 8.46M]
  |  Branch (1445:56): [True: 44.5k, False: 11.9k]
  ------------------
 1446|  8.48M|                            b->pal_sz[1])
  ------------------
  |  Branch (1446:29): [True: 8.81k, False: 8.47M]
  ------------------
 1447|  53.9k|                        {
 1448|  53.9k|                            goto skip_uv_pred;
 1449|  53.9k|                        }
 1450|       |
 1451|  8.47M|                        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|  8.47M|                        const enum EdgeFlags edge_flags =
 1456|  8.47M|                            (((y > (init_y >> ss_ver) || !uv_sb_has_tr) &&
  ------------------
  |  Branch (1456:32): [True: 6.84M, False: 1.62M]
  |  Branch (1456:58): [True: 474k, False: 1.15M]
  ------------------
 1457|  7.37M|                              (x + uv_t_dim->w >= sub_cw4)) ?
  ------------------
  |  Branch (1457:31): [True: 1.00M, False: 6.37M]
  ------------------
 1458|  7.50M|                                 0 : EDGE_I444_TOP_HAS_RIGHT) |
 1459|  8.47M|                            ((x > (init_x >> ss_hor) ||
  ------------------
  |  Branch (1459:31): [True: 6.73M, False: 1.73M]
  ------------------
 1460|  1.73M|                              (!uv_sb_has_bl && y + uv_t_dim->h >= sub_ch4)) ?
  ------------------
  |  Branch (1460:32): [True: 1.13M, False: 596k]
  |  Branch (1460:49): [True: 681k, False: 457k]
  ------------------
 1461|  7.46M|                                 0 : EDGE_I444_LEFT_HAS_BOTTOM);
 1462|  8.47M|                        const pixel *top_sb_edge = NULL;
 1463|  8.47M|                        if (!((t->by & ~ss_ver) & (f->sb_step - 1))) {
  ------------------
  |  Branch (1463:29): [True: 664k, False: 7.80M]
  ------------------
 1464|   664k|                            top_sb_edge = f->ipred_edge[1 + pl];
 1465|   664k|                            const int sby = t->by >> f->sb_shift;
 1466|   664k|                            top_sb_edge += f->sb128w * 128 * (sby - 1);
 1467|   664k|                        }
 1468|  8.47M|                        const enum IntraPredMode uv_mode =
 1469|  8.47M|                             b->uv_mode == CFL_PRED ? DC_PRED : b->uv_mode;
  ------------------
  |  Branch (1469:30): [True: 11.9k, False: 8.45M]
  ------------------
 1470|  8.47M|                        const int xpos = t->bx >> ss_hor, ypos = t->by >> ss_ver;
 1471|  8.47M|                        const int xstart = ts->tiling.col_start >> ss_hor;
 1472|  8.47M|                        const int ystart = ts->tiling.row_start >> ss_ver;
 1473|  8.47M|                        const enum IntraPredMode m =
 1474|  8.47M|                            bytefn(dav1d_prepare_intra_edges)(xpos, xpos > xstart,
  ------------------
  |  |   87|  8.47M|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  8.47M|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1475|  8.47M|                                                              ypos, ypos > ystart,
 1476|  8.47M|                                                              ts->tiling.col_end >> ss_hor,
 1477|  8.47M|                                                              ts->tiling.row_end >> ss_ver,
 1478|  8.47M|                                                              edge_flags, dst, stride,
 1479|  8.47M|                                                              top_sb_edge, uv_mode,
 1480|  8.47M|                                                              &angle, uv_t_dim->w,
 1481|  8.47M|                                                              uv_t_dim->h,
 1482|  8.47M|                                                              f->seq_hdr->intra_edge_filter,
 1483|  8.47M|                                                              edge HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  8.47M|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1484|  8.47M|                        angle |= intra_edge_filter_flag;
 1485|  8.47M|                        dsp->ipred.intra_pred[m](dst, stride, edge,
 1486|  8.47M|                                                 uv_t_dim->w * 4,
 1487|  8.47M|                                                 uv_t_dim->h * 4,
 1488|  8.47M|                                                 angle | sm_uv_fl,
 1489|  8.47M|                                                 (4 * f->bw + ss_hor -
 1490|  8.47M|                                                  4 * (t->bx & ~ss_hor)) >> ss_hor,
 1491|  8.47M|                                                 (4 * f->bh + ss_ver -
 1492|  8.47M|                                                  4 * (t->by & ~ss_ver)) >> ss_ver
 1493|  8.47M|                                                 HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  8.47M|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1494|  8.47M|                        if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  8.47M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 8.47M]
  |  |  ------------------
  |  |   35|  8.47M|        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|  8.47M|        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|  8.53M|                    skip_uv_pred: {}
 1505|  8.53M|                        if (!b->skip) {
  ------------------
  |  Branch (1505:29): [True: 530k, False: 8.00M]
  ------------------
 1506|   530k|                            enum TxfmType txtp;
 1507|   530k|                            int eob;
 1508|   530k|                            coef *cf;
 1509|   530k|                            if (t->frame_thread.pass) {
  ------------------
  |  Branch (1509:33): [True: 530k, False: 18.4E]
  ------------------
 1510|   530k|                                const int p = t->frame_thread.pass & 1;
 1511|   530k|                                const int cbi = *ts->frame_thread[p].cbi++;
 1512|   530k|                                cf = ts->frame_thread[p].cf;
 1513|   530k|                                ts->frame_thread[p].cf += uv_t_dim->w * uv_t_dim->h * 16;
 1514|   530k|                                eob  = cbi >> 5;
 1515|   530k|                                txtp = cbi & 0x1f;
 1516|  18.4E|                            } else {
 1517|  18.4E|                                uint8_t cf_ctx;
 1518|  18.4E|                                cf = bitfn(t->cf);
  ------------------
  |  |   77|  18.4E|#define bitfn(x) x##_16bpc
  ------------------
 1519|  18.4E|                                eob = decode_coefs(t, &t->a->ccoef[pl][cbx4 + x],
 1520|  18.4E|                                                   &t->l.ccoef[pl][cby4 + y],
 1521|  18.4E|                                                   b->uvtx, bs, b, 1, 1 + pl, cf,
 1522|  18.4E|                                                   &txtp, &cf_ctx);
 1523|  18.4E|                                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  18.4E|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 18.4E]
  |  |  ------------------
  |  |   35|  18.4E|        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|  18.4E|        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|  18.4E|                                int ctw = imin(uv_t_dim->w, (f->bw - t->bx + ss_hor) >> ss_hor);
 1528|  18.4E|                                int cth = imin(uv_t_dim->h, (f->bh - t->by + ss_ver) >> ss_ver);
 1529|  18.4E|                                dav1d_memset_likely_pow2(&t->a->ccoef[pl][cbx4 + x], cf_ctx, ctw);
 1530|  18.4E|                                dav1d_memset_likely_pow2(&t->l.ccoef[pl][cby4 + y], cf_ctx, cth);
 1531|  18.4E|                            }
 1532|   530k|                            if (eob >= 0) {
  ------------------
  |  Branch (1532:33): [True: 169k, False: 361k]
  ------------------
 1533|   169k|                                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
                                              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|   169k|                                dsp->itx.itxfm_add[b->uvtx]
 1537|   169k|                                                  [txtp](dst, stride,
 1538|   169k|                                                         cf, eob HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   169k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1539|   169k|                                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   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]
  |  |  ------------------
  ------------------
                                              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|   169k|                            }
 1543|  8.00M|                        } else if (!t->frame_thread.pass) {
  ------------------
  |  Branch (1543:36): [True: 0, False: 8.00M]
  ------------------
 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|  8.53M|                        dst += uv_t_dim->w * 4;
 1548|  8.53M|                    }
 1549|  1.80M|                    t->bx -= x << ss_hor;
 1550|  1.80M|                }
 1551|  1.15M|                t->by -= y << ss_ver;
 1552|  1.15M|            }
 1553|   577k|        }
 1554|   837k|    }
 1555|   760k|}
dav1d_recon_b_inter_16bpc:
 1559|  4.26M|{
 1560|  4.26M|    Dav1dTileState *const ts = t->ts;
 1561|  4.26M|    const Dav1dFrameContext *const f = t->f;
 1562|  4.26M|    const Dav1dDSPContext *const dsp = f->dsp;
 1563|  4.26M|    const int bx4 = t->bx & 31, by4 = t->by & 31;
 1564|  4.26M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1565|  4.26M|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 1566|  4.26M|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
 1567|  4.26M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
 1568|  4.26M|    const int bw4 = b_dim[0], bh4 = b_dim[1];
 1569|  4.26M|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
 1570|  4.26M|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (1570:28): [True: 439k, False: 3.82M]
  ------------------
 1571|   439k|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (1571:29): [True: 362k, False: 77.7k]
  |  Branch (1571:45): [True: 38.5k, False: 39.2k]
  ------------------
 1572|   402k|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (1572:29): [True: 329k, False: 72.8k]
  |  Branch (1572:45): [True: 35.9k, False: 36.9k]
  ------------------
 1573|  4.26M|    const int chr_layout_idx = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I400 ? 0 :
  ------------------
  |  Branch (1573:32): [True: 3.81M, False: 442k]
  ------------------
 1574|  4.26M|                               DAV1D_PIXEL_LAYOUT_I444 - f->cur.p.layout;
 1575|  4.26M|    int res;
 1576|       |
 1577|       |    // prediction
 1578|  4.26M|    const int cbh4 = (bh4 + ss_ver) >> ss_ver, cbw4 = (bw4 + ss_hor) >> ss_hor;
 1579|  4.26M|    pixel *dst = ((pixel *) f->cur.data[0]) +
 1580|  4.26M|        4 * (t->by * PXSTRIDE(f->cur.stride[0]) + t->bx);
 1581|  4.26M|    const ptrdiff_t uvdstoff =
 1582|  4.26M|        4 * ((t->bx >> ss_hor) + (t->by >> ss_ver) * PXSTRIDE(f->cur.stride[1]));
 1583|  4.26M|    if (IS_KEY_OR_INTRA(f->frame_hdr)) {
  ------------------
  |  |   43|  4.26M|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  4.26M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 11.2k, False: 4.24M]
  |  |  ------------------
  ------------------
 1584|       |        // intrabc
 1585|  11.2k|        assert(!f->frame_hdr->super_res.enabled);
  ------------------
  |  Branch (1585:9): [True: 11.2k, False: 0]
  ------------------
 1586|  11.2k|        res = mc(t, dst, NULL, f->cur.stride[0], bw4, bh4, t->bx, t->by, 0,
 1587|  11.2k|                 b->mv[0], &f->sr_cur, 0 /* unused */, FILTER_2D_BILINEAR);
 1588|  11.2k|        if (res) return res;
  ------------------
  |  Branch (1588:13): [True: 0, False: 11.2k]
  ------------------
 1589|  22.3k|        if (has_chroma) for (int pl = 1; pl < 3; pl++) {
  ------------------
  |  Branch (1589:13): [True: 7.44k, False: 3.78k]
  |  Branch (1589:42): [True: 14.8k, False: 7.44k]
  ------------------
 1590|  14.8k|            res = mc(t, ((pixel *)f->cur.data[pl]) + uvdstoff, NULL, f->cur.stride[1],
 1591|  14.8k|                     bw4 << (bw4 == ss_hor), bh4 << (bh4 == ss_ver),
 1592|  14.8k|                     t->bx & ~ss_hor, t->by & ~ss_ver, pl, b->mv[0],
 1593|  14.8k|                     &f->sr_cur, 0 /* unused */, FILTER_2D_BILINEAR);
 1594|  14.8k|            if (res) return res;
  ------------------
  |  Branch (1594:17): [True: 0, False: 14.8k]
  ------------------
 1595|  14.8k|        }
 1596|  4.24M|    } else if (b->comp_type == COMP_INTER_NONE) {
  ------------------
  |  Branch (1596:16): [True: 4.20M, False: 41.4k]
  ------------------
 1597|  4.20M|        const Dav1dThreadPicture *const refp = &f->refp[b->ref[0]];
 1598|  4.20M|        const enum Filter2d filter_2d = b->filter2d;
 1599|       |
 1600|  4.20M|        if (imin(bw4, bh4) > 1 &&
  ------------------
  |  Branch (1600:13): [True: 4.05M, False: 148k]
  ------------------
 1601|  4.05M|            ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (1601:15): [True: 3.96M, False: 98.1k]
  |  Branch (1601:44): [True: 883k, False: 3.07M]
  ------------------
 1602|  3.18M|             (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (1602:15): [True: 37.6k, False: 3.14M]
  |  Branch (1602:44): [True: 34.8k, False: 2.75k]
  ------------------
 1603|   918k|        {
 1604|   918k|            res = warp_affine(t, dst, NULL, f->cur.stride[0], b_dim, 0, refp,
 1605|   918k|                              b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (1605:31): [True: 34.8k, False: 883k]
  ------------------
 1606|   918k|                                  &f->frame_hdr->gmv[b->ref[0]]);
 1607|   918k|            if (res) return res;
  ------------------
  |  Branch (1607:17): [True: 0, False: 918k]
  ------------------
 1608|  3.29M|        } else {
 1609|  3.29M|            res = mc(t, dst, NULL, f->cur.stride[0],
 1610|  3.29M|                     bw4, bh4, t->bx, t->by, 0, b->mv[0], refp, b->ref[0], filter_2d);
 1611|  3.29M|            if (res) return res;
  ------------------
  |  Branch (1611:17): [True: 0, False: 3.29M]
  ------------------
 1612|  3.29M|            if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (1612:17): [True: 83.9k, False: 3.20M]
  ------------------
 1613|  83.9k|                res = obmc(t, dst, f->cur.stride[0], b_dim, 0, bx4, by4, w4, h4);
 1614|  83.9k|                if (res) return res;
  ------------------
  |  Branch (1614:21): [True: 0, False: 83.9k]
  ------------------
 1615|  83.9k|            }
 1616|  3.29M|        }
 1617|  4.20M|        if (b->interintra_type) {
  ------------------
  |  Branch (1617:13): [True: 32.5k, False: 4.17M]
  ------------------
 1618|  32.5k|            pixel *const tl_edge = bitfn(t->scratch.edge) + 32;
  ------------------
  |  |   77|  32.5k|#define bitfn(x) x##_16bpc
  ------------------
 1619|  32.5k|            enum IntraPredMode m = b->interintra_mode == II_SMOOTH_PRED ?
  ------------------
  |  Branch (1619:36): [True: 5.90k, False: 26.6k]
  ------------------
 1620|  26.6k|                                   SMOOTH_PRED : b->interintra_mode;
 1621|  32.5k|            pixel *const tmp = bitfn(t->scratch.interintra);
  ------------------
  |  |   77|  32.5k|#define bitfn(x) x##_16bpc
  ------------------
 1622|  32.5k|            int angle = 0;
 1623|  32.5k|            const pixel *top_sb_edge = NULL;
 1624|  32.5k|            if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1624:17): [True: 3.44k, False: 29.0k]
  ------------------
 1625|  3.44k|                top_sb_edge = f->ipred_edge[0];
 1626|  3.44k|                const int sby = t->by >> f->sb_shift;
 1627|  3.44k|                top_sb_edge += f->sb128w * 128 * (sby - 1);
 1628|  3.44k|            }
 1629|  32.5k|            m = bytefn(dav1d_prepare_intra_edges)(t->bx, t->bx > ts->tiling.col_start,
  ------------------
  |  |   87|  32.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  32.5k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1630|  32.5k|                                                  t->by, t->by > ts->tiling.row_start,
 1631|  32.5k|                                                  ts->tiling.col_end, ts->tiling.row_end,
 1632|  32.5k|                                                  0, dst, f->cur.stride[0], top_sb_edge,
 1633|  32.5k|                                                  m, &angle, bw4, bh4, 0, tl_edge
 1634|  32.5k|                                                  HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  32.5k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1635|  32.5k|            dsp->ipred.intra_pred[m](tmp, 4 * bw4 * sizeof(pixel),
 1636|  32.5k|                                     tl_edge, bw4 * 4, bh4 * 4, 0, 0, 0
 1637|  32.5k|                                     HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  32.5k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1638|  32.5k|            dsp->mc.blend(dst, f->cur.stride[0], tmp,
 1639|  32.5k|                          bw4 * 4, bh4 * 4, II_MASK(0, bs, b));
  ------------------
  |  |   83|  32.5k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   84|  32.5k|    (size_t)((b)->interintra_type == INTER_INTRA_BLEND ? \
  |  |  ------------------
  |  |  |  Branch (84:14): [True: 26.1k, False: 6.39k]
  |  |  ------------------
  |  |   85|  32.5k|    dav1d_masks.offsets[c][(bs)-BS_32x32].ii[(b)->interintra_mode] : \
  |  |   86|  32.5k|    dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
  ------------------
 1640|  32.5k|        }
 1641|       |
 1642|  4.20M|        if (!has_chroma) goto skip_inter_chroma_pred;
  ------------------
  |  Branch (1642:13): [True: 3.85M, False: 350k]
  ------------------
 1643|       |
 1644|       |        // sub8x8 derivation
 1645|   350k|        int is_sub8x8 = bw4 == ss_hor || bh4 == ss_ver;
  ------------------
  |  Branch (1645:25): [True: 32.8k, False: 317k]
  |  Branch (1645:42): [True: 26.8k, False: 290k]
  ------------------
 1646|   350k|        refmvs_block *const *r;
 1647|   350k|        if (is_sub8x8) {
  ------------------
  |  Branch (1647:13): [True: 55.5k, False: 294k]
  ------------------
 1648|  55.5k|            assert(ss_hor == 1);
  ------------------
  |  Branch (1648:13): [True: 55.5k, False: 18.4E]
  ------------------
 1649|  55.5k|            r = &t->rt.r[(t->by & 31) + 5];
 1650|  55.5k|            if (bw4 == 1) is_sub8x8 &= r[0][t->bx - 1].ref.ref[0] > 0;
  ------------------
  |  Branch (1650:17): [True: 28.2k, False: 27.3k]
  ------------------
 1651|  55.5k|            if (bh4 == ss_ver) is_sub8x8 &= r[-1][t->bx].ref.ref[0] > 0;
  ------------------
  |  Branch (1651:17): [True: 34.7k, False: 20.7k]
  ------------------
 1652|  55.5k|            if (bw4 == 1 && bh4 == ss_ver)
  ------------------
  |  Branch (1652:17): [True: 28.2k, False: 27.3k]
  |  Branch (1652:29): [True: 7.41k, False: 20.8k]
  ------------------
 1653|  7.41k|                is_sub8x8 &= r[-1][t->bx - 1].ref.ref[0] > 0;
 1654|  55.5k|        }
 1655|       |
 1656|       |        // chroma prediction
 1657|   350k|        if (is_sub8x8) {
  ------------------
  |  Branch (1657:13): [True: 52.5k, False: 297k]
  ------------------
 1658|  52.5k|            assert(ss_hor == 1);
  ------------------
  |  Branch (1658:13): [True: 52.5k, False: 0]
  ------------------
 1659|  52.5k|            ptrdiff_t h_off = 0, v_off = 0;
 1660|  52.5k|            if (bw4 == 1 && bh4 == ss_ver) {
  ------------------
  |  Branch (1660:17): [True: 25.9k, False: 26.5k]
  |  Branch (1660:29): [True: 7.19k, False: 18.7k]
  ------------------
 1661|  21.5k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1661:34): [True: 14.3k, False: 7.19k]
  ------------------
 1662|  14.3k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1663|  14.3k|                             NULL, f->cur.stride[1],
 1664|  14.3k|                             bw4, bh4, t->bx - 1, t->by - 1, 1 + pl,
 1665|  14.3k|                             r[-1][t->bx - 1].mv.mv[0],
 1666|  14.3k|                             &f->refp[r[-1][t->bx - 1].ref.ref[0] - 1],
 1667|  14.3k|                             r[-1][t->bx - 1].ref.ref[0] - 1,
 1668|  14.3k|                             t->frame_thread.pass != 2 ? t->tl_4x4_filter :
  ------------------
  |  Branch (1668:30): [True: 0, False: 14.3k]
  ------------------
 1669|  14.3k|                                 f->frame_thread.b[((t->by - 1) * f->b4_stride) + t->bx - 1].filter2d);
 1670|  14.3k|                    if (res) return res;
  ------------------
  |  Branch (1670:25): [True: 0, False: 14.3k]
  ------------------
 1671|  14.3k|                }
 1672|  7.19k|                v_off = 2 * PXSTRIDE(f->cur.stride[1]);
 1673|  7.19k|                h_off = 2;
 1674|  7.19k|            }
 1675|  52.5k|            if (bw4 == 1) {
  ------------------
  |  Branch (1675:17): [True: 25.9k, False: 26.5k]
  ------------------
 1676|  25.9k|                const enum Filter2d left_filter_2d =
 1677|  25.9k|                    dav1d_filter_2d[t->l.filter[1][by4]][t->l.filter[0][by4]];
 1678|  77.8k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1678:34): [True: 51.8k, False: 25.9k]
  ------------------
 1679|  51.8k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + v_off, NULL,
 1680|  51.8k|                             f->cur.stride[1], bw4, bh4, t->bx - 1,
 1681|  51.8k|                             t->by, 1 + pl, r[0][t->bx - 1].mv.mv[0],
 1682|  51.8k|                             &f->refp[r[0][t->bx - 1].ref.ref[0] - 1],
 1683|  51.8k|                             r[0][t->bx - 1].ref.ref[0] - 1,
 1684|  51.8k|                             t->frame_thread.pass != 2 ? left_filter_2d :
  ------------------
  |  Branch (1684:30): [True: 0, False: 51.8k]
  ------------------
 1685|  51.8k|                                 f->frame_thread.b[(t->by * f->b4_stride) + t->bx - 1].filter2d);
 1686|  51.8k|                    if (res) return res;
  ------------------
  |  Branch (1686:25): [True: 0, False: 51.8k]
  ------------------
 1687|  51.8k|                }
 1688|  25.9k|                h_off = 2;
 1689|  25.9k|            }
 1690|  52.5k|            if (bh4 == ss_ver) {
  ------------------
  |  Branch (1690:17): [True: 33.8k, False: 18.6k]
  ------------------
 1691|  33.8k|                const enum Filter2d top_filter_2d =
 1692|  33.8k|                    dav1d_filter_2d[t->a->filter[1][bx4]][t->a->filter[0][bx4]];
 1693|   101k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1693:34): [True: 67.5k, False: 33.8k]
  ------------------
 1694|  67.5k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + h_off, NULL,
 1695|  67.5k|                             f->cur.stride[1], bw4, bh4, t->bx, t->by - 1,
 1696|  67.5k|                             1 + pl, r[-1][t->bx].mv.mv[0],
 1697|  67.5k|                             &f->refp[r[-1][t->bx].ref.ref[0] - 1],
 1698|  67.5k|                             r[-1][t->bx].ref.ref[0] - 1,
 1699|  67.5k|                             t->frame_thread.pass != 2 ? top_filter_2d :
  ------------------
  |  Branch (1699:30): [True: 0, False: 67.5k]
  ------------------
 1700|  67.5k|                                 f->frame_thread.b[((t->by - 1) * f->b4_stride) + t->bx].filter2d);
 1701|  67.5k|                    if (res) return res;
  ------------------
  |  Branch (1701:25): [True: 0, False: 67.5k]
  ------------------
 1702|  67.5k|                }
 1703|  33.8k|                v_off = 2 * PXSTRIDE(f->cur.stride[1]);
 1704|  33.8k|            }
 1705|   157k|            for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1705:30): [True: 104k, False: 52.5k]
  ------------------
 1706|   104k|                res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + h_off + v_off, NULL, f->cur.stride[1],
 1707|   104k|                         bw4, bh4, t->bx, t->by, 1 + pl, b->mv[0],
 1708|   104k|                         refp, b->ref[0], filter_2d);
 1709|   104k|                if (res) return res;
  ------------------
  |  Branch (1709:21): [True: 0, False: 104k]
  ------------------
 1710|   104k|            }
 1711|   297k|        } else {
 1712|   297k|            if (imin(cbw4, cbh4) > 1 &&
  ------------------
  |  Branch (1712:17): [True: 141k, False: 156k]
  ------------------
 1713|   141k|                ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (1713:19): [True: 97.1k, False: 44.3k]
  |  Branch (1713:48): [True: 11.5k, False: 85.5k]
  ------------------
 1714|   129k|                 (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (1714:19): [True: 16.4k, False: 113k]
  |  Branch (1714:48): [True: 15.7k, False: 667]
  ------------------
 1715|  27.3k|            {
 1716|  82.0k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1716:34): [True: 54.7k, False: 27.3k]
  ------------------
 1717|  54.7k|                    res = warp_affine(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff, NULL,
 1718|  54.7k|                                      f->cur.stride[1], b_dim, 1 + pl, refp,
 1719|  54.7k|                                      b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (1719:39): [True: 31.5k, False: 23.1k]
  ------------------
 1720|  54.7k|                                          &f->frame_hdr->gmv[b->ref[0]]);
 1721|  54.7k|                    if (res) return res;
  ------------------
  |  Branch (1721:25): [True: 0, False: 54.7k]
  ------------------
 1722|  54.7k|                }
 1723|   270k|            } else {
 1724|   798k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1724:34): [True: 528k, False: 270k]
  ------------------
 1725|   528k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1726|   528k|                             NULL, f->cur.stride[1],
 1727|   528k|                             bw4 << (bw4 == ss_hor), bh4 << (bh4 == ss_ver),
 1728|   528k|                             t->bx & ~ss_hor, t->by & ~ss_ver,
 1729|   528k|                             1 + pl, b->mv[0], refp, b->ref[0], filter_2d);
 1730|   528k|                    if (res) return res;
  ------------------
  |  Branch (1730:25): [True: 0, False: 528k]
  ------------------
 1731|   528k|                    if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (1731:25): [True: 156k, False: 372k]
  ------------------
 1732|   156k|                        res = obmc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1733|   156k|                                   f->cur.stride[1], b_dim, 1 + pl, bx4, by4, w4, h4);
 1734|   156k|                        if (res) return res;
  ------------------
  |  Branch (1734:29): [True: 0, False: 156k]
  ------------------
 1735|   156k|                    }
 1736|   528k|                }
 1737|   270k|            }
 1738|   297k|            if (b->interintra_type) {
  ------------------
  |  Branch (1738:17): [True: 31.5k, False: 266k]
  ------------------
 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|  31.5k|                const uint8_t *const ii_mask = II_MASK(chr_layout_idx, bs, b);
  ------------------
  |  |   83|  31.5k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   84|  31.5k|    (size_t)((b)->interintra_type == INTER_INTRA_BLEND ? \
  |  |  ------------------
  |  |  |  Branch (84:14): [True: 25.3k, False: 6.14k]
  |  |  ------------------
  |  |   85|  31.5k|    dav1d_masks.offsets[c][(bs)-BS_32x32].ii[(b)->interintra_mode] : \
  |  |   86|  31.5k|    dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
  ------------------
 1743|       |
 1744|  94.5k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1744:34): [True: 63.0k, False: 31.5k]
  ------------------
 1745|  63.0k|                    pixel *const tmp = bitfn(t->scratch.interintra);
  ------------------
  |  |   77|  63.0k|#define bitfn(x) x##_16bpc
  ------------------
 1746|  63.0k|                    pixel *const tl_edge = bitfn(t->scratch.edge) + 32;
  ------------------
  |  |   77|  63.0k|#define bitfn(x) x##_16bpc
  ------------------
 1747|  63.0k|                    enum IntraPredMode m =
 1748|  63.0k|                        b->interintra_mode == II_SMOOTH_PRED ?
  ------------------
  |  Branch (1748:25): [True: 11.4k, False: 51.6k]
  ------------------
 1749|  51.6k|                        SMOOTH_PRED : b->interintra_mode;
 1750|  63.0k|                    int angle = 0;
 1751|  63.0k|                    pixel *const uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff;
 1752|  63.0k|                    const pixel *top_sb_edge = NULL;
 1753|  63.0k|                    if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1753:25): [True: 6.28k, False: 56.7k]
  ------------------
 1754|  6.28k|                        top_sb_edge = f->ipred_edge[pl + 1];
 1755|  6.28k|                        const int sby = t->by >> f->sb_shift;
 1756|  6.28k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1757|  6.28k|                    }
 1758|  63.0k|                    m = bytefn(dav1d_prepare_intra_edges)(t->bx >> ss_hor,
  ------------------
  |  |   87|  63.0k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  63.0k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1759|  63.0k|                                                          (t->bx >> ss_hor) >
 1760|  63.0k|                                                              (ts->tiling.col_start >> ss_hor),
 1761|  63.0k|                                                          t->by >> ss_ver,
 1762|  63.0k|                                                          (t->by >> ss_ver) >
 1763|  63.0k|                                                              (ts->tiling.row_start >> ss_ver),
 1764|  63.0k|                                                          ts->tiling.col_end >> ss_hor,
 1765|  63.0k|                                                          ts->tiling.row_end >> ss_ver,
 1766|  63.0k|                                                          0, uvdst, f->cur.stride[1],
 1767|  63.0k|                                                          top_sb_edge, m,
 1768|  63.0k|                                                          &angle, cbw4, cbh4, 0, tl_edge
 1769|  63.0k|                                                          HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  63.0k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1770|  63.0k|                    dsp->ipred.intra_pred[m](tmp, cbw4 * 4 * sizeof(pixel),
 1771|  63.0k|                                             tl_edge, cbw4 * 4, cbh4 * 4, 0, 0, 0
 1772|  63.0k|                                             HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  63.0k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1773|  63.0k|                    dsp->mc.blend(uvdst, f->cur.stride[1], tmp,
 1774|  63.0k|                                  cbw4 * 4, cbh4 * 4, ii_mask);
 1775|  63.0k|                }
 1776|  31.5k|            }
 1777|   297k|        }
 1778|       |
 1779|  4.20M|    skip_inter_chroma_pred: {}
 1780|  4.20M|        t->tl_4x4_filter = filter_2d;
 1781|  4.20M|    } else {
 1782|  41.4k|        const enum Filter2d filter_2d = b->filter2d;
 1783|       |        // Maximum super block size is 128x128
 1784|  41.4k|        int16_t (*tmp)[128 * 128] = t->scratch.compinter;
 1785|  41.4k|        int jnt_weight;
 1786|  41.4k|        uint8_t *const seg_mask = t->scratch.seg_mask;
 1787|  41.4k|        const uint8_t *mask;
 1788|       |
 1789|   114k|        for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1789:25): [True: 73.1k, False: 41.4k]
  ------------------
 1790|  73.1k|            const Dav1dThreadPicture *const refp = &f->refp[b->ref[i]];
 1791|       |
 1792|  73.1k|            if (b->inter_mode == GLOBALMV_GLOBALMV && f->gmv_warp_allowed[b->ref[i]]) {
  ------------------
  |  Branch (1792:17): [True: 6.36k, False: 66.7k]
  |  Branch (1792:55): [True: 1.47k, False: 4.89k]
  ------------------
 1793|  1.47k|                res = warp_affine(t, NULL, tmp[i], bw4 * 4, b_dim, 0, refp,
 1794|  1.47k|                                  &f->frame_hdr->gmv[b->ref[i]]);
 1795|  1.47k|                if (res) return res;
  ------------------
  |  Branch (1795:21): [True: 0, False: 1.47k]
  ------------------
 1796|  71.6k|            } else {
 1797|  71.6k|                res = mc(t, NULL, tmp[i], 0, bw4, bh4, t->bx, t->by, 0,
 1798|  71.6k|                         b->mv[i], refp, b->ref[i], filter_2d);
 1799|  71.6k|                if (res) return res;
  ------------------
  |  Branch (1799:21): [True: 0, False: 71.6k]
  ------------------
 1800|  71.6k|            }
 1801|  73.1k|        }
 1802|  41.4k|        switch (b->comp_type) {
  ------------------
  |  Branch (1802:17): [True: 37.2k, False: 4.15k]
  ------------------
 1803|  23.6k|        case COMP_INTER_AVG:
  ------------------
  |  Branch (1803:9): [True: 23.6k, False: 17.8k]
  ------------------
 1804|  23.6k|            dsp->mc.avg(dst, f->cur.stride[0], tmp[0], tmp[1],
 1805|  23.6k|                        bw4 * 4, bh4 * 4 HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  23.6k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1806|  23.6k|            break;
 1807|  9.27k|        case COMP_INTER_WEIGHTED_AVG:
  ------------------
  |  Branch (1807:9): [True: 9.27k, False: 32.1k]
  ------------------
 1808|  9.27k|            jnt_weight = f->jnt_weights[b->ref[0]][b->ref[1]];
 1809|  9.27k|            dsp->mc.w_avg(dst, f->cur.stride[0], tmp[0], tmp[1],
 1810|  9.27k|                          bw4 * 4, bh4 * 4, jnt_weight HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  9.27k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1811|  9.27k|            break;
 1812|  2.68k|        case COMP_INTER_SEG:
  ------------------
  |  Branch (1812:9): [True: 2.68k, False: 38.7k]
  ------------------
 1813|  2.68k|            dsp->mc.w_mask[chr_layout_idx](dst, f->cur.stride[0],
 1814|  2.68k|                                           tmp[b->mask_sign], tmp[!b->mask_sign],
 1815|  2.68k|                                           bw4 * 4, bh4 * 4, seg_mask,
 1816|  2.68k|                                           b->mask_sign HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  2.68k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1817|  2.68k|            mask = seg_mask;
 1818|  2.68k|            break;
 1819|  1.70k|        case COMP_INTER_WEDGE:
  ------------------
  |  Branch (1819:9): [True: 1.70k, False: 39.7k]
  ------------------
 1820|  1.70k|            mask = WEDGE_MASK(0, bs, 0, b->wedge_idx);
  ------------------
  |  |   89|  1.70k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   90|  1.70k|    (size_t)dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
  ------------------
 1821|  1.70k|            dsp->mc.mask(dst, f->cur.stride[0],
 1822|  1.70k|                         tmp[b->mask_sign], tmp[!b->mask_sign],
 1823|  1.70k|                         bw4 * 4, bh4 * 4, mask HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  1.70k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1824|  1.70k|            if (has_chroma)
  ------------------
  |  Branch (1824:17): [True: 1.12k, False: 587]
  ------------------
 1825|  1.12k|                mask = WEDGE_MASK(chr_layout_idx, bs, b->mask_sign, b->wedge_idx);
  ------------------
  |  |   89|  1.12k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   90|  1.12k|    (size_t)dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
  ------------------
 1826|  1.70k|            break;
 1827|  41.4k|        }
 1828|       |
 1829|       |        // chroma
 1830|  57.1k|        if (has_chroma) for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1830:13): [True: 18.9k, False: 17.9k]
  |  Branch (1830:42): [True: 37.5k, False: 19.6k]
  ------------------
 1831|   110k|            for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1831:29): [True: 73.3k, False: 37.5k]
  ------------------
 1832|  73.3k|                const Dav1dThreadPicture *const refp = &f->refp[b->ref[i]];
 1833|  73.3k|                if (b->inter_mode == GLOBALMV_GLOBALMV &&
  ------------------
  |  Branch (1833:21): [True: 5.11k, False: 68.2k]
  ------------------
 1834|  5.11k|                    imin(cbw4, cbh4) > 1 && f->gmv_warp_allowed[b->ref[i]])
  ------------------
  |  Branch (1834:21): [True: 3.35k, False: 1.75k]
  |  Branch (1834:45): [True: 368, False: 2.99k]
  ------------------
 1835|    368|                {
 1836|    368|                    res = warp_affine(t, NULL, tmp[i], bw4 * 4 >> ss_hor,
 1837|    368|                                      b_dim, 1 + pl,
 1838|    368|                                      refp, &f->frame_hdr->gmv[b->ref[i]]);
 1839|    368|                    if (res) return res;
  ------------------
  |  Branch (1839:25): [True: 0, False: 368]
  ------------------
 1840|  73.0k|                } else {
 1841|  73.0k|                    res = mc(t, NULL, tmp[i], 0, bw4, bh4, t->bx, t->by,
 1842|  73.0k|                             1 + pl, b->mv[i], refp, b->ref[i], filter_2d);
 1843|  73.0k|                    if (res) return res;
  ------------------
  |  Branch (1843:25): [True: 0, False: 73.0k]
  ------------------
 1844|  73.0k|                }
 1845|  73.3k|            }
 1846|  37.5k|            pixel *const uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff;
 1847|  37.5k|            switch (b->comp_type) {
  ------------------
  |  Branch (1847:21): [True: 38.2k, False: 18.4E]
  ------------------
 1848|  22.2k|            case COMP_INTER_AVG:
  ------------------
  |  Branch (1848:13): [True: 22.2k, False: 15.2k]
  ------------------
 1849|  22.2k|                dsp->mc.avg(uvdst, f->cur.stride[1], tmp[0], tmp[1],
 1850|  22.2k|                            bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver
 1851|  22.2k|                            HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  22.2k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1852|  22.2k|                break;
 1853|  11.2k|            case COMP_INTER_WEIGHTED_AVG:
  ------------------
  |  Branch (1853:13): [True: 11.2k, False: 26.2k]
  ------------------
 1854|  11.2k|                dsp->mc.w_avg(uvdst, f->cur.stride[1], tmp[0], tmp[1],
 1855|  11.2k|                              bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver, jnt_weight
 1856|  11.2k|                              HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  11.2k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1857|  11.2k|                break;
 1858|  2.24k|            case COMP_INTER_WEDGE:
  ------------------
  |  Branch (1858:13): [True: 2.24k, False: 35.2k]
  ------------------
 1859|  4.72k|            case COMP_INTER_SEG:
  ------------------
  |  Branch (1859:13): [True: 2.47k, False: 35.0k]
  ------------------
 1860|  4.72k|                dsp->mc.mask(uvdst, f->cur.stride[1],
 1861|  4.72k|                             tmp[b->mask_sign], tmp[!b->mask_sign],
 1862|  4.72k|                             bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver, mask
 1863|  4.72k|                             HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  4.72k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1864|  4.72k|                break;
 1865|  37.5k|            }
 1866|  37.5k|        }
 1867|  36.9k|    }
 1868|       |
 1869|  4.25M|    if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  4.25M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 4.25M]
  |  |  ------------------
  |  |   35|  4.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|  4.25M|        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|  4.25M|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
 1880|       |
 1881|  4.25M|    if (b->skip) {
  ------------------
  |  Branch (1881:9): [True: 3.97M, False: 281k]
  ------------------
 1882|       |        // reset coef contexts
 1883|  3.97M|        BlockContext *const a = t->a;
 1884|  3.97M|        dav1d_memset_pow2[b_dim[2]](&a->lcoef[bx4], 0x40);
 1885|  3.97M|        dav1d_memset_pow2[b_dim[3]](&t->l.lcoef[by4], 0x40);
 1886|  3.97M|        if (has_chroma) {
  ------------------
  |  Branch (1886:13): [True: 162k, False: 3.80M]
  ------------------
 1887|   162k|            dav1d_memset_pow2_fn memset_cw = dav1d_memset_pow2[ulog2(cbw4)];
 1888|   162k|            dav1d_memset_pow2_fn memset_ch = dav1d_memset_pow2[ulog2(cbh4)];
 1889|   162k|            memset_cw(&a->ccoef[0][cbx4], 0x40);
 1890|   162k|            memset_cw(&a->ccoef[1][cbx4], 0x40);
 1891|   162k|            memset_ch(&t->l.ccoef[0][cby4], 0x40);
 1892|   162k|            memset_ch(&t->l.ccoef[1][cby4], 0x40);
 1893|   162k|        }
 1894|  3.97M|        return 0;
 1895|  3.97M|    }
 1896|       |
 1897|   281k|    const TxfmInfo *const uvtx = &dav1d_txfm_dimensions[b->uvtx];
 1898|   281k|    const TxfmInfo *const ytx = &dav1d_txfm_dimensions[b->max_ytx];
 1899|   281k|    const uint16_t tx_split[2] = { b->tx_split0, b->tx_split1 };
 1900|       |
 1901|   567k|    for (int init_y = 0; init_y < bh4; init_y += 16) {
  ------------------
  |  Branch (1901:26): [True: 285k, False: 281k]
  ------------------
 1902|   575k|        for (int init_x = 0; init_x < bw4; init_x += 16) {
  ------------------
  |  Branch (1902:30): [True: 290k, False: 285k]
  ------------------
 1903|       |            // coefficient coding & inverse transforms
 1904|   290k|            int y_off = !!init_y, y;
 1905|   290k|            dst += PXSTRIDE(f->cur.stride[0]) * 4 * init_y;
 1906|   583k|            for (y = init_y, t->by += init_y; y < imin(h4, init_y + 16);
  ------------------
  |  Branch (1906:47): [True: 293k, False: 290k]
  ------------------
 1907|   293k|                 y += ytx->h, y_off++)
 1908|   293k|            {
 1909|   293k|                int x, x_off = !!init_x;
 1910|   594k|                for (x = init_x, t->bx += init_x; x < imin(w4, init_x + 16);
  ------------------
  |  Branch (1910:51): [True: 300k, False: 293k]
  ------------------
 1911|   300k|                     x += ytx->w, x_off++)
 1912|   300k|                {
 1913|   300k|                    read_coef_tree(t, bs, b, b->max_ytx, 0, tx_split,
 1914|   300k|                                   x_off, y_off, &dst[x * 4]);
 1915|   300k|                    t->bx += ytx->w;
 1916|   300k|                }
 1917|   293k|                dst += PXSTRIDE(f->cur.stride[0]) * 4 * ytx->h;
 1918|   293k|                t->bx -= x;
 1919|   293k|                t->by += ytx->h;
 1920|   293k|            }
 1921|   290k|            dst -= PXSTRIDE(f->cur.stride[0]) * 4 * y;
 1922|   290k|            t->by -= y;
 1923|       |
 1924|       |            // chroma coefs and inverse transform
 1925|   637k|            if (has_chroma) for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1925:17): [True: 213k, False: 76.3k]
  |  Branch (1925:46): [True: 424k, False: 213k]
  ------------------
 1926|   424k|                pixel *uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff +
 1927|   424k|                    (PXSTRIDE(f->cur.stride[1]) * init_y * 4 >> ss_ver);
 1928|   424k|                for (y = init_y >> ss_ver, t->by += init_y;
 1929|   857k|                     y < imin(ch4, (init_y + 16) >> ss_ver); y += uvtx->h)
  ------------------
  |  Branch (1929:22): [True: 433k, False: 424k]
  ------------------
 1930|   433k|                {
 1931|   433k|                    int x;
 1932|   433k|                    for (x = init_x >> ss_hor, t->bx += init_x;
 1933|   882k|                         x < imin(cw4, (init_x + 16) >> ss_hor); x += uvtx->w)
  ------------------
  |  Branch (1933:26): [True: 449k, False: 433k]
  ------------------
 1934|   449k|                    {
 1935|   449k|                        coef *cf;
 1936|   449k|                        int eob;
 1937|   449k|                        enum TxfmType txtp;
 1938|   449k|                        if (t->frame_thread.pass) {
  ------------------
  |  Branch (1938:29): [True: 449k, False: 18.4E]
  ------------------
 1939|   449k|                            const int p = t->frame_thread.pass & 1;
 1940|   449k|                            const int cbi = *ts->frame_thread[p].cbi++;
 1941|   449k|                            cf = ts->frame_thread[p].cf;
 1942|   449k|                            ts->frame_thread[p].cf += uvtx->w * uvtx->h * 16;
 1943|   449k|                            eob  = cbi >> 5;
 1944|   449k|                            txtp = cbi & 0x1f;
 1945|  18.4E|                        } else {
 1946|  18.4E|                            uint8_t cf_ctx;
 1947|  18.4E|                            cf = bitfn(t->cf);
  ------------------
  |  |   77|  18.4E|#define bitfn(x) x##_16bpc
  ------------------
 1948|  18.4E|                            txtp = t->scratch.txtp_map[(by4 + (y << ss_ver)) * 32 +
 1949|  18.4E|                                                        bx4 + (x << ss_hor)];
 1950|  18.4E|                            eob = decode_coefs(t, &t->a->ccoef[pl][cbx4 + x],
 1951|  18.4E|                                               &t->l.ccoef[pl][cby4 + y],
 1952|  18.4E|                                               b->uvtx, bs, b, 0, 1 + pl,
 1953|  18.4E|                                               cf, &txtp, &cf_ctx);
 1954|  18.4E|                            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  18.4E|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 18.4E]
  |  |  ------------------
  |  |   35|  18.4E|        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|  18.4E|        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|  18.4E|                            int ctw = imin(uvtx->w, (f->bw - t->bx + ss_hor) >> ss_hor);
 1959|  18.4E|                            int cth = imin(uvtx->h, (f->bh - t->by + ss_ver) >> ss_ver);
 1960|  18.4E|                            dav1d_memset_likely_pow2(&t->a->ccoef[pl][cbx4 + x], cf_ctx, ctw);
 1961|  18.4E|                            dav1d_memset_likely_pow2(&t->l.ccoef[pl][cby4 + y], cf_ctx, cth);
 1962|  18.4E|                        }
 1963|   449k|                        if (eob >= 0) {
  ------------------
  |  Branch (1963:29): [True: 136k, False: 312k]
  ------------------
 1964|   136k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   136k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 136k]
  |  |  ------------------
  |  |   35|   136k|        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|   136k|        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|   136k|                            dsp->itx.itxfm_add[b->uvtx]
 1967|   136k|                                              [txtp](&uvdst[4 * x],
 1968|   136k|                                                     f->cur.stride[1],
 1969|   136k|                                                     cf, eob HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   136k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1970|   136k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   136k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 136k]
  |  |  ------------------
  |  |   35|   136k|        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|   136k|        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|   136k|                        }
 1974|   449k|                        t->bx += uvtx->w << ss_hor;
 1975|   449k|                    }
 1976|   433k|                    uvdst += PXSTRIDE(f->cur.stride[1]) * 4 * uvtx->h;
 1977|   433k|                    t->bx -= x << ss_hor;
 1978|   433k|                    t->by += uvtx->h << ss_ver;
 1979|   433k|                }
 1980|   424k|                t->by -= y << ss_ver;
 1981|   424k|            }
 1982|   290k|        }
 1983|   285k|    }
 1984|   281k|    return 0;
 1985|  4.25M|}
dav1d_filter_sbrow_deblock_cols_16bpc:
 1987|  3.44M|void bytefn(dav1d_filter_sbrow_deblock_cols)(Dav1dFrameContext *const f, const int sby) {
 1988|  3.44M|    if (!(f->c->inloop_filters & DAV1D_INLOOPFILTER_DEBLOCK) ||
  ------------------
  |  Branch (1988:9): [True: 18.4E, False: 3.44M]
  ------------------
 1989|  3.44M|        (!f->frame_hdr->loopfilter.level_y[0] && !f->frame_hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (1989:10): [True: 19.0k, False: 3.42M]
  |  Branch (1989:50): [True: 0, False: 19.0k]
  ------------------
 1990|      0|    {
 1991|      0|        return;
 1992|      0|    }
 1993|  3.44M|    const int y = sby * f->sb_step * 4;
 1994|  3.44M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1995|  3.44M|    pixel *const p[3] = {
 1996|  3.44M|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
 1997|  3.44M|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 1998|  3.44M|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
 1999|  3.44M|    };
 2000|  3.44M|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2001|  3.44M|    bytefn(dav1d_loopfilter_sbrow_cols)(f, p, mask, sby,
  ------------------
  |  |   87|  3.44M|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  3.44M|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2002|  3.44M|                                        f->lf.start_of_tile_row[sby]);
 2003|  3.44M|}
dav1d_filter_sbrow_deblock_rows_16bpc:
 2005|  3.44M|void bytefn(dav1d_filter_sbrow_deblock_rows)(Dav1dFrameContext *const f, const int sby) {
 2006|  3.44M|    const int y = sby * f->sb_step * 4;
 2007|  3.44M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2008|  3.44M|    pixel *const p[3] = {
 2009|  3.44M|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
 2010|  3.44M|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 2011|  3.44M|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
 2012|  3.44M|    };
 2013|  3.44M|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2014|  3.44M|    if (f->c->inloop_filters & DAV1D_INLOOPFILTER_DEBLOCK &&
  ------------------
  |  Branch (2014:9): [True: 3.44M, False: 405]
  ------------------
 2015|  3.44M|        (f->frame_hdr->loopfilter.level_y[0] || f->frame_hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (2015:10): [True: 3.42M, False: 24.8k]
  |  Branch (2015:49): [True: 19.0k, False: 5.73k]
  ------------------
 2016|  3.44M|    {
 2017|  3.44M|        bytefn(dav1d_loopfilter_sbrow_rows)(f, p, mask, sby);
  ------------------
  |  |   87|  3.44M|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  3.44M|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2018|  3.44M|    }
 2019|  3.44M|    if (f->lf.cdef_planes || f->lf.restore_planes) {
  ------------------
  |  Branch (2019:9): [True: 2.02M, False: 1.42M]
  |  Branch (2019:30): [True: 31.3k, False: 1.39M]
  ------------------
 2020|       |        // Store loop filtered pixels required by CDEF / LR
 2021|  2.05M|        bytefn(dav1d_copy_lpf)(f, p, sby);
  ------------------
  |  |   87|  2.05M|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  2.05M|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2022|  2.05M|    }
 2023|  3.44M|}
dav1d_filter_sbrow_cdef_16bpc:
 2025|  2.02M|void bytefn(dav1d_filter_sbrow_cdef)(Dav1dTaskContext *const tc, const int sby) {
 2026|  2.02M|    const Dav1dFrameContext *const f = tc->f;
 2027|  2.02M|    const int sbsz = f->sb_step;
 2028|  2.02M|    const int y = sby * sbsz * 4;
 2029|  2.02M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2030|  2.02M|    pixel *const p[3] = {
 2031|  2.02M|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
 2032|  2.02M|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 2033|  2.02M|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
 2034|  2.02M|    };
 2035|  2.02M|    Av1Filter *prev_mask = f->lf.mask + ((sby - 1) >> !f->seq_hdr->sb128) * f->sb128w;
 2036|  2.02M|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2037|  2.02M|    const int start = sby * sbsz;
 2038|  2.02M|    if (sby) {
  ------------------
  |  Branch (2038:9): [True: 2.00M, False: 15.9k]
  ------------------
 2039|  2.00M|        const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2040|  2.00M|        pixel *p_up[3] = {
 2041|  2.00M|            p[0] - 8 * PXSTRIDE(f->cur.stride[0]),
 2042|  2.00M|            p[1] - (8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 2043|  2.00M|            p[2] - (8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 2044|  2.00M|        };
 2045|  2.00M|        bytefn(dav1d_cdef_brow)(tc, p_up, prev_mask, start - 2, start, 1, sby);
  ------------------
  |  |   87|  2.00M|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  2.00M|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2046|  2.00M|    }
 2047|  2.02M|    const int n_blks = sbsz - 2 * (sby + 1 < f->sbh);
 2048|  2.02M|    const int end = imin(start + n_blks, f->bh);
 2049|  2.02M|    bytefn(dav1d_cdef_brow)(tc, p, mask, start, end, 0, sby);
  ------------------
  |  |   87|  2.02M|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  2.02M|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2050|  2.02M|}
dav1d_filter_sbrow_resize_16bpc:
 2052|   146k|void bytefn(dav1d_filter_sbrow_resize)(Dav1dFrameContext *const f, const int sby) {
 2053|   146k|    const int sbsz = f->sb_step;
 2054|   146k|    const int y = sby * sbsz * 4;
 2055|   146k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2056|   146k|    const pixel *const p[3] = {
 2057|   146k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
 2058|   146k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 2059|   146k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
 2060|   146k|    };
 2061|   146k|    pixel *const sr_p[3] = {
 2062|   146k|        f->lf.sr_p[0] + y * PXSTRIDE(f->sr_cur.p.stride[0]),
 2063|   146k|        f->lf.sr_p[1] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver),
 2064|   146k|        f->lf.sr_p[2] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver)
 2065|   146k|    };
 2066|   146k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400;
 2067|   310k|    for (int pl = 0; pl < 1 + 2 * has_chroma; pl++) {
  ------------------
  |  Branch (2067:22): [True: 163k, False: 146k]
  ------------------
 2068|   163k|        const int ss_ver = pl && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (2068:28): [True: 17.2k, False: 146k]
  |  Branch (2068:34): [True: 8.04k, False: 9.17k]
  ------------------
 2069|   163k|        const int h_start = 8 * !!sby >> ss_ver;
 2070|   163k|        const ptrdiff_t dst_stride = f->sr_cur.p.stride[!!pl];
 2071|   163k|        pixel *dst = sr_p[pl] - h_start * PXSTRIDE(dst_stride);
 2072|   163k|        const ptrdiff_t src_stride = f->cur.stride[!!pl];
 2073|   163k|        const pixel *src = p[pl] - h_start * PXSTRIDE(src_stride);
 2074|   163k|        const int h_end = 4 * (sbsz - 2 * (sby + 1 < f->sbh)) >> ss_ver;
 2075|   163k|        const int ss_hor = pl && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (2075:28): [True: 17.2k, False: 146k]
  |  Branch (2075:34): [True: 9.52k, False: 7.69k]
  ------------------
 2076|   163k|        const int dst_w = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
 2077|   163k|        const int src_w = (4 * f->bw + ss_hor) >> ss_hor;
 2078|   163k|        const int img_h = (f->cur.p.h - sbsz * 4 * sby + ss_ver) >> ss_ver;
 2079|       |
 2080|   163k|        f->dsp->mc.resize(dst, dst_stride, src, src_stride, dst_w,
 2081|   163k|                          imin(img_h, h_end) + h_start, src_w,
 2082|   163k|                          f->resize_step[!!pl], f->resize_start[!!pl]
 2083|   163k|                          HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   163k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 2084|   163k|    }
 2085|   146k|}
dav1d_filter_sbrow_lr_16bpc:
 2087|   150k|void bytefn(dav1d_filter_sbrow_lr)(Dav1dFrameContext *const f, const int sby) {
 2088|   150k|    if (!(f->c->inloop_filters & DAV1D_INLOOPFILTER_RESTORATION)) return;
  ------------------
  |  Branch (2088:9): [True: 0, False: 150k]
  ------------------
 2089|   150k|    const int y = sby * f->sb_step * 4;
 2090|   150k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2091|   150k|    pixel *const sr_p[3] = {
 2092|   150k|        f->lf.sr_p[0] + y * PXSTRIDE(f->sr_cur.p.stride[0]),
 2093|   150k|        f->lf.sr_p[1] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver),
 2094|   150k|        f->lf.sr_p[2] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver)
 2095|   150k|    };
 2096|   150k|    bytefn(dav1d_lr_sbrow)(f, sr_p, sby);
  ------------------
  |  |   87|   150k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|   150k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2097|   150k|}
dav1d_backup_ipred_edge_16bpc:
 2110|  3.93M|void bytefn(dav1d_backup_ipred_edge)(Dav1dTaskContext *const t) {
 2111|  3.93M|    const Dav1dFrameContext *const f = t->f;
 2112|  3.93M|    Dav1dTileState *const ts = t->ts;
 2113|  3.93M|    const int sby = t->by >> f->sb_shift;
 2114|  3.93M|    const int sby_off = f->sb128w * 128 * sby;
 2115|  3.93M|    const int x_off = ts->tiling.col_start;
 2116|       |
 2117|  3.93M|    const pixel *const y =
 2118|  3.93M|        ((const pixel *) f->cur.data[0]) + x_off * 4 +
 2119|  3.93M|                    ((t->by + f->sb_step) * 4 - 1) * PXSTRIDE(f->cur.stride[0]);
 2120|  3.93M|    pixel_copy(&f->ipred_edge[0][sby_off + x_off * 4], y,
  ------------------
  |  |   65|  3.93M|#define pixel_copy(a, b, c) memcpy(a, b, (c) << 1)
  ------------------
 2121|  3.93M|               4 * (ts->tiling.col_end - x_off));
 2122|       |
 2123|  3.93M|    if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (2123:9): [True: 126k, False: 3.80M]
  ------------------
 2124|   126k|        const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2125|   126k|        const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 2126|       |
 2127|   126k|        const ptrdiff_t uv_off = (x_off * 4 >> ss_hor) +
 2128|   126k|            (((t->by + f->sb_step) * 4 >> ss_ver) - 1) * PXSTRIDE(f->cur.stride[1]);
 2129|   379k|        for (int pl = 1; pl <= 2; pl++)
  ------------------
  |  Branch (2129:26): [True: 252k, False: 126k]
  ------------------
 2130|   252k|            pixel_copy(&f->ipred_edge[pl][sby_off + (x_off * 4 >> ss_hor)],
  ------------------
  |  |   65|   252k|#define pixel_copy(a, b, c) memcpy(a, b, (c) << 1)
  ------------------
 2131|   126k|                       &((const pixel *) f->cur.data[pl])[uv_off],
 2132|   126k|                       4 * (ts->tiling.col_end - x_off) >> ss_hor);
 2133|   126k|    }
 2134|  3.93M|}
dav1d_copy_pal_block_y_16bpc:
 2140|   108k|{
 2141|   108k|    const Dav1dFrameContext *const f = t->f;
 2142|   108k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2142:24): [True: 108k, False: 18.4E]
  ------------------
 2143|   108k|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2144|   108k|                            ((t->bx >> 1) + (t->by & 1))][0] :
 2145|  18.4E|        bytefn(t->scratch.pal)[0];
  ------------------
  |  |   87|  18.4E|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|   108k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2146|   488k|    for (int x = 0; x < bw4; x++)
  ------------------
  |  Branch (2146:21): [True: 380k, False: 108k]
  ------------------
 2147|   380k|        memcpy(bytefn(t->al_pal)[0][bx4 + x][0], pal, 8 * sizeof(pixel));
  ------------------
  |  |   87|   380k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|   380k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2148|   357k|    for (int y = 0; y < bh4; y++)
  ------------------
  |  Branch (2148:21): [True: 249k, False: 108k]
  ------------------
 2149|   249k|        memcpy(bytefn(t->al_pal)[1][by4 + y][0], pal, 8 * sizeof(pixel));
  ------------------
  |  |   87|   249k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|   249k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2150|   108k|}
dav1d_copy_pal_block_uv_16bpc:
 2156|  17.3k|{
 2157|  17.3k|    const Dav1dFrameContext *const f = t->f;
 2158|  17.3k|    const pixel (*const pal)[8] = t->frame_thread.pass ?
  ------------------
  |  Branch (2158:35): [True: 17.3k, False: 0]
  ------------------
 2159|  17.3k|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2160|  17.3k|                            ((t->bx >> 1) + (t->by & 1))] :
 2161|  17.3k|        bytefn(t->scratch.pal);
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|      0|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2162|       |    // see aomedia bug 2183 for why we use luma coordinates here
 2163|  51.9k|    for (int pl = 1; pl <= 2; pl++) {
  ------------------
  |  Branch (2163:22): [True: 34.6k, False: 17.3k]
  ------------------
 2164|   199k|        for (int x = 0; x < bw4; x++)
  ------------------
  |  Branch (2164:25): [True: 164k, False: 34.6k]
  ------------------
 2165|   164k|            memcpy(bytefn(t->al_pal)[0][bx4 + x][pl], pal[pl], 8 * sizeof(pixel));
  ------------------
  |  |   87|   164k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|   164k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2166|   178k|        for (int y = 0; y < bh4; y++)
  ------------------
  |  Branch (2166:25): [True: 144k, False: 34.6k]
  ------------------
 2167|   144k|            memcpy(bytefn(t->al_pal)[1][by4 + y][pl], pal[pl], 8 * sizeof(pixel));
  ------------------
  |  |   87|   144k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|   144k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2168|  34.6k|    }
 2169|  17.3k|}
dav1d_read_pal_plane_16bpc:
 2174|   125k|{
 2175|   125k|    Dav1dTileState *const ts = t->ts;
 2176|   125k|    const Dav1dFrameContext *const f = t->f;
 2177|   125k|    const int pal_sz = b->pal_sz[pl] = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|   125k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 2178|   125k|                                           ts->cdf.m.pal_sz[pl][sz_ctx], 6) + 2;
 2179|   125k|    pixel cache[16], used_cache[8];
 2180|   125k|    int l_cache = pl ? t->pal_sz_uv[1][by4] : t->l.pal_sz[by4];
  ------------------
  |  Branch (2180:19): [True: 17.3k, False: 108k]
  ------------------
 2181|   125k|    int n_cache = 0;
 2182|       |    // don't reuse above palette outside SB64 boundaries
 2183|   125k|    int a_cache = by4 & 15 ? pl ? t->pal_sz_uv[0][bx4] : t->a->pal_sz[bx4] : 0;
  ------------------
  |  Branch (2183:19): [True: 115k, False: 9.49k]
  |  Branch (2183:30): [True: 13.8k, False: 102k]
  ------------------
 2184|   125k|    const pixel *l = bytefn(t->al_pal)[1][by4][pl];
  ------------------
  |  |   87|   125k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|   125k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2185|   125k|    const pixel *a = bytefn(t->al_pal)[0][bx4][pl];
  ------------------
  |  |   87|   125k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|   125k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2186|       |
 2187|       |    // fill/sort cache
 2188|   194k|    while (l_cache && a_cache) {
  ------------------
  |  Branch (2188:12): [True: 91.9k, False: 102k]
  |  Branch (2188:23): [True: 68.7k, False: 23.1k]
  ------------------
 2189|  68.7k|        if (*l < *a) {
  ------------------
  |  Branch (2189:13): [True: 34.1k, False: 34.6k]
  ------------------
 2190|  34.1k|            if (!n_cache || cache[n_cache - 1] != *l)
  ------------------
  |  Branch (2190:17): [True: 6.71k, False: 27.4k]
  |  Branch (2190:29): [True: 26.3k, False: 1.15k]
  ------------------
 2191|  33.0k|                cache[n_cache++] = *l;
 2192|  34.1k|            l++;
 2193|  34.1k|            l_cache--;
 2194|  34.6k|        } else {
 2195|  34.6k|            if (*a == *l) {
  ------------------
  |  Branch (2195:17): [True: 11.5k, False: 23.0k]
  ------------------
 2196|  11.5k|                l++;
 2197|  11.5k|                l_cache--;
 2198|  11.5k|            }
 2199|  34.6k|            if (!n_cache || cache[n_cache - 1] != *a)
  ------------------
  |  Branch (2199:17): [True: 4.77k, False: 29.8k]
  |  Branch (2199:29): [True: 29.4k, False: 396]
  ------------------
 2200|  34.2k|                cache[n_cache++] = *a;
 2201|  34.6k|            a++;
 2202|  34.6k|            a_cache--;
 2203|  34.6k|        }
 2204|  68.7k|    }
 2205|   125k|    if (l_cache) {
  ------------------
  |  Branch (2205:9): [True: 23.2k, False: 102k]
  ------------------
 2206|  98.6k|        do {
 2207|  98.6k|            if (!n_cache || cache[n_cache - 1] != *l)
  ------------------
  |  Branch (2207:17): [True: 19.5k, False: 79.1k]
  |  Branch (2207:29): [True: 64.1k, False: 14.9k]
  ------------------
 2208|  83.7k|                cache[n_cache++] = *l;
 2209|  98.6k|            l++;
 2210|  98.6k|        } while (--l_cache > 0);
  ------------------
  |  Branch (2210:18): [True: 75.3k, False: 23.2k]
  ------------------
 2211|   102k|    } else if (a_cache) {
  ------------------
  |  Branch (2211:16): [True: 46.5k, False: 55.5k]
  ------------------
 2212|   223k|        do {
 2213|   223k|            if (!n_cache || cache[n_cache - 1] != *a)
  ------------------
  |  Branch (2213:17): [True: 40.1k, False: 183k]
  |  Branch (2213:29): [True: 145k, False: 38.3k]
  ------------------
 2214|   185k|                cache[n_cache++] = *a;
 2215|   223k|            a++;
 2216|   223k|        } while (--a_cache > 0);
  ------------------
  |  Branch (2216:18): [True: 176k, False: 46.5k]
  ------------------
 2217|  46.5k|    }
 2218|       |
 2219|       |    // find reused cache entries
 2220|   125k|    int i = 0;
 2221|   433k|    for (int n = 0; n < n_cache && i < pal_sz; n++)
  ------------------
  |  Branch (2221:21): [True: 317k, False: 115k]
  |  Branch (2221:36): [True: 308k, False: 9.70k]
  ------------------
 2222|   308k|        if (dav1d_msac_decode_bool_equi(&ts->msac))
  ------------------
  |  |   53|   308k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (2222:13): [True: 195k, False: 112k]
  ------------------
 2223|   195k|            used_cache[i++] = cache[n];
 2224|   125k|    const int n_used_cache = i;
 2225|       |
 2226|       |    // parse new entries
 2227|   125k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2227:24): [True: 125k, False: 18.4E]
  ------------------
 2228|   125k|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2229|   125k|                            ((t->bx >> 1) + (t->by & 1))][pl] :
 2230|  18.4E|        bytefn(t->scratch.pal)[pl];
  ------------------
  |  |   87|  18.4E|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|   125k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2231|   125k|    if (i < pal_sz) {
  ------------------
  |  Branch (2231:9): [True: 88.3k, False: 37.0k]
  ------------------
 2232|  88.3k|        const int bpc = BITDEPTH == 8 ? 8 : f->cur.p.bpc;
  ------------------
  |  Branch (2232:25): [Folded, False: 88.3k]
  ------------------
 2233|  88.3k|        int prev = pal[i++] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2234|       |
 2235|  88.3k|        if (i < pal_sz) {
  ------------------
  |  Branch (2235:13): [True: 80.7k, False: 7.60k]
  ------------------
 2236|  80.7k|            int bits = bpc - 3 + dav1d_msac_decode_bools(&ts->msac, 2);
 2237|  80.7k|            const int max = (1 << bpc) - 1;
 2238|       |
 2239|   215k|            do {
 2240|   215k|                const int delta = dav1d_msac_decode_bools(&ts->msac, bits);
 2241|   215k|                prev = pal[i++] = imin(prev + delta + !pl, max);
 2242|   215k|                if (prev + !pl >= max) {
  ------------------
  |  Branch (2242:21): [True: 47.6k, False: 168k]
  ------------------
 2243|   111k|                    for (; i < pal_sz; i++)
  ------------------
  |  Branch (2243:28): [True: 64.2k, False: 47.6k]
  ------------------
 2244|  64.2k|                        pal[i] = max;
 2245|  47.6k|                    break;
 2246|  47.6k|                }
 2247|   168k|                bits = imin(bits, 1 + ulog2(max - prev - !pl));
 2248|   168k|            } while (i < pal_sz);
  ------------------
  |  Branch (2248:22): [True: 135k, False: 33.0k]
  ------------------
 2249|  80.7k|        }
 2250|       |
 2251|       |        // merge cache+new entries
 2252|  88.3k|        int n = 0, m = n_used_cache;
 2253|   515k|        for (i = 0; i < pal_sz; i++) {
  ------------------
  |  Branch (2253:21): [True: 426k, False: 88.4k]
  ------------------
 2254|   426k|            if (n < n_used_cache && (m >= pal_sz || used_cache[n] <= pal[m])) {
  ------------------
  |  Branch (2254:17): [True: 100k, False: 326k]
  |  Branch (2254:38): [True: 21.2k, False: 78.7k]
  |  Branch (2254:53): [True: 37.6k, False: 41.1k]
  ------------------
 2255|  58.9k|                pal[i] = used_cache[n++];
 2256|   367k|            } else {
 2257|   367k|                assert(m < pal_sz);
  ------------------
  |  Branch (2257:17): [True: 368k, False: 18.4E]
  ------------------
 2258|   368k|                pal[i] = pal[m++];
 2259|   368k|            }
 2260|   426k|        }
 2261|  88.3k|    } else {
 2262|  37.0k|        memcpy(pal, used_cache, n_used_cache * sizeof(*used_cache));
 2263|  37.0k|    }
 2264|       |
 2265|   125k|    if (DEBUG_BLOCK_INFO) {
  ------------------
  |  |   34|   125k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 125k]
  |  |  ------------------
  |  |   35|   125k|        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|   125k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2266|      0|        printf("Post-pal[pl=%d,sz=%d,cache_size=%d,used_cache=%d]: r=%d, cache=",
 2267|      0|               pl, pal_sz, n_cache, n_used_cache, ts->msac.rng);
 2268|      0|        for (int n = 0; n < n_cache; n++)
  ------------------
  |  Branch (2268:25): [True: 0, False: 0]
  ------------------
 2269|      0|            printf("%c%02x", n ? ' ' : '[', cache[n]);
  ------------------
  |  Branch (2269:30): [True: 0, False: 0]
  ------------------
 2270|      0|        printf("%s, pal=", n_cache ? "]" : "[]");
  ------------------
  |  Branch (2270:28): [True: 0, False: 0]
  ------------------
 2271|      0|        for (int n = 0; n < pal_sz; n++)
  ------------------
  |  Branch (2271:25): [True: 0, False: 0]
  ------------------
 2272|      0|            printf("%c%02x", n ? ' ' : '[', pal[n]);
  ------------------
  |  Branch (2272:30): [True: 0, False: 0]
  ------------------
 2273|      0|        printf("]\n");
 2274|      0|    }
 2275|   125k|}
dav1d_read_pal_uv_16bpc:
 2279|  17.3k|{
 2280|  17.3k|    bytefn(dav1d_read_pal_plane)(t, b, 1, sz_ctx, bx4, by4);
  ------------------
  |  |   87|  17.3k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  17.3k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2281|       |
 2282|       |    // V pal coding
 2283|  17.3k|    Dav1dTileState *const ts = t->ts;
 2284|  17.3k|    const Dav1dFrameContext *const f = t->f;
 2285|  17.3k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2285:24): [True: 17.3k, False: 0]
  ------------------
 2286|  17.3k|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2287|  17.3k|                            ((t->bx >> 1) + (t->by & 1))][2] :
 2288|  17.3k|        bytefn(t->scratch.pal)[2];
  ------------------
  |  |   87|      0|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  17.3k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2289|  17.3k|    const int bpc = BITDEPTH == 8 ? 8 : f->cur.p.bpc;
  ------------------
  |  Branch (2289:21): [Folded, False: 17.3k]
  ------------------
 2290|  17.3k|    if (dav1d_msac_decode_bool_equi(&ts->msac)) {
  ------------------
  |  |   53|  17.3k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (2290:9): [True: 9.08k, False: 8.24k]
  ------------------
 2291|  9.08k|        const int bits = bpc - 4 + dav1d_msac_decode_bools(&ts->msac, 2);
 2292|  9.08k|        int prev = pal[0] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2293|  9.08k|        const int max = (1 << bpc) - 1;
 2294|  35.0k|        for (int i = 1; i < b->pal_sz[1]; i++) {
  ------------------
  |  Branch (2294:25): [True: 25.9k, False: 9.08k]
  ------------------
 2295|  25.9k|            int delta = dav1d_msac_decode_bools(&ts->msac, bits);
 2296|  25.9k|            if (delta) {
  ------------------
  |  Branch (2296:17): [True: 25.6k, False: 271]
  ------------------
 2297|  25.6k|                const int sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  25.6k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
 2298|  25.6k|                delta = apply_sign_bool(delta, sign);
 2299|  25.6k|            }
 2300|  25.9k|            prev = pal[i] = (prev + delta) & max;
 2301|  25.9k|        }
 2302|  9.08k|    } else {
 2303|  38.2k|        for (int i = 0; i < b->pal_sz[1]; i++)
  ------------------
  |  Branch (2303:25): [True: 30.0k, False: 8.24k]
  ------------------
 2304|  30.0k|            pal[i] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2305|  8.24k|    }
 2306|  17.3k|    if (DEBUG_BLOCK_INFO) {
  ------------------
  |  |   34|  17.3k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 17.3k]
  |  |  ------------------
  |  |   35|  17.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|  17.3k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2307|      0|        printf("Post-pal[pl=2]: r=%d ", ts->msac.rng);
 2308|      0|        for (int n = 0; n < b->pal_sz[1]; n++)
  ------------------
  |  Branch (2308:25): [True: 0, False: 0]
  ------------------
 2309|      0|            printf("%c%02x", n ? ' ' : '[', pal[n]);
  ------------------
  |  Branch (2309:30): [True: 0, False: 0]
  ------------------
 2310|      0|        printf("]\n");
 2311|      0|    }
 2312|  17.3k|}

dav1d_ref_create:
   37|   285k|Dav1dRef *dav1d_ref_create(const enum AllocationType type, size_t size) {
   38|   285k|    size = (size + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
   39|       |
   40|   285k|    uint8_t *const data = dav1d_alloc_aligned(type, size + sizeof(Dav1dRef), 64);
  ------------------
  |  |  134|   285k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
   41|   285k|    if (!data) return NULL;
  ------------------
  |  Branch (41:9): [True: 0, False: 285k]
  ------------------
   42|       |
   43|   285k|    Dav1dRef *const res = (Dav1dRef*)(data + size);
   44|   285k|    res->const_data = res->user_data = res->data = data;
   45|   285k|    atomic_init(&res->ref_cnt, 1);
   46|   285k|    res->free_ref = 0;
   47|   285k|    res->free_callback = default_free_callback;
   48|       |
   49|   285k|    return res;
   50|   285k|}
dav1d_ref_create_using_pool:
   56|   518k|Dav1dRef *dav1d_ref_create_using_pool(Dav1dMemPool *const pool, size_t size) {
   57|   518k|    void *const buf = dav1d_mem_pool_pop(pool, size);
   58|   518k|    if (!buf) return NULL;
  ------------------
  |  Branch (58:9): [True: 0, False: 518k]
  ------------------
   59|       |
   60|       |    /* Store Dav1dRef inside the Dav1dMemPoolBuffer alignment padding */
   61|   518k|    assert(sizeof(Dav1dMemPoolBuffer) + sizeof(Dav1dRef) <= 64);
  ------------------
  |  Branch (61:5): [True: 518k, Folded]
  ------------------
   62|   518k|    Dav1dRef *const res = &((Dav1dRef*)buf)[-1];
   63|   518k|    res->data = buf;
   64|   518k|    res->const_data = pool;
   65|   518k|    atomic_init(&res->ref_cnt, 1);
   66|   518k|    res->free_ref = 0;
   67|   518k|    res->free_callback = pool_free_callback;
   68|   518k|    res->user_data = buf;
   69|       |
   70|   518k|    return res;
   71|   518k|}
dav1d_ref_dec:
   73|  32.7M|void dav1d_ref_dec(Dav1dRef **const pref) {
   74|  32.7M|    assert(pref != NULL);
  ------------------
  |  Branch (74:5): [True: 32.7M, False: 18.4E]
  ------------------
   75|       |
   76|  32.7M|    Dav1dRef *const ref = *pref;
   77|  32.7M|    if (!ref) return;
  ------------------
  |  Branch (77:9): [True: 21.4M, False: 11.3M]
  ------------------
   78|       |
   79|  11.3M|    *pref = NULL;
   80|  11.3M|    if (atomic_fetch_sub_explicit(&ref->ref_cnt, 1, memory_order_acq_rel) == 1) {
  ------------------
  |  Branch (80:9): [True: 1.06M, False: 10.2M]
  ------------------
   81|  1.06M|        const int free_ref = ref->free_ref;
   82|  1.06M|        ref->free_callback(ref->const_data, ref->user_data);
   83|  1.06M|        if (free_ref) dav1d_free(ref);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
  |  Branch (83:13): [True: 0, False: 1.06M]
  ------------------
   84|  1.06M|    }
   85|  11.3M|}
ref.c:default_free_callback:
   32|   285k|static void default_free_callback(const uint8_t *const data, void *const user_data) {
   33|   285k|    assert(data == user_data);
  ------------------
  |  Branch (33:5): [True: 285k, False: 18.4E]
  ------------------
   34|   285k|    dav1d_free_aligned(user_data);
  ------------------
  |  |  136|   285k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
   35|   285k|}
ref.c:pool_free_callback:
   52|   518k|static void pool_free_callback(const uint8_t *const data, void *const user_data) {
   53|   518k|    dav1d_mem_pool_push((Dav1dMemPool*)data, user_data);
   54|   518k|}

obu.c:dav1d_ref_is_writable:
   73|   284k|static inline int dav1d_ref_is_writable(Dav1dRef *const ref) {
   74|   284k|    return atomic_load_explicit(&ref->ref_cnt, memory_order_acquire) == 1 && ref->data;
  ------------------
  |  Branch (74:12): [True: 284k, False: 0]
  |  Branch (74:78): [True: 284k, False: 0]
  ------------------
   75|   284k|}
obu.c:dav1d_ref_init:
   59|    823|{
   60|    823|    ref->data = NULL;
   61|    823|    ref->const_data = ptr;
   62|       |    atomic_init(&ref->ref_cnt, 1);
   63|    823|    ref->free_ref = free_ref;
   64|    823|    ref->free_callback = free_callback;
   65|    823|    ref->user_data = user_data;
   66|    823|    return ref;
   67|    823|}
obu.c:dav1d_ref_inc:
   69|  11.0k|static inline void dav1d_ref_inc(Dav1dRef *const ref) {
   70|       |    atomic_fetch_add_explicit(&ref->ref_cnt, 1, memory_order_relaxed);
   71|  11.0k|}
picture.c:dav1d_ref_inc:
   69|  8.22M|static inline void dav1d_ref_inc(Dav1dRef *const ref) {
   70|       |    atomic_fetch_add_explicit(&ref->ref_cnt, 1, memory_order_relaxed);
   71|  8.22M|}
picture.c:dav1d_ref_init:
   59|   258k|{
   60|   258k|    ref->data = NULL;
   61|   258k|    ref->const_data = ptr;
   62|       |    atomic_init(&ref->ref_cnt, 1);
   63|   258k|    ref->free_ref = free_ref;
   64|   258k|    ref->free_callback = free_callback;
   65|   258k|    ref->user_data = user_data;
   66|   258k|    return ref;
   67|   258k|}
cdf.c:dav1d_ref_inc:
   69|   484k|static inline void dav1d_ref_inc(Dav1dRef *const ref) {
   70|       |    atomic_fetch_add_explicit(&ref->ref_cnt, 1, memory_order_relaxed);
   71|   484k|}
data.c:dav1d_ref_inc:
   69|   502k|static inline void dav1d_ref_inc(Dav1dRef *const ref) {
   70|       |    atomic_fetch_add_explicit(&ref->ref_cnt, 1, memory_order_relaxed);
   71|   502k|}
decode.c:dav1d_ref_inc:
   69|  1.03M|static inline void dav1d_ref_inc(Dav1dRef *const ref) {
   70|       |    atomic_fetch_add_explicit(&ref->ref_cnt, 1, memory_order_relaxed);
   71|  1.03M|}

dav1d_refmvs_find:
  343|  8.07M|{
  344|  8.07M|    const refmvs_frame *const rf = rt->rf;
  345|  8.07M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  346|  8.07M|    const int bw4 = b_dim[0], w4 = imin(imin(bw4, 16), rt->tile_col.end - bx4);
  347|  8.07M|    const int bh4 = b_dim[1], h4 = imin(imin(bh4, 16), rt->tile_row.end - by4);
  348|  8.07M|    mv gmv[2], tgmv[2];
  349|       |
  350|  8.07M|    *cnt = 0;
  351|  8.07M|    assert(ref.ref[0] >=  0 && ref.ref[0] <= 7 &&
  ------------------
  |  Branch (351:5): [True: 8.03M, False: 39.1k]
  |  Branch (351:5): [True: 8.04M, False: 18.4E]
  |  Branch (351:5): [True: 8.04M, False: 18.4E]
  |  Branch (351:5): [True: 8.04M, False: 18.4E]
  ------------------
  352|  8.07M|           ref.ref[1] >= -1 && ref.ref[1] <= 7);
  353|  8.04M|    if (ref.ref[0] > 0) {
  ------------------
  |  Branch (353:9): [True: 6.65M, False: 1.38M]
  ------------------
  354|  6.65M|        tgmv[0] = get_gmv_2d(&rf->frm_hdr->gmv[ref.ref[0] - 1],
  355|  6.65M|                             bx4, by4, bw4, bh4, rf->frm_hdr);
  356|  6.65M|        gmv[0] = rf->frm_hdr->gmv[ref.ref[0] - 1].type > DAV1D_WM_TYPE_TRANSLATION ?
  ------------------
  |  Branch (356:18): [True: 1.59M, False: 5.06M]
  ------------------
  357|  5.06M|                 tgmv[0] : (mv) { .n = INVALID_MV };
  ------------------
  |  |   40|  5.06M|#define INVALID_MV 0x80008000
  ------------------
  358|  6.65M|    } else {
  359|  1.38M|        tgmv[0] = (mv) { .n = 0 };
  360|  1.38M|        gmv[0] = (mv) { .n = INVALID_MV };
  ------------------
  |  |   40|  1.38M|#define INVALID_MV 0x80008000
  ------------------
  361|  1.38M|    }
  362|  8.04M|    if (ref.ref[1] > 0) {
  ------------------
  |  Branch (362:9): [True: 335k, False: 7.70M]
  ------------------
  363|   335k|        tgmv[1] = get_gmv_2d(&rf->frm_hdr->gmv[ref.ref[1] - 1],
  364|   335k|                             bx4, by4, bw4, bh4, rf->frm_hdr);
  365|   335k|        gmv[1] = rf->frm_hdr->gmv[ref.ref[1] - 1].type > DAV1D_WM_TYPE_TRANSLATION ?
  ------------------
  |  Branch (365:18): [True: 59.1k, False: 276k]
  ------------------
  366|   276k|                 tgmv[1] : (mv) { .n = INVALID_MV };
  ------------------
  |  |   40|   276k|#define INVALID_MV 0x80008000
  ------------------
  367|   335k|    }
  368|       |
  369|       |    // top
  370|  8.04M|    int have_newmv = 0, have_col_mvs = 0, have_row_mvs = 0;
  371|  8.04M|    unsigned max_rows = 0, n_rows = ~0;
  372|  8.04M|    const refmvs_block *b_top;
  373|  8.04M|    if (by4 > rt->tile_row.start) {
  ------------------
  |  Branch (373:9): [True: 7.39M, False: 644k]
  ------------------
  374|  7.39M|        max_rows = imin((by4 - rt->tile_row.start + 1) >> 1, 2 + (bh4 > 1));
  375|  7.39M|        b_top = &rt->r[(by4 & 31) - 1 + 5][bx4];
  376|  7.39M|        n_rows = scan_row(mvstack, cnt, ref, gmv, b_top,
  377|  7.39M|                          bw4, w4, max_rows, bw4 >= 16 ? 4 : 1,
  ------------------
  |  Branch (377:46): [True: 4.41M, False: 2.98M]
  ------------------
  378|  7.39M|                          &have_newmv, &have_row_mvs);
  379|  7.39M|    }
  380|       |
  381|       |    // left
  382|  8.04M|    unsigned max_cols = 0, n_cols = ~0U;
  383|  8.04M|    refmvs_block *const *b_left;
  384|  8.04M|    if (bx4 > rt->tile_col.start) {
  ------------------
  |  Branch (384:9): [True: 3.88M, False: 4.16M]
  ------------------
  385|  3.88M|        max_cols = imin((bx4 - rt->tile_col.start + 1) >> 1, 2 + (bw4 > 1));
  386|  3.88M|        b_left = &rt->r[(by4 & 31) + 5];
  387|  3.88M|        n_cols = scan_col(mvstack, cnt, ref, gmv, b_left,
  388|  3.88M|                          bh4, h4, bx4 - 1, max_cols, bh4 >= 16 ? 4 : 1,
  ------------------
  |  Branch (388:55): [True: 685k, False: 3.19M]
  ------------------
  389|  3.88M|                          &have_newmv, &have_col_mvs);
  390|  3.88M|    }
  391|       |
  392|       |    // top/right
  393|  8.04M|    if (n_rows != ~0U && edge_flags & EDGE_I444_TOP_HAS_RIGHT &&
  ------------------
  |  Branch (393:9): [True: 7.41M, False: 632k]
  |  Branch (393:26): [True: 6.12M, False: 1.28M]
  ------------------
  394|  6.12M|        imax(bw4, bh4) <= 16 && bw4 + bx4 < rt->tile_col.end)
  ------------------
  |  Branch (394:9): [True: 3.01M, False: 3.11M]
  |  Branch (394:33): [True: 1.90M, False: 1.10M]
  ------------------
  395|  1.90M|    {
  396|  1.90M|        add_spatial_candidate(mvstack, cnt, 4, &b_top[bw4], ref, gmv,
  397|  1.90M|                              &have_newmv, &have_row_mvs);
  398|  1.90M|    }
  399|       |
  400|  8.04M|    const int nearest_match = have_col_mvs + have_row_mvs;
  401|  8.04M|    const int nearest_cnt = *cnt;
  402|  17.1M|    for (int n = 0; n < nearest_cnt; n++)
  ------------------
  |  Branch (402:21): [True: 9.08M, False: 8.04M]
  ------------------
  403|  9.08M|        mvstack[n].weight += 640;
  404|       |
  405|       |    // temporal
  406|  8.04M|    int globalmv_ctx = rf->frm_hdr->use_ref_frame_mvs;
  407|  8.04M|    if (rf->use_ref_frame_mvs) {
  ------------------
  |  Branch (407:9): [True: 432k, False: 7.61M]
  ------------------
  408|   432k|        const ptrdiff_t stride = rf->rp_stride;
  409|   432k|        const int by8 = by4 >> 1, bx8 = bx4 >> 1;
  410|   432k|        const refmvs_temporal_block *const rbi = &rt->rp_proj[(by8 & 15) * stride + bx8];
  411|   432k|        const refmvs_temporal_block *rb = rbi;
  412|   432k|        const int step_h = bw4 >= 16 ? 2 : 1, step_v = bh4 >= 16 ? 2 : 1;
  ------------------
  |  Branch (412:28): [True: 160k, False: 272k]
  |  Branch (412:56): [True: 162k, False: 270k]
  ------------------
  413|   432k|        const int w8 = imin((w4 + 1) >> 1, 8), h8 = imin((h4 + 1) >> 1, 8);
  414|       |        // save_tmvs() writes one record per 8x8 cell of a coded block, so the
  415|       |        // scan walks runs of bit-identical records. add_temporal_candidate()
  416|       |        // is a pure function of (rb->mv, rb->ref) plus loop invariants, and on
  417|       |        // a repeat its only effect is `weight += 2` on the same stack entry
  418|       |        // the first call of the run inserted or merged into -- the first match
  419|       |        // is stable because a repeat never inserts. So a run of `n` identical
  420|       |        // records is exactly one call carrying weight 2*n.
  421|       |        //
  422|       |        // Two records with mv.n == INVALID_MV belong to the same run whatever
  423|       |        // their .ref holds: add_temporal_candidate() returns before reading
  424|       |        // .ref, so both are no-ops. The check must be written that way round
  425|       |        // rather than merely being allowed to be, because load_tmvs() marks a
  426|       |        // cell unprojected by writing .mv.n alone and leaves .ref uninitialized.
  427|   432k|        const refmvs_temporal_block *run = &rb[0];
  428|   432k|        int run_len = 1;
  429|   432k|        int *run_gmv_ctx = &globalmv_ctx;
  430|  1.54M|        for (int y = 0; y < h8; y += step_v) {
  ------------------
  |  Branch (430:25): [True: 1.10M, False: 432k]
  ------------------
  431|  3.84M|            for (int x = y ? 0 : step_h; x < w8; x += step_h) {
  ------------------
  |  Branch (431:26): [True: 682k, False: 426k]
  |  Branch (431:42): [True: 2.73M, False: 1.10M]
  ------------------
  432|  2.73M|                const unsigned mvn = rb[x].mv.n;
  433|  2.73M|                if (mvn == run->mv.n &&
  ------------------
  |  Branch (433:21): [True: 2.60M, False: 133k]
  ------------------
  434|  2.60M|                    (mvn == INVALID_MV || rb[x].ref == run->ref))
  ------------------
  |  |   40|  5.20M|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (434:22): [True: 2.03M, False: 562k]
  |  Branch (434:43): [True: 559k, False: 3.33k]
  ------------------
  435|  2.59M|                {
  436|  2.59M|                    run_len++;
  437|  2.59M|                    continue;
  438|  2.59M|                }
  439|   137k|                add_temporal_candidate(rf, mvstack, cnt, run, ref,
  440|   137k|                                       run_gmv_ctx, tgmv, 2 * run_len);
  441|   137k|                run_gmv_ctx = NULL;
  442|   137k|                run = &rb[x];
  443|   137k|                run_len = 1;
  444|   137k|            }
  445|  1.10M|            rb += stride * step_v;
  446|  1.10M|        }
  447|   432k|        add_temporal_candidate(rf, mvstack, cnt, run, ref,
  448|   432k|                               run_gmv_ctx, tgmv, 2 * run_len);
  449|   432k|        if (imin(bw4, bh4) >= 2 && imax(bw4, bh4) < 16) {
  ------------------
  |  Branch (449:13): [True: 374k, False: 58.1k]
  |  Branch (449:36): [True: 209k, False: 165k]
  ------------------
  450|   209k|            const int bh8 = bh4 >> 1, bw8 = bw4 >> 1;
  451|   209k|            rb = &rbi[bh8 * stride];
  452|   209k|            const int has_bottom = by8 + bh8 < imin(rt->tile_row.end >> 1,
  453|   209k|                                                    (by8 & ~7) + 8);
  454|   209k|            if (has_bottom && bx8 - 1 >= imax(rt->tile_col.start >> 1, bx8 & ~7)) {
  ------------------
  |  Branch (454:17): [True: 156k, False: 53.0k]
  |  Branch (454:31): [True: 120k, False: 35.3k]
  ------------------
  455|   120k|                add_temporal_candidate(rf, mvstack, cnt, &rb[-1], ref,
  456|   120k|                                       NULL, NULL, 2);
  457|   120k|            }
  458|   209k|            if (bx8 + bw8 < imin(rt->tile_col.end >> 1, (bx8 & ~7) + 8)) {
  ------------------
  |  Branch (458:17): [True: 158k, False: 51.2k]
  ------------------
  459|   158k|                if (has_bottom) {
  ------------------
  |  Branch (459:21): [True: 119k, False: 38.9k]
  ------------------
  460|   119k|                    add_temporal_candidate(rf, mvstack, cnt, &rb[bw8], ref,
  461|   119k|                                           NULL, NULL, 2);
  462|   119k|                }
  463|   158k|                if (by8 + bh8 - 1 < imin(rt->tile_row.end >> 1, (by8 & ~7) + 8)) {
  ------------------
  |  Branch (463:21): [True: 157k, False: 652]
  ------------------
  464|   157k|                    add_temporal_candidate(rf, mvstack, cnt, &rb[bw8 - stride],
  465|   157k|                                           ref, NULL, NULL, 2);
  466|   157k|                }
  467|   158k|            }
  468|   209k|        }
  469|   432k|    }
  470|  8.04M|    assert(*cnt <= 8);
  ------------------
  |  Branch (470:5): [True: 8.07M, False: 18.4E]
  ------------------
  471|       |
  472|       |    // top/left (which, confusingly, is part of "secondary" references)
  473|  8.07M|    int have_dummy_newmv_match;
  474|  8.07M|    if ((n_rows | n_cols) != ~0U) {
  ------------------
  |  Branch (474:9): [True: 3.25M, False: 4.81M]
  ------------------
  475|  3.25M|        add_spatial_candidate(mvstack, cnt, 4, &b_top[-1], ref, gmv,
  476|  3.25M|                              &have_dummy_newmv_match, &have_row_mvs);
  477|  3.25M|    }
  478|       |
  479|       |    // "secondary" (non-direct neighbour) top & left edges
  480|       |    // what is different about secondary is that everything is now in 8x8 resolution
  481|  24.2M|    for (int n = 2; n <= 3; n++) {
  ------------------
  |  Branch (481:21): [True: 16.1M, False: 8.07M]
  ------------------
  482|  16.1M|        if ((unsigned) n > n_rows && (unsigned) n <= max_rows) {
  ------------------
  |  Branch (482:13): [True: 4.56M, False: 11.5M]
  |  Branch (482:38): [True: 3.36M, False: 1.19M]
  ------------------
  483|  3.36M|            n_rows += scan_row(mvstack, cnt, ref, gmv,
  484|  3.36M|                               &rt->r[(((by4 & 31) - 2 * n + 1) | 1) + 5][bx4 | 1],
  485|  3.36M|                               bw4, w4, 1 + max_rows - n, bw4 >= 16 ? 4 : 2,
  ------------------
  |  Branch (485:59): [True: 35.1k, False: 3.33M]
  ------------------
  486|  3.36M|                               &have_dummy_newmv_match, &have_row_mvs);
  487|  3.36M|        }
  488|       |
  489|  16.1M|        if ((unsigned) n > n_cols && (unsigned) n <= max_cols) {
  ------------------
  |  Branch (489:13): [True: 5.14M, False: 10.9M]
  |  Branch (489:38): [True: 4.17M, False: 969k]
  ------------------
  490|  4.17M|            n_cols += scan_col(mvstack, cnt, ref, gmv, &rt->r[((by4 & 31) | 1) + 5],
  491|  4.17M|                               bh4, h4, (bx4 - n * 2 + 1) | 1,
  492|  4.17M|                               1 + max_cols - n, bh4 >= 16 ? 4 : 2,
  ------------------
  |  Branch (492:50): [True: 359k, False: 3.81M]
  ------------------
  493|  4.17M|                               &have_dummy_newmv_match, &have_col_mvs);
  494|  4.17M|        }
  495|  16.1M|    }
  496|  8.07M|    assert(*cnt <= 8);
  ------------------
  |  Branch (496:5): [True: 8.10M, False: 18.4E]
  ------------------
  497|       |
  498|  8.10M|    const int ref_match_count = have_col_mvs + have_row_mvs;
  499|       |
  500|       |    // context build-up
  501|  8.10M|    int refmv_ctx, newmv_ctx;
  502|  8.10M|    switch (nearest_match) {
  ------------------
  |  Branch (502:13): [True: 8.13M, False: 18.4E]
  ------------------
  503|   751k|    case 0:
  ------------------
  |  Branch (503:5): [True: 751k, False: 7.35M]
  ------------------
  504|   751k|        refmv_ctx = imin(2, ref_match_count);
  505|   751k|        newmv_ctx = ref_match_count > 0;
  506|   751k|        break;
  507|  5.28M|    case 1:
  ------------------
  |  Branch (507:5): [True: 5.28M, False: 2.82M]
  ------------------
  508|  5.28M|        refmv_ctx = imin(ref_match_count * 3, 4);
  509|  5.28M|        newmv_ctx = 3 - have_newmv;
  510|  5.28M|        break;
  511|  2.09M|    case 2:
  ------------------
  |  Branch (511:5): [True: 2.09M, False: 6.00M]
  ------------------
  512|  2.09M|        refmv_ctx = 5;
  513|  2.09M|        newmv_ctx = 5 - have_newmv;
  514|  2.09M|        break;
  515|  8.10M|    }
  516|       |
  517|       |    // sorting (nearest, then "secondary")
  518|  8.09M|    int len = nearest_cnt;
  519|  16.1M|    while (len) {
  ------------------
  |  Branch (519:12): [True: 8.01M, False: 8.09M]
  ------------------
  520|  8.01M|        int last = 0;
  521|  10.0M|        for (int n = 1; n < len; n++) {
  ------------------
  |  Branch (521:25): [True: 2.04M, False: 8.01M]
  ------------------
  522|  2.04M|            if (mvstack[n - 1].weight < mvstack[n].weight) {
  ------------------
  |  Branch (522:17): [True: 852k, False: 1.19M]
  ------------------
  523|   852k|#define EXCHANGE(a, b) do { refmvs_candidate tmp = a; a = b; b = tmp; } while (0)
  524|   852k|                EXCHANGE(mvstack[n - 1], mvstack[n]);
  ------------------
  |  |  523|   852k|#define EXCHANGE(a, b) do { refmvs_candidate tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (523:80): [Folded, False: 852k]
  |  |  ------------------
  ------------------
  525|   852k|                last = n;
  526|   852k|            }
  527|  2.04M|        }
  528|  8.01M|        len = last;
  529|  8.01M|    }
  530|  8.09M|    len = *cnt;
  531|  10.2M|    while (len > nearest_cnt) {
  ------------------
  |  Branch (531:12): [True: 2.17M, False: 8.09M]
  ------------------
  532|  2.17M|        int last = nearest_cnt;
  533|  4.01M|        for (int n = nearest_cnt + 1; n < len; n++) {
  ------------------
  |  Branch (533:39): [True: 1.84M, False: 2.17M]
  ------------------
  534|  1.84M|            if (mvstack[n - 1].weight < mvstack[n].weight) {
  ------------------
  |  Branch (534:17): [True: 615k, False: 1.22M]
  ------------------
  535|   615k|                EXCHANGE(mvstack[n - 1], mvstack[n]);
  ------------------
  |  |  523|   615k|#define EXCHANGE(a, b) do { refmvs_candidate tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (523:80): [Folded, False: 615k]
  |  |  ------------------
  ------------------
  536|   615k|#undef EXCHANGE
  537|   615k|                last = n;
  538|   615k|            }
  539|  1.84M|        }
  540|  2.17M|        len = last;
  541|  2.17M|    }
  542|       |
  543|  8.09M|    if (ref.ref[1] > 0) {
  ------------------
  |  Branch (543:9): [True: 337k, False: 7.75M]
  ------------------
  544|   337k|        if (*cnt < 2) {
  ------------------
  |  Branch (544:13): [True: 231k, False: 106k]
  ------------------
  545|   231k|            const int sign0 = rf->sign_bias[ref.ref[0] - 1];
  546|   231k|            const int sign1 = rf->sign_bias[ref.ref[1] - 1];
  547|   231k|            const int sz4 = imin(w4, h4);
  548|   231k|            refmvs_candidate *const same = &mvstack[*cnt];
  549|   231k|            int same_count[4] = { 0 };
  550|       |
  551|       |            // non-self references in top
  552|   366k|            if (n_rows != ~0U) for (int x = 0; x < sz4;) {
  ------------------
  |  Branch (552:17): [True: 177k, False: 53.8k]
  |  Branch (552:48): [True: 189k, False: 177k]
  ------------------
  553|   189k|                const refmvs_block *const cand_b = &b_top[x];
  554|   189k|                add_compound_extended_candidate(same, same_count, cand_b,
  555|   189k|                                                sign0, sign1, ref, rf->sign_bias);
  556|   189k|                x += dav1d_block_dimensions[cand_b->bs][0];
  557|   189k|            }
  558|       |
  559|       |            // non-self references in left
  560|   481k|            if (n_cols != ~0U) for (int y = 0; y < sz4;) {
  ------------------
  |  Branch (560:17): [True: 219k, False: 11.3k]
  |  Branch (560:48): [True: 261k, False: 219k]
  ------------------
  561|   261k|                const refmvs_block *const cand_b = &b_left[y][bx4 - 1];
  562|   261k|                add_compound_extended_candidate(same, same_count, cand_b,
  563|   261k|                                                sign0, sign1, ref, rf->sign_bias);
  564|   261k|                y += dav1d_block_dimensions[cand_b->bs][1];
  565|   261k|            }
  566|       |
  567|   231k|            refmvs_candidate *const diff = &same[2];
  568|   231k|            const int *const diff_count = &same_count[2];
  569|       |
  570|       |            // merge together
  571|   692k|            for (int n = 0; n < 2; n++) {
  ------------------
  |  Branch (571:29): [True: 461k, False: 231k]
  ------------------
  572|   461k|                int m = same_count[n];
  573|       |
  574|   461k|                if (m >= 2) continue;
  ------------------
  |  Branch (574:21): [True: 139k, False: 322k]
  ------------------
  575|       |
  576|   322k|                const int l = diff_count[n];
  577|   322k|                if (l) {
  ------------------
  |  Branch (577:21): [True: 303k, False: 18.9k]
  ------------------
  578|   303k|                    same[m].mv.mv[n] = diff[0].mv.mv[n];
  579|   303k|                    if (++m == 2) continue;
  ------------------
  |  Branch (579:25): [True: 205k, False: 98.0k]
  ------------------
  580|  98.0k|                    if (l == 2) {
  ------------------
  |  Branch (580:25): [True: 84.6k, False: 13.4k]
  ------------------
  581|  84.6k|                        same[1].mv.mv[n] = diff[1].mv.mv[n];
  582|  84.6k|                        continue;
  583|  84.6k|                    }
  584|  98.0k|                }
  585|  43.1k|                do {
  586|  43.1k|                    same[m].mv.mv[n] = tgmv[n];
  587|  43.1k|                } while (++m < 2);
  ------------------
  |  Branch (587:26): [True: 10.6k, False: 32.4k]
  ------------------
  588|  32.4k|            }
  589|       |
  590|       |            // if the first extended was the same as the non-extended one,
  591|       |            // then replace it with the second extended one
  592|   231k|            int n = *cnt;
  593|   231k|            if (n == 1 && mvstack[0].mv.n == same[0].mv.n)
  ------------------
  |  Branch (593:17): [True: 131k, False: 99.5k]
  |  Branch (593:27): [True: 87.3k, False: 44.2k]
  ------------------
  594|  87.2k|                mvstack[1].mv = mvstack[2].mv;
  595|   332k|            do {
  596|   332k|                mvstack[n].weight = 2;
  597|   332k|            } while (++n < 2);
  ------------------
  |  Branch (597:22): [True: 101k, False: 231k]
  ------------------
  598|   231k|            *cnt = 2;
  599|   231k|        }
  600|       |
  601|       |        // clamping
  602|   337k|        const int left = -(bx4 + bw4 + 4) * 4 * 8;
  603|   337k|        const int right = (rf->iw4 - bx4 + 4) * 4 * 8;
  604|   337k|        const int top = -(by4 + bh4 + 4) * 4 * 8;
  605|   337k|        const int bottom = (rf->ih4 - by4 + 4) * 4 * 8;
  606|       |
  607|   337k|        const int n_refmvs = *cnt;
  608|   337k|        int n = 0;
  609|   766k|        do {
  610|   766k|            mvstack[n].mv.mv[0].x = iclip(mvstack[n].mv.mv[0].x, left, right);
  611|   766k|            mvstack[n].mv.mv[0].y = iclip(mvstack[n].mv.mv[0].y, top, bottom);
  612|   766k|            mvstack[n].mv.mv[1].x = iclip(mvstack[n].mv.mv[1].x, left, right);
  613|   766k|            mvstack[n].mv.mv[1].y = iclip(mvstack[n].mv.mv[1].y, top, bottom);
  614|   766k|        } while (++n < n_refmvs);
  ------------------
  |  Branch (614:18): [True: 428k, False: 337k]
  ------------------
  615|       |
  616|   337k|        switch (refmv_ctx >> 1) {
  ------------------
  |  Branch (616:17): [True: 342k, False: 18.4E]
  ------------------
  617|   123k|        case 0:
  ------------------
  |  Branch (617:9): [True: 123k, False: 214k]
  ------------------
  618|   123k|            *ctx = imin(newmv_ctx, 1);
  619|   123k|            break;
  620|   130k|        case 1:
  ------------------
  |  Branch (620:9): [True: 130k, False: 207k]
  ------------------
  621|   130k|            *ctx = 1 + imin(newmv_ctx, 3);
  622|   130k|            break;
  623|  88.4k|        case 2:
  ------------------
  |  Branch (623:9): [True: 88.4k, False: 249k]
  ------------------
  624|  88.4k|            *ctx = iclip(3 + newmv_ctx, 4, 7);
  625|  88.4k|            break;
  626|   337k|        }
  627|       |
  628|   338k|        return;
  629|  7.75M|    } else if (*cnt < 2 && ref.ref[0] > 0) {
  ------------------
  |  Branch (629:16): [True: 5.89M, False: 1.85M]
  |  Branch (629:28): [True: 5.22M, False: 677k]
  ------------------
  630|  5.22M|        const int sign = rf->sign_bias[ref.ref[0] - 1];
  631|  5.22M|        const int sz4 = imin(w4, h4);
  632|       |
  633|       |        // non-self references in top
  634|  10.2M|        if (n_rows != ~0U) for (int x = 0; x < sz4 && *cnt < 2;) {
  ------------------
  |  Branch (634:13): [True: 5.07M, False: 145k]
  |  Branch (634:44): [True: 5.14M, False: 5.07M]
  |  Branch (634:55): [True: 5.13M, False: 5.87k]
  ------------------
  635|  5.13M|            const refmvs_block *const cand_b = &b_top[x];
  636|  5.13M|            add_single_extended_candidate(mvstack, cnt, cand_b, sign, rf->sign_bias);
  637|  5.13M|            x += dav1d_block_dimensions[cand_b->bs][0];
  638|  5.13M|        }
  639|       |
  640|       |        // non-self references in left
  641|  5.22M|        if (n_cols != ~0U) for (int y = 0; y < sz4 && *cnt < 2;) {
  ------------------
  |  Branch (641:13): [True: 1.08M, False: 4.14M]
  |  Branch (641:44): [True: 1.15M, False: 942k]
  |  Branch (641:55): [True: 1.01M, False: 138k]
  ------------------
  642|  1.01M|            const refmvs_block *const cand_b = &b_left[y][bx4 - 1];
  643|  1.01M|            add_single_extended_candidate(mvstack, cnt, cand_b, sign, rf->sign_bias);
  644|  1.01M|            y += dav1d_block_dimensions[cand_b->bs][1];
  645|  1.01M|        }
  646|  5.22M|    }
  647|  8.09M|    assert(*cnt <= 8);
  ------------------
  |  Branch (647:5): [True: 7.76M, False: 18.4E]
  ------------------
  648|       |
  649|       |    // clamping
  650|  7.76M|    int n_refmvs = *cnt;
  651|  7.76M|    if (n_refmvs) {
  ------------------
  |  Branch (651:9): [True: 7.33M, False: 423k]
  ------------------
  652|  7.33M|        const int left = -(bx4 + bw4 + 4) * 4 * 8;
  653|  7.33M|        const int right = (rf->iw4 - bx4 + 4) * 4 * 8;
  654|  7.33M|        const int top = -(by4 + bh4 + 4) * 4 * 8;
  655|  7.33M|        const int bottom = (rf->ih4 - by4 + 4) * 4 * 8;
  656|       |
  657|  7.33M|        int n = 0;
  658|  12.2M|        do {
  659|  12.2M|            mvstack[n].mv.mv[0].x = iclip(mvstack[n].mv.mv[0].x, left, right);
  660|  12.2M|            mvstack[n].mv.mv[0].y = iclip(mvstack[n].mv.mv[0].y, top, bottom);
  661|  12.2M|        } while (++n < n_refmvs);
  ------------------
  |  Branch (661:18): [True: 4.95M, False: 7.33M]
  ------------------
  662|  7.33M|    }
  663|       |
  664|  13.7M|    for (int n = *cnt; n < 2; n++)
  ------------------
  |  Branch (664:24): [True: 5.94M, False: 7.76M]
  ------------------
  665|  5.94M|        mvstack[n].mv.mv[0] = tgmv[0];
  666|       |
  667|  7.76M|    *ctx = (refmv_ctx << 4) | (globalmv_ctx << 3) | newmv_ctx;
  668|  7.76M|}
dav1d_refmvs_tile_sbrow_init:
  674|  8.87M|{
  675|  8.87M|    if (rf->n_tile_threads == 1) tile_row_idx = 0;
  ------------------
  |  Branch (675:9): [True: 0, False: 8.87M]
  ------------------
  676|  8.87M|    rt->rp_proj = &rf->rp_proj[16 * rf->rp_stride * tile_row_idx];
  677|  8.87M|    const ptrdiff_t r_stride = rf->rp_stride * 2;
  678|  8.87M|    const ptrdiff_t pass_off = (rf->n_frame_threads > 1 && pass == 2) ?
  ------------------
  |  Branch (678:33): [True: 8.86M, False: 9.54k]
  |  Branch (678:60): [True: 4.39M, False: 4.46M]
  ------------------
  679|  4.47M|        35 * 2 * rf->n_blocks : 0;
  680|  8.87M|    refmvs_block *r = &rf->r[35 * r_stride * tile_row_idx + pass_off];
  681|  8.87M|    const int sbsz = rf->sbsz;
  682|  8.87M|    const int off = (sbsz * sby) & 16;
  683|   254M|    for (int i = 0; i < sbsz; i++, r += r_stride)
  ------------------
  |  Branch (683:21): [True: 245M, False: 8.87M]
  ------------------
  684|   245M|        rt->r[off + 5 + i] = r;
  685|  8.87M|    rt->r[off + 0] = r;
  686|  8.87M|    r += r_stride;
  687|  8.87M|    rt->r[off + 1] = NULL;
  688|  8.87M|    rt->r[off + 2] = r;
  689|  8.87M|    r += r_stride;
  690|  8.87M|    rt->r[off + 3] = NULL;
  691|  8.87M|    rt->r[off + 4] = r;
  692|  8.87M|    if (sby & 1) {
  ------------------
  |  Branch (692:9): [True: 4.40M, False: 4.46M]
  ------------------
  693|  4.40M|#define EXCHANGE(a, b) do { void *const tmp = a; a = b; b = tmp; } while (0)
  694|  4.40M|        EXCHANGE(rt->r[off + 0], rt->r[off + sbsz + 0]);
  ------------------
  |  |  693|  4.40M|#define EXCHANGE(a, b) do { void *const tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (693:75): [Folded, False: 4.40M]
  |  |  ------------------
  ------------------
  695|  4.40M|        EXCHANGE(rt->r[off + 2], rt->r[off + sbsz + 2]);
  ------------------
  |  |  693|  4.40M|#define EXCHANGE(a, b) do { void *const tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (693:75): [Folded, False: 4.40M]
  |  |  ------------------
  ------------------
  696|  4.40M|        EXCHANGE(rt->r[off + 4], rt->r[off + sbsz + 4]);
  ------------------
  |  |  693|  4.40M|#define EXCHANGE(a, b) do { void *const tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (693:75): [Folded, False: 4.40M]
  |  |  ------------------
  ------------------
  697|  4.40M|#undef EXCHANGE
  698|  4.40M|    }
  699|       |
  700|  8.87M|    rt->rf = rf;
  701|  8.87M|    rt->tile_row.start = tile_row_start4;
  702|  8.87M|    rt->tile_row.end = imin(tile_row_end4, rf->ih4);
  703|  8.87M|    rt->tile_col.start = tile_col_start4;
  704|  8.87M|    rt->tile_col.end = imin(tile_col_end4, rf->iw4);
  705|  8.87M|}
dav1d_refmvs_init_frame:
  828|   180k|{
  829|   180k|    const int rp_stride = ((frm_hdr->width[0] + 127) & ~127) >> 3;
  830|   180k|    const int n_tile_rows = n_tile_threads > 1 ? frm_hdr->tiling.rows : 1;
  ------------------
  |  Branch (830:29): [True: 180k, False: 8]
  ------------------
  831|   180k|    const int n_blocks = rp_stride * n_tile_rows;
  832|       |
  833|   180k|    rf->sbsz = 16 << seq_hdr->sb128;
  834|   180k|    rf->frm_hdr = frm_hdr;
  835|   180k|    rf->iw8 = (frm_hdr->width[0] + 7) >> 3;
  836|   180k|    rf->ih8 = (frm_hdr->height + 7) >> 3;
  837|   180k|    rf->iw4 = rf->iw8 << 1;
  838|   180k|    rf->ih4 = rf->ih8 << 1;
  839|   180k|    rf->rp = rp;
  840|   180k|    rf->rp_stride = rp_stride;
  841|   180k|    rf->n_tile_threads = n_tile_threads;
  842|   180k|    rf->n_frame_threads = n_frame_threads;
  843|       |
  844|   180k|    if (n_blocks != rf->n_blocks) {
  ------------------
  |  Branch (844:9): [True: 28.3k, False: 152k]
  ------------------
  845|  28.3k|        const size_t r_sz = sizeof(*rf->r) * 35 * 2 * n_blocks * (1 + (n_frame_threads > 1));
  846|  28.3k|        const size_t rp_proj_sz = sizeof(*rf->rp_proj) * 16 * n_blocks;
  847|       |        /* Note that sizeof(*rf->r) == 12, but it's accessed using 16-byte unaligned
  848|       |         * loads in save_tmvs() asm which can overread 4 bytes into rp_proj. */
  849|  28.3k|        dav1d_free_aligned(rf->r);
  ------------------
  |  |  136|  28.3k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  850|  28.3k|        rf->r = dav1d_alloc_aligned(ALLOC_REFMVS, r_sz + rp_proj_sz, 64);
  ------------------
  |  |  134|  28.3k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
  851|  28.3k|        if (!rf->r) {
  ------------------
  |  Branch (851:13): [True: 0, False: 28.3k]
  ------------------
  852|      0|            rf->n_blocks = 0;
  853|      0|            return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  854|      0|        }
  855|       |
  856|  28.3k|        rf->rp_proj = (refmvs_temporal_block*)((uintptr_t)rf->r + r_sz);
  857|  28.3k|        rf->n_blocks = n_blocks;
  858|  28.3k|    }
  859|       |
  860|   180k|    const int poc = frm_hdr->frame_offset;
  861|  1.44M|    for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (861:21): [True: 1.26M, False: 180k]
  ------------------
  862|  1.26M|        const int poc_diff = get_poc_diff(seq_hdr->order_hint_n_bits,
  863|  1.26M|                                          ref_poc[i], poc);
  864|  1.26M|        rf->sign_bias[i] = poc_diff > 0;
  865|  1.26M|        rf->mfmv_sign[i] = poc_diff < 0;
  866|  1.26M|        rf->pocdiff[i] = iclip(get_poc_diff(seq_hdr->order_hint_n_bits,
  867|  1.26M|                                            poc, ref_poc[i]), -31, 31);
  868|  1.26M|    }
  869|       |
  870|       |    // temporal MV setup
  871|   180k|    rf->n_mfmvs = 0;
  872|   180k|    rf->rp_ref = rp_ref;
  873|   180k|    if (frm_hdr->use_ref_frame_mvs && seq_hdr->order_hint_n_bits) {
  ------------------
  |  Branch (873:9): [True: 54.2k, False: 126k]
  |  Branch (873:39): [True: 54.2k, False: 18.4E]
  ------------------
  874|  54.2k|        int total = 2;
  875|  54.2k|        if (rp_ref[0] && ref_ref_poc[0][6] != ref_poc[3] /* alt-of-last != gold */) {
  ------------------
  |  Branch (875:13): [True: 42.5k, False: 11.7k]
  |  Branch (875:26): [True: 27.0k, False: 15.4k]
  ------------------
  876|  27.0k|            rf->mfmv_ref[rf->n_mfmvs++] = 0; // last
  877|  27.0k|            total = 3;
  878|  27.0k|        }
  879|  54.2k|        if (rp_ref[4] && get_poc_diff(seq_hdr->order_hint_n_bits, ref_poc[4],
  ------------------
  |  Branch (879:13): [True: 43.3k, False: 10.8k]
  |  Branch (879:26): [True: 18.5k, False: 24.8k]
  ------------------
  880|  43.3k|                                      frm_hdr->frame_offset) > 0)
  881|  18.5k|        {
  882|  18.5k|            rf->mfmv_ref[rf->n_mfmvs++] = 4; // bwd
  883|  18.5k|        }
  884|  54.2k|        if (rp_ref[5] && get_poc_diff(seq_hdr->order_hint_n_bits, ref_poc[5],
  ------------------
  |  Branch (884:13): [True: 39.8k, False: 14.3k]
  |  Branch (884:26): [True: 15.7k, False: 24.1k]
  ------------------
  885|  39.8k|                                      frm_hdr->frame_offset) > 0)
  886|  15.7k|        {
  887|  15.7k|            rf->mfmv_ref[rf->n_mfmvs++] = 5; // altref2
  888|  15.7k|        }
  889|  54.2k|        if (rf->n_mfmvs < total && rp_ref[6] &&
  ------------------
  |  Branch (889:13): [True: 40.3k, False: 13.9k]
  |  Branch (889:36): [True: 24.2k, False: 16.0k]
  ------------------
  890|  24.2k|            get_poc_diff(seq_hdr->order_hint_n_bits, ref_poc[6],
  ------------------
  |  Branch (890:13): [True: 7.46k, False: 16.7k]
  ------------------
  891|  24.2k|                         frm_hdr->frame_offset) > 0)
  892|  7.46k|        {
  893|  7.46k|            rf->mfmv_ref[rf->n_mfmvs++] = 6; // altref
  894|  7.46k|        }
  895|  54.2k|        if (rf->n_mfmvs < total && rp_ref[1])
  ------------------
  |  Branch (895:13): [True: 35.1k, False: 19.1k]
  |  Branch (895:36): [True: 24.2k, False: 10.9k]
  ------------------
  896|  24.2k|            rf->mfmv_ref[rf->n_mfmvs++] = 1; // last2
  897|       |
  898|   147k|        for (int n = 0; n < rf->n_mfmvs; n++) {
  ------------------
  |  Branch (898:25): [True: 92.7k, False: 54.2k]
  ------------------
  899|  92.7k|            const int rpoc = ref_poc[rf->mfmv_ref[n]];
  900|  92.7k|            const int diff1 = get_poc_diff(seq_hdr->order_hint_n_bits,
  901|  92.7k|                                           rpoc, frm_hdr->frame_offset);
  902|  92.7k|            if (abs(diff1) > 31) {
  ------------------
  |  Branch (902:17): [True: 392, False: 92.3k]
  ------------------
  903|    392|                rf->mfmv_ref2cur[n] = INVALID_REF2CUR;
  ------------------
  |  |   41|    392|#define INVALID_REF2CUR (-32)
  ------------------
  904|  92.3k|            } else {
  905|  92.3k|                rf->mfmv_ref2cur[n] = rf->mfmv_ref[n] < 4 ? -diff1 : diff1;
  ------------------
  |  Branch (905:39): [True: 51.1k, False: 41.2k]
  ------------------
  906|   739k|                for (int m = 0; m < 7; m++) {
  ------------------
  |  Branch (906:33): [True: 646k, False: 92.3k]
  ------------------
  907|   646k|                    const int rrpoc = ref_ref_poc[rf->mfmv_ref[n]][m];
  908|   646k|                    const int diff2 = get_poc_diff(seq_hdr->order_hint_n_bits,
  909|   646k|                                                   rpoc, rrpoc);
  910|       |                    // unsigned comparison also catches the < 0 case
  911|   646k|                    rf->mfmv_ref2ref[n][m] = (unsigned) diff2 > 31U ? 0 : diff2;
  ------------------
  |  Branch (911:46): [True: 171k, False: 475k]
  ------------------
  912|   646k|                }
  913|  92.3k|            }
  914|  92.7k|        }
  915|  54.2k|    }
  916|   180k|    rf->use_ref_frame_mvs = rf->n_mfmvs > 0;
  917|       |
  918|   180k|    return 0;
  919|   180k|}
dav1d_refmvs_dsp_init:
  942|  15.1k|{
  943|  15.1k|    c->load_tmvs = load_tmvs_c;
  944|  15.1k|    c->save_tmvs = save_tmvs_c;
  945|  15.1k|    c->splat_mv = splat_mv_c;
  946|       |
  947|  15.1k|#if HAVE_ASM
  948|       |#if ARCH_AARCH64 || ARCH_ARM
  949|       |    refmvs_dsp_init_arm(c);
  950|       |#elif ARCH_LOONGARCH64
  951|       |    refmvs_dsp_init_loongarch(c);
  952|       |#elif ARCH_X86
  953|       |    refmvs_dsp_init_x86(c);
  954|  15.1k|#endif
  955|  15.1k|#endif
  956|  15.1k|}
refmvs.c:scan_row:
  103|  10.7M|{
  104|  10.7M|    const refmvs_block *cand_b = b;
  105|  10.7M|    const enum BlockSize first_cand_bs = cand_b->bs;
  106|  10.7M|    const uint8_t *const first_cand_b_dim = dav1d_block_dimensions[first_cand_bs];
  107|  10.7M|    int cand_bw4 = first_cand_b_dim[0];
  108|  10.7M|    int len = imax(step, imin(bw4, cand_bw4));
  109|       |
  110|  10.7M|    if (bw4 <= cand_bw4) {
  ------------------
  |  Branch (110:9): [True: 9.87M, False: 857k]
  ------------------
  111|       |        // FIXME weight can be higher for odd blocks (bx4 & 1), but then the
  112|       |        // position of the first block has to be odd already, i.e. not just
  113|       |        // for row_offset=-3/-5
  114|       |        // FIXME why can this not be cand_bw4?
  115|  9.87M|        const int weight = bw4 == 1 ? 2 :
  ------------------
  |  Branch (115:28): [True: 1.83M, False: 8.04M]
  ------------------
  116|  9.87M|                           imax(2, imin(2 * max_rows, first_cand_b_dim[1]));
  117|  9.87M|        add_spatial_candidate(mvstack, cnt, len * weight, cand_b, ref, gmv,
  118|  9.87M|                              have_newmv_match, have_refmv_match);
  119|  9.87M|        return weight >> 1;
  120|  9.87M|    }
  121|       |
  122|  1.76M|    for (int x = 0;;) {
  123|       |        // FIXME if we overhang above, we could fill a bitmask so we don't have
  124|       |        // to repeat the add_spatial_candidate() for the next row, but just increase
  125|       |        // the weight here
  126|  1.76M|        add_spatial_candidate(mvstack, cnt, len * 2, cand_b, ref, gmv,
  127|  1.76M|                              have_newmv_match, have_refmv_match);
  128|  1.76M|        x += len;
  129|  1.76M|        if (x >= w4) return 1;
  ------------------
  |  Branch (129:13): [True: 876k, False: 891k]
  ------------------
  130|   891k|        cand_b = &b[x];
  131|   891k|        cand_bw4 = dav1d_block_dimensions[cand_b->bs][0];
  132|   891k|        assert(cand_bw4 < bw4);
  ------------------
  |  Branch (132:9): [True: 893k, False: 18.4E]
  ------------------
  133|   893k|        len = imax(step, cand_bw4);
  134|   893k|    }
  135|   857k|}
refmvs.c:scan_col:
  142|  8.00M|{
  143|  8.00M|    const refmvs_block *cand_b = &b[0][bx4];
  144|  8.00M|    const enum BlockSize first_cand_bs = cand_b->bs;
  145|  8.00M|    const uint8_t *const first_cand_b_dim = dav1d_block_dimensions[first_cand_bs];
  146|  8.00M|    int cand_bh4 = first_cand_b_dim[1];
  147|  8.00M|    int len = imax(step, imin(bh4, cand_bh4));
  148|       |
  149|  8.00M|    if (bh4 <= cand_bh4) {
  ------------------
  |  Branch (149:9): [True: 6.64M, False: 1.35M]
  ------------------
  150|       |        // FIXME weight can be higher for odd blocks (by4 & 1), but then the
  151|       |        // position of the first block has to be odd already, i.e. not just
  152|       |        // for col_offset=-3/-5
  153|       |        // FIXME why can this not be cand_bh4?
  154|  6.64M|        const int weight = bh4 == 1 ? 2 :
  ------------------
  |  Branch (154:28): [True: 2.16M, False: 4.48M]
  ------------------
  155|  6.64M|                           imax(2, imin(2 * max_cols, first_cand_b_dim[0]));
  156|  6.64M|        add_spatial_candidate(mvstack, cnt, len * weight, cand_b, ref, gmv,
  157|  6.64M|                            have_newmv_match, have_refmv_match);
  158|  6.64M|        return weight >> 1;
  159|  6.64M|    }
  160|       |
  161|  2.57M|    for (int y = 0;;) {
  162|       |        // FIXME if we overhang above, we could fill a bitmask so we don't have
  163|       |        // to repeat the add_spatial_candidate() for the next row, but just increase
  164|       |        // the weight here
  165|  2.57M|        add_spatial_candidate(mvstack, cnt, len * 2, cand_b, ref, gmv,
  166|  2.57M|                              have_newmv_match, have_refmv_match);
  167|  2.57M|        y += len;
  168|  2.57M|        if (y >= h4) return 1;
  ------------------
  |  Branch (168:13): [True: 1.38M, False: 1.19M]
  ------------------
  169|  1.19M|        cand_b = &b[y][bx4];
  170|  1.19M|        cand_bh4 = dav1d_block_dimensions[cand_b->bs][1];
  171|  1.19M|        assert(cand_bh4 < bh4);
  ------------------
  |  Branch (171:9): [True: 1.19M, False: 18.4E]
  ------------------
  172|  1.19M|        len = imax(step, cand_bh4);
  173|  1.19M|    }
  174|  1.35M|}
refmvs.c:add_spatial_candidate:
   47|  25.5M|{
   48|  25.5M|    if (b->mv.mv[0].n == INVALID_MV) return; // intra block, no intrabc
  ------------------
  |  |   40|  25.5M|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (48:9): [True: 4.13M, False: 21.4M]
  ------------------
   49|       |
   50|  21.4M|    if (ref.ref[1] == -1) {
  ------------------
  |  Branch (50:9): [True: 19.8M, False: 1.53M]
  ------------------
   51|  23.7M|        for (int n = 0; n < 2; n++) {
  ------------------
  |  Branch (51:25): [True: 21.9M, False: 1.78M]
  ------------------
   52|  21.9M|            if (b->ref.ref[n] == ref.ref[0]) {
  ------------------
  |  Branch (52:17): [True: 18.0M, False: 3.81M]
  ------------------
   53|  18.0M|                const mv cand_mv = ((b->mf & 1) && gmv[0].n != INVALID_MV) ?
  ------------------
  |  |   40|  7.05M|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (53:37): [True: 7.05M, False: 11.0M]
  |  Branch (53:52): [True: 1.63M, False: 5.42M]
  ------------------
   54|  16.4M|                                   gmv[0] : b->mv.mv[n];
   55|       |
   56|  18.0M|                *have_refmv_match = 1;
   57|  18.0M|                *have_newmv_match |= b->mf >> 1;
   58|       |
   59|  18.0M|                const int last = *cnt;
   60|  28.9M|                for (int m = 0; m < last; m++)
  ------------------
  |  Branch (60:33): [True: 17.7M, False: 11.2M]
  ------------------
   61|  17.7M|                    if (mvstack[m].mv.mv[0].n == cand_mv.n) {
  ------------------
  |  Branch (61:25): [True: 6.87M, False: 10.8M]
  ------------------
   62|  6.87M|                        mvstack[m].weight += weight;
   63|  6.87M|                        return;
   64|  6.87M|                    }
   65|       |
   66|  11.3M|                if (last < 8) {
  ------------------
  |  Branch (66:21): [True: 11.3M, False: 18.4E]
  ------------------
   67|  11.3M|                    mvstack[last].mv.mv[0] = cand_mv;
   68|  11.3M|                    mvstack[last].weight = weight;
   69|  11.3M|                    *cnt = last + 1;
   70|  11.3M|                }
   71|  11.2M|                return;
   72|  18.0M|            }
   73|  21.9M|        }
   74|  19.8M|    } else if (b->ref.pair == ref.pair) {
  ------------------
  |  Branch (74:16): [True: 611k, False: 925k]
  ------------------
   75|   611k|        const refmvs_mvpair cand_mv = { .mv = {
   76|   611k|            [0] = ((b->mf & 1) && gmv[0].n != INVALID_MV) ? gmv[0] : b->mv.mv[0],
  ------------------
  |  |   40|  47.2k|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (76:20): [True: 47.2k, False: 564k]
  |  Branch (76:35): [True: 31.0k, False: 16.2k]
  ------------------
   77|   611k|            [1] = ((b->mf & 1) && gmv[1].n != INVALID_MV) ? gmv[1] : b->mv.mv[1],
  ------------------
  |  |   40|  47.2k|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (77:20): [True: 47.2k, False: 564k]
  |  Branch (77:35): [True: 10.6k, False: 36.5k]
  ------------------
   78|   611k|        }};
   79|       |
   80|   611k|        *have_refmv_match = 1;
   81|   611k|        *have_newmv_match |= b->mf >> 1;
   82|       |
   83|   611k|        const int last = *cnt;
   84|   923k|        for (int n = 0; n < last; n++)
  ------------------
  |  Branch (84:25): [True: 551k, False: 371k]
  ------------------
   85|   551k|            if (mvstack[n].mv.n == cand_mv.n) {
  ------------------
  |  Branch (85:17): [True: 240k, False: 311k]
  ------------------
   86|   240k|                mvstack[n].weight += weight;
   87|   240k|                return;
   88|   240k|            }
   89|       |
   90|   373k|        if (last < 8) {
  ------------------
  |  Branch (90:13): [True: 373k, False: 18.4E]
  ------------------
   91|   373k|            mvstack[last].mv = cand_mv;
   92|   373k|            mvstack[last].weight = weight;
   93|   373k|            *cnt = last + 1;
   94|   373k|        }
   95|   371k|    }
   96|  21.4M|}
refmvs.c:add_temporal_candidate:
  199|   948k|{
  200|   948k|    if (rb->mv.n == INVALID_MV) return;
  ------------------
  |  |   40|   948k|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (200:9): [True: 246k, False: 702k]
  ------------------
  201|       |
  202|   702k|    union mv mv = mv_projection(rb->mv, rf->pocdiff[ref.ref[0] - 1], rb->ref);
  203|   702k|    fix_mv_precision(rf->frm_hdr, &mv);
  204|       |
  205|   702k|    const int last = *cnt;
  206|   702k|    if (ref.ref[1] == -1) {
  ------------------
  |  Branch (206:9): [True: 597k, False: 104k]
  ------------------
  207|   597k|        if (globalmv_ctx)
  ------------------
  |  Branch (207:13): [True: 211k, False: 386k]
  ------------------
  208|   211k|            *globalmv_ctx = (abs(mv.x - gmv[0].x) | abs(mv.y - gmv[0].y)) >= 16;
  209|       |
  210|  1.90M|        for (int n = 0; n < last; n++)
  ------------------
  |  Branch (210:25): [True: 1.54M, False: 364k]
  ------------------
  211|  1.54M|            if (mvstack[n].mv.mv[0].n == mv.n) {
  ------------------
  |  Branch (211:17): [True: 232k, False: 1.31M]
  ------------------
  212|   232k|                mvstack[n].weight += weight;
  213|   232k|                return;
  214|   232k|            }
  215|   372k|        if (last < 8) {
  ------------------
  |  Branch (215:13): [True: 372k, False: 18.4E]
  ------------------
  216|   372k|            mvstack[last].mv.mv[0] = mv;
  217|   372k|            mvstack[last].weight = weight;
  218|   372k|            *cnt = last + 1;
  219|   372k|        }
  220|   364k|    } else {
  221|   104k|        refmvs_mvpair mvp = { .mv = {
  222|   104k|            [0] = mv,
  223|   104k|            [1] = mv_projection(rb->mv, rf->pocdiff[ref.ref[1] - 1], rb->ref),
  224|   104k|        }};
  225|   104k|        fix_mv_precision(rf->frm_hdr, &mvp.mv[1]);
  226|       |
  227|   281k|        for (int n = 0; n < last; n++)
  ------------------
  |  Branch (227:25): [True: 228k, False: 53.3k]
  ------------------
  228|   228k|            if (mvstack[n].mv.n == mvp.n) {
  ------------------
  |  Branch (228:17): [True: 51.2k, False: 177k]
  ------------------
  229|  51.2k|                mvstack[n].weight += weight;
  230|  51.2k|                return;
  231|  51.2k|            }
  232|  59.9k|        if (last < 8) {
  ------------------
  |  Branch (232:13): [True: 59.9k, False: 18.4E]
  ------------------
  233|  59.9k|            mvstack[last].mv = mvp;
  234|  59.9k|            mvstack[last].weight = weight;
  235|  59.9k|            *cnt = last + 1;
  236|  59.9k|        }
  237|  53.3k|    }
  238|   702k|}
refmvs.c:mv_projection:
  176|   815k|static inline union mv mv_projection(const union mv mv, const int num, const int den) {
  177|   815k|    static const uint16_t div_mult[32] = {
  178|   815k|           0, 16384, 8192, 5461, 4096, 3276, 2730, 2340,
  179|   815k|        2048,  1820, 1638, 1489, 1365, 1260, 1170, 1092,
  180|   815k|        1024,   963,  910,  862,  819,  780,  744,  712,
  181|   815k|         682,   655,  630,  606,  585,  564,  546,  528
  182|   815k|    };
  183|   815k|    assert(den > 0 && den < 32);
  ------------------
  |  Branch (183:5): [True: 815k, False: 18.4E]
  |  Branch (183:5): [True: 815k, False: 18.4E]
  ------------------
  184|   815k|    assert(num > -32 && num < 32);
  ------------------
  |  Branch (184:5): [True: 815k, False: 21]
  |  Branch (184:5): [True: 815k, False: 18.4E]
  ------------------
  185|   815k|    const int frac = num * div_mult[den];
  186|   815k|    const int y = mv.y * frac, x = mv.x * frac;
  187|       |    // Round and clip according to AV1 spec section 7.9.3
  188|   815k|    return (union mv) { // 0x3fff == (1 << 14) - 1
  189|   815k|        .y = iclip((y + 8192 + (y >> 31)) >> 14, -0x3fff, 0x3fff),
  190|   815k|        .x = iclip((x + 8192 + (x >> 31)) >> 14, -0x3fff, 0x3fff)
  191|   815k|    };
  192|   815k|}
refmvs.c:add_compound_extended_candidate:
  250|   449k|{
  251|   449k|    refmvs_candidate *const diff = &same[2];
  252|   449k|    int *const diff_count = &same_count[2];
  253|       |
  254|  1.15M|    for (int n = 0; n < 2; n++) {
  ------------------
  |  Branch (254:21): [True: 876k, False: 281k]
  ------------------
  255|   876k|        const int cand_ref = cand_b->ref.ref[n];
  256|       |
  257|   876k|        if (cand_ref <= 0) break;
  ------------------
  |  Branch (257:13): [True: 168k, False: 708k]
  ------------------
  258|       |
  259|   708k|        const mv cand_mv = cand_b->mv.mv[n];
  260|   708k|        if (cand_ref == ref.ref[0]) {
  ------------------
  |  Branch (260:13): [True: 283k, False: 424k]
  ------------------
  261|   283k|            if (same_count[0] < 2)
  ------------------
  |  Branch (261:17): [True: 271k, False: 12.3k]
  ------------------
  262|   271k|                same[same_count[0]++].mv.mv[0] = cand_mv;
  263|   283k|            if (diff_count[1] < 2) {
  ------------------
  |  Branch (263:17): [True: 233k, False: 50.8k]
  ------------------
  264|   233k|                diff[diff_count[1]++].mv.mv[1] =
  265|   233k|                    mv_apply_sign_bool(cand_mv, sign1 ^ sign_bias[cand_ref - 1]);
  266|   233k|            }
  267|   424k|        } else if (cand_ref == ref.ref[1]) {
  ------------------
  |  Branch (267:20): [True: 228k, False: 196k]
  ------------------
  268|   228k|            if (same_count[1] < 2)
  ------------------
  |  Branch (268:17): [True: 220k, False: 8.00k]
  ------------------
  269|   220k|                same[same_count[1]++].mv.mv[1] = cand_mv;
  270|   228k|            if (diff_count[0] < 2) {
  ------------------
  |  Branch (270:17): [True: 191k, False: 36.9k]
  ------------------
  271|   191k|                diff[diff_count[0]++].mv.mv[0] =
  272|   191k|                    mv_apply_sign_bool(cand_mv, sign0 ^ sign_bias[cand_ref - 1]);
  273|   191k|            }
  274|   228k|        } else {
  275|   196k|            if (diff_count[0] < 2) {
  ------------------
  |  Branch (275:17): [True: 157k, False: 38.9k]
  ------------------
  276|   157k|                diff[diff_count[0]++].mv.mv[0] =
  277|   157k|                    mv_apply_sign_bool(cand_mv, sign0 ^ sign_bias[cand_ref - 1]);
  278|   157k|            }
  279|       |
  280|   196k|            if (diff_count[1] < 2) {
  ------------------
  |  Branch (280:17): [True: 136k, False: 60.0k]
  ------------------
  281|   136k|                diff[diff_count[1]++].mv.mv[1] =
  282|   136k|                    mv_apply_sign_bool(cand_mv, sign1 ^ sign_bias[cand_ref - 1]);
  283|   136k|            }
  284|   196k|        }
  285|   708k|    }
  286|   449k|}
refmvs.c:mv_apply_sign_bool:
  240|  6.76M|static inline mv mv_apply_sign_bool(const mv v, const int s) {
  241|  6.76M|    return (mv) { .y = apply_sign_bool(v.y, s), .x = apply_sign_bool(v.x, s) };
  242|  6.76M|}
refmvs.c:add_single_extended_candidate:
  291|  6.15M|{
  292|  12.2M|    for (int n = 0; n < 2; n++) {
  ------------------
  |  Branch (292:21): [True: 12.1M, False: 47.1k]
  ------------------
  293|  12.1M|        const int cand_ref = cand_b->ref.ref[n];
  294|       |
  295|  12.1M|        if (cand_ref <= 0) break;
  ------------------
  |  Branch (295:13): [True: 6.10M, False: 6.05M]
  ------------------
  296|       |        // we need to continue even if cand_ref == ref.ref[0], since
  297|       |        // the candidate could have been added as a globalmv variant,
  298|       |        // which changes the value
  299|       |        // FIXME if scan_{row,col}() returned a mask for the nearest
  300|       |        // edge, we could skip the appropriate ones here
  301|       |
  302|  6.05M|        const mv cand_mv = mv_apply_sign_bool(cand_b->mv.mv[n],
  303|  6.05M|                                              sign ^ sign_bias[cand_ref - 1]);
  304|       |
  305|  6.05M|        int m;
  306|  6.05M|        const int last = *cnt;
  307|  6.44M|        for (m = 0; m < last; m++)
  ------------------
  |  Branch (307:21): [True: 5.98M, False: 458k]
  ------------------
  308|  5.98M|            if (cand_mv.n == mvstack[m].mv.mv[0].n)
  ------------------
  |  Branch (308:17): [True: 5.59M, False: 392k]
  ------------------
  309|  5.59M|                break;
  310|  6.05M|        if (m == last) {
  ------------------
  |  Branch (310:13): [True: 466k, False: 5.58M]
  ------------------
  311|   466k|            mvstack[m].mv.mv[0] = cand_mv;
  312|   466k|            mvstack[m].weight = 2; // "minimal"
  313|   466k|            *cnt = last + 1;
  314|   466k|        }
  315|  6.05M|    }
  316|  6.15M|}

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

dav1d_init_last_nonzero_col_from_eob_tables:
  350|  5.05k|COLD void dav1d_init_last_nonzero_col_from_eob_tables(void) {
  351|       |    static pthread_once_t initted = PTHREAD_ONCE_INIT;
  352|  5.05k|    pthread_once(&initted, init_internal);
  353|  5.05k|}
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:
  156|  60.3k|static inline void dav1d_set_thread_name(const char *const name) {
  157|       |    prctl(PR_SET_NAME, name);
  158|  60.3k|}

dav1d_task_create_tile_sbrow:
  267|   324k|{
  268|   324k|    Dav1dTask *tasks = f->task_thread.tile_tasks[0];
  269|   324k|    const int uses_2pass = f->c->n_fc > 1;
  270|   324k|    const int n_tasks_per_pass = f->frame_hdr->tiling.cols * f->frame_hdr->tiling.rows;
  271|   324k|    const int n_tasks = n_tasks_per_pass * (1 + uses_2pass);
  272|   324k|    if (pass < 2) {
  ------------------
  |  Branch (272:9): [True: 162k, False: 162k]
  ------------------
  273|   162k|        if (n_tasks > f->task_thread.num_tile_tasks) {
  ------------------
  |  Branch (273:13): [True: 21.7k, False: 140k]
  ------------------
  274|  21.7k|            const size_t size = sizeof(Dav1dTask) * n_tasks;
  275|  21.7k|            tasks = dav1d_realloc(ALLOC_COMMON_CTX, f->task_thread.tile_tasks[0], size);
  ------------------
  |  |  133|  21.7k|#define dav1d_realloc(type, ptr, sz) realloc(ptr, sz)
  ------------------
  276|  21.7k|            if (!tasks) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (276:17): [True: 0, False: 21.7k]
  ------------------
  277|  21.7k|            memset(tasks, 0, size);
  278|  21.7k|            f->task_thread.tile_tasks[0] = tasks;
  279|  21.7k|            f->task_thread.num_tile_tasks = n_tasks;
  280|  21.7k|        }
  281|   162k|        f->task_thread.tile_tasks[1] = tasks + n_tasks_per_pass;
  282|   162k|    }
  283|   324k|    assert(n_tasks <= f->task_thread.num_tile_tasks);
  ------------------
  |  Branch (283:5): [True: 324k, False: 18.4E]
  ------------------
  284|       |
  285|   324k|    Dav1dTask *pf_t;
  286|   324k|    const int res = create_filter_sbrow(f, pass, &pf_t);
  287|   324k|    if (res) return res;
  ------------------
  |  Branch (287:9): [True: 0, False: 324k]
  ------------------
  288|       |
  289|   324k|    Dav1dTask *const p1_tasks = f->task_thread.tile_tasks[1];
  290|   324k|    Dav1dTask *prev_t = NULL;
  291|   324k|    if (pass == 2) {
  ------------------
  |  Branch (291:9): [True: 162k, False: 162k]
  ------------------
  292|   162k|        prev_t = &p1_tasks[n_tasks_per_pass - 1];
  293|       |        // PF task is scheduled after the last sby=0 TILE task
  294|   162k|        if (f->frame_hdr->tiling.rows == 1)
  ------------------
  |  Branch (294:13): [True: 156k, False: 6.34k]
  ------------------
  295|   156k|            prev_t = prev_t->next;
  296|   162k|    }
  297|   324k|    tasks += (pass & 1) * n_tasks_per_pass;
  298|   690k|    for (int tile_idx = 0; tile_idx < n_tasks_per_pass; tile_idx++) {
  ------------------
  |  Branch (298:28): [True: 365k, False: 324k]
  ------------------
  299|   365k|        Dav1dTileState *const ts = &f->ts[tile_idx];
  300|   365k|        Dav1dTask *t = &tasks[tile_idx];
  301|   365k|        t->sby = ts->tiling.row_start >> f->sb_shift;
  302|   365k|        if (pf_t && t->sby) {
  ------------------
  |  Branch (302:13): [True: 350k, False: 15.6k]
  |  Branch (302:21): [True: 12.6k, False: 337k]
  ------------------
  303|  12.6k|            prev_t->next = pf_t;
  304|  12.6k|            prev_t = pf_t;
  305|  12.6k|            pf_t = NULL;
  306|  12.6k|        }
  307|   365k|        t->recon_progress = 0;
  308|   365k|        t->deblock_progress = 0;
  309|   365k|        t->deps_skip = 0;
  310|   365k|        t->type = pass != 1 ? DAV1D_TASK_TYPE_TILE_RECONSTRUCTION :
  ------------------
  |  Branch (310:19): [True: 182k, False: 183k]
  ------------------
  311|   365k|                              DAV1D_TASK_TYPE_TILE_ENTROPY;
  312|   365k|        t->frame_idx = (int)(f - f->c->fc);
  313|   365k|        if (prev_t) prev_t->next = t;
  ------------------
  |  Branch (313:13): [True: 203k, False: 162k]
  ------------------
  314|   365k|        prev_t = t;
  315|   365k|    }
  316|   324k|    if (pf_t) {
  ------------------
  |  Branch (316:9): [True: 311k, False: 12.7k]
  ------------------
  317|   311k|        prev_t->next = pf_t;
  318|   311k|        prev_t = pf_t;
  319|   311k|    }
  320|   324k|    prev_t->next = NULL;
  321|       |
  322|   324k|    f->task_thread.done[pass & 1] = 0;
  323|       |
  324|   324k|    if (!(pass & 1)) {
  ------------------
  |  Branch (324:9): [True: 162k, False: 162k]
  ------------------
  325|       |        atomic_store_explicit(&f->task_thread.init_done, 1, memory_order_relaxed);
  326|   162k|        add_pending(f, f->task_thread.tile_tasks[pass == 2], prev_t);
  327|   162k|    }
  328|   324k|    return 0;
  329|   324k|}
dav1d_task_frame_init:
  331|   216k|void dav1d_task_frame_init(Dav1dFrameContext *const f) {
  332|   216k|    const Dav1dContext *const c = f->c;
  333|       |
  334|   216k|    atomic_store_explicit(&f->task_thread.init_done, 0, memory_order_relaxed);
  335|   216k|    f->task_thread.task_cur_prev = NULL;
  336|       |    // schedule init task, which will schedule the remaining tasks
  337|   216k|    Dav1dTask *const t = &f->task_thread.init_task;
  338|   216k|    t->type = DAV1D_TASK_TYPE_INIT;
  339|   216k|    t->frame_idx = (int)(f - c->fc);
  340|   216k|    t->sby = 0;
  341|   216k|    t->recon_progress = t->deblock_progress = 0;
  342|   216k|    insert_task(f, t, 1);
  343|   216k|}
dav1d_task_delayed_fg:
  347|  4.01k|{
  348|  4.01k|    struct TaskThreadData *const ttd = &c->task_thread;
  349|  4.01k|    ttd->delayed_fg.in = in;
  350|  4.01k|    ttd->delayed_fg.out = out;
  351|  4.01k|    ttd->delayed_fg.type = DAV1D_TASK_TYPE_FG_PREP;
  352|  4.01k|    atomic_init(&ttd->delayed_fg.progress[0], 0);
  353|  4.01k|    atomic_init(&ttd->delayed_fg.progress[1], 0);
  354|  4.01k|    pthread_mutex_lock(&ttd->lock);
  355|  4.01k|    ttd->delayed_fg.exec = 1;
  356|  4.01k|    ttd->delayed_fg.finished = 0;
  357|  4.01k|    pthread_cond_signal(&ttd->cond);
  358|  4.01k|    do {
  359|  4.01k|        pthread_cond_wait(&ttd->delayed_fg.cond, &ttd->lock);
  360|  4.01k|    } while (!ttd->delayed_fg.finished);
  ------------------
  |  Branch (360:14): [True: 0, False: 4.01k]
  ------------------
  361|  4.01k|    pthread_mutex_unlock(&ttd->lock);
  362|  4.01k|}
dav1d_worker_task:
  704|  60.3k|void *dav1d_worker_task(void *data) {
  705|  60.3k|    Dav1dTaskContext *const tc = data;
  706|  60.3k|    const Dav1dContext *const c = tc->c;
  707|  60.3k|    struct TaskThreadData *const ttd = tc->task_thread.ttd;
  708|       |
  709|  60.3k|    dav1d_set_thread_name("dav1d-worker");
  710|       |
  711|  60.3k|    pthread_mutex_lock(&ttd->lock);
  712|  34.5M|    for (;;) {
  713|  34.5M|        if (tc->task_thread.die) break;
  ------------------
  |  Branch (713:13): [True: 60.4k, False: 34.5M]
  ------------------
  714|  34.5M|        if (atomic_load_explicit(c->flush, memory_order_relaxed)) goto park;
  ------------------
  |  Branch (714:13): [True: 8.75k, False: 34.5M]
  ------------------
  715|       |
  716|  34.5M|        merge_pending(c);
  717|  34.5M|        if (ttd->delayed_fg.exec) { // run delayed film grain first
  ------------------
  |  Branch (717:13): [True: 7.93k, False: 34.5M]
  ------------------
  718|  7.93k|            delayed_fg_task(c, ttd);
  719|  7.93k|            continue;
  720|  7.93k|        }
  721|  34.5M|        Dav1dFrameContext *f;
  722|  34.5M|        Dav1dTask *t, *prev_t = NULL;
  723|  34.5M|        if (c->n_fc > 1) { // run init tasks second
  ------------------
  |  Branch (723:13): [True: 34.5M, False: 0]
  ------------------
  724|  34.5M|            t = find_init_task(c, ttd, &f);
  725|  34.5M|            if (t) goto found;
  ------------------
  |  Branch (725:17): [True: 229k, False: 34.2M]
  ------------------
  726|  34.5M|        }
  727|  34.2M|        t = find_task(c, ttd, &f, &prev_t); // run decoding tasks last
  728|  34.2M|        if (t) {
  ------------------
  |  Branch (728:13): [True: 33.0M, False: 1.23M]
  ------------------
  729|  33.0M|            if (t->type > DAV1D_TASK_TYPE_INIT_CDF && t->recon_progress &&
  ------------------
  |  Branch (729:17): [True: 33.0M, False: 0]
  |  Branch (729:55): [True: 21.5M, False: 11.4M]
  ------------------
  730|  21.5M|                t->type != DAV1D_TASK_TYPE_TILE_ENTROPY &&
  ------------------
  |  Branch (730:17): [True: 21.5M, False: 0]
  ------------------
  731|  21.5M|                t->type != DAV1D_TASK_TYPE_TILE_RECONSTRUCTION &&
  ------------------
  |  Branch (731:17): [True: 21.5M, False: 0]
  ------------------
  732|  21.5M|                t->sby + 1 < f->sbh)
  ------------------
  |  Branch (732:17): [True: 21.2M, False: 323k]
  ------------------
  733|  21.2M|            {
  734|       |                // add sby+1 to list to replace this one
  735|  21.2M|                const int p = t->type == DAV1D_TASK_TYPE_ENTROPY_PROGRESS;
  736|  21.2M|                Dav1dTask *next_t = &t[1];
  737|  21.2M|                *next_t = *t;
  738|  21.2M|                next_t->sby++;
  739|  21.2M|                const int ntr = f->frame_thread.next_tile_row[p] + 1;
  740|  21.2M|                const int start = f->frame_hdr->tiling.row_start_sb[ntr];
  741|  21.2M|                if (next_t->sby == start)
  ------------------
  |  Branch (741:21): [True: 22.8k, False: 21.2M]
  ------------------
  742|  22.8k|                    f->frame_thread.next_tile_row[p] = ntr;
  743|  21.2M|                next_t->recon_progress = next_t->sby + 1;
  744|  21.2M|                insert_task(f, next_t, 0);
  745|  21.2M|            }
  746|  33.0M|            goto found;
  747|  33.0M|        }
  748|  1.23M|        if (reset_task_cur(c, ttd, UINT_MAX)) continue;
  ------------------
  |  Branch (748:13): [True: 11.1k, False: 1.22M]
  ------------------
  749|  1.22M|        if (merge_pending(c)) continue;
  ------------------
  |  Branch (749:13): [True: 7.81k, False: 1.22M]
  ------------------
  750|  1.22M|    park:
  751|  1.22M|        tc->task_thread.flushed = 1;
  752|  1.22M|        pthread_cond_signal(&tc->task_thread.td.cond);
  753|       |        // we want to be woken up next time progress is signaled
  754|  1.22M|        atomic_store_explicit(&ttd->cond_signaled, 0, memory_order_relaxed);
  755|  1.22M|        pthread_cond_wait(&ttd->cond, &ttd->lock);
  756|  1.22M|        atomic_store_explicit(&ttd->cond_signaled, 0, memory_order_relaxed);
  757|  1.22M|        tc->task_thread.flushed = 0;
  758|  1.22M|        reset_task_cur(c, ttd, UINT_MAX);
  759|  1.22M|        continue;
  760|       |
  761|  33.2M|    found:
  762|       |        // remove t from list
  763|  33.2M|        if (prev_t) prev_t->next = t->next;
  ------------------
  |  Branch (763:13): [True: 4.37M, False: 28.8M]
  ------------------
  764|  28.8M|        else f->task_thread.task_head = t->next;
  765|  33.2M|        if (!t->next) f->task_thread.task_tail = prev_t;
  ------------------
  |  Branch (765:13): [True: 716k, False: 32.5M]
  ------------------
  766|  33.2M|        if (t->type > DAV1D_TASK_TYPE_INIT_CDF && !f->task_thread.task_head)
  ------------------
  |  Branch (766:13): [True: 33.0M, False: 229k]
  |  Branch (766:51): [True: 184k, False: 32.8M]
  ------------------
  767|   184k|            ttd->cur++;
  768|  33.2M|        t->next = NULL;
  769|       |        // Only wake up another thread if there's more work available and no
  770|       |        // other thread is already in the process of being woken up (it will
  771|       |        // in turn wake up the next one if needed). Waking up threads only for
  772|       |        // them to go straight back to sleep is expensive and causes a lot of
  773|       |        // lock contention. Since we always come back here after executing the
  774|       |        // task, not waking anyone can't cause tasks to get stuck in the queue.
  775|  33.2M|        unlock_and_signal(c, ttd);
  776|  44.0M|    found_unlocked:;
  777|  44.0M|        if (atomic_load_explicit(c->flush, memory_order_relaxed))
  ------------------
  |  Branch (777:13): [True: 7.79k, False: 44.0M]
  ------------------
  778|  44.0M|            atomic_fetch_or_explicit(&f->task_thread.error, 1, memory_order_relaxed);
  779|  44.0M|        int error = atomic_load_explicit(&f->task_thread.error, memory_order_relaxed);
  780|       |
  781|       |        // run it
  782|  44.0M|        tc->f = f;
  783|  44.0M|        int sby = t->sby;
  784|  44.0M|        switch (t->type) {
  785|   215k|        case DAV1D_TASK_TYPE_INIT: {
  ------------------
  |  Branch (785:9): [True: 215k, False: 43.8M]
  ------------------
  786|   215k|            assert(c->n_fc > 1);
  ------------------
  |  Branch (786:13): [True: 215k, False: 18.4E]
  ------------------
  787|   215k|            int res = dav1d_decode_frame_init(f);
  788|   215k|            int p1 = f->in_cdf.progress ?
  ------------------
  |  Branch (788:22): [True: 68.2k, False: 147k]
  ------------------
  789|   215k|                atomic_load_explicit(f->in_cdf.progress, memory_order_acquire) : 1;
  790|   215k|            if (res || p1 == TILE_ERROR) {
  ------------------
  |  |   36|   215k|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (790:17): [True: 451, False: 215k]
  |  Branch (790:24): [True: 36.7k, False: 178k]
  ------------------
  791|  36.8k|                pthread_mutex_lock(&ttd->lock);
  792|  36.8k|                abort_frame(f, res ? res : DAV1D_ERR(EINVAL));
  ------------------
  |  |   58|  36.8k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (792:32): [True: 0, False: 36.8k]
  ------------------
  793|  36.8k|                reset_task_cur(c, ttd, t->frame_idx);
  794|   178k|            } else {
  795|   178k|                t->type = DAV1D_TASK_TYPE_INIT_CDF;
  796|   178k|                if (p1) goto found_unlocked;
  ------------------
  |  Branch (796:21): [True: 164k, False: 14.6k]
  ------------------
  797|  14.6k|                add_pending(f, t, t);
  798|  14.6k|                pthread_mutex_lock(&ttd->lock);
  799|  14.6k|            }
  800|  51.4k|            continue;
  801|   215k|        }
  802|   178k|        case DAV1D_TASK_TYPE_INIT_CDF: {
  ------------------
  |  Branch (802:9): [True: 178k, False: 43.9M]
  ------------------
  803|   178k|            assert(c->n_fc > 1);
  ------------------
  |  Branch (803:13): [True: 178k, False: 18.4E]
  ------------------
  804|   178k|            int res = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|   178k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  805|   178k|            if (!atomic_load_explicit(&f->task_thread.error, memory_order_relaxed))
  ------------------
  |  Branch (805:17): [True: 171k, False: 7.11k]
  ------------------
  806|   171k|                res = dav1d_decode_frame_init_cdf(f);
  807|   502k|            for (int p = 1; p <= 2 && !res; p++)
  ------------------
  |  Branch (807:29): [True: 340k, False: 162k]
  |  Branch (807:39): [True: 324k, False: 15.8k]
  ------------------
  808|   324k|                res = dav1d_task_create_tile_sbrow(f, p, 0);
  809|   178k|            pthread_mutex_lock(&ttd->lock);
  810|   178k|            if (res) {
  ------------------
  |  Branch (810:17): [True: 15.8k, False: 162k]
  ------------------
  811|  15.8k|                abort_frame(f, res);
  812|  15.8k|                reset_task_cur(c, ttd, t->frame_idx);
  813|  15.8k|                atomic_store_explicit(&f->task_thread.init_done, 1, memory_order_relaxed);
  814|  15.8k|            }
  815|   178k|            continue;
  816|   178k|        }
  817|  10.9M|        case DAV1D_TASK_TYPE_TILE_ENTROPY:
  ------------------
  |  Branch (817:9): [True: 10.9M, False: 33.1M]
  ------------------
  818|  22.1M|        case DAV1D_TASK_TYPE_TILE_RECONSTRUCTION: {
  ------------------
  |  Branch (818:9): [True: 11.2M, False: 32.8M]
  ------------------
  819|  22.1M|            const int p = t->type == DAV1D_TASK_TYPE_TILE_ENTROPY;
  820|  22.1M|            const int tile_idx = (int)(t - f->task_thread.tile_tasks[p]);
  821|  22.1M|            Dav1dTileState *const ts = &f->ts[tile_idx];
  822|       |
  823|  22.1M|            tc->ts = ts;
  824|  22.1M|            tc->by = sby << f->sb_shift;
  825|  22.1M|            const int uses_2pass = c->n_fc > 1;
  826|  22.1M|            tc->frame_thread.pass = !uses_2pass ? 0 :
  ------------------
  |  Branch (826:37): [True: 0, False: 22.1M]
  ------------------
  827|  22.1M|                1 + (t->type == DAV1D_TASK_TYPE_TILE_RECONSTRUCTION);
  828|  22.1M|            if (!error) error = dav1d_decode_tile_sbrow(tc);
  ------------------
  |  Branch (828:17): [True: 9.05M, False: 13.0M]
  ------------------
  829|  22.1M|            const int progress = error ? TILE_ERROR : 1 + sby;
  ------------------
  |  |   36|  13.1M|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (829:34): [True: 13.1M, False: 8.98M]
  ------------------
  830|       |
  831|       |            // signal progress
  832|  22.1M|            if (error)
  ------------------
  |  Branch (832:17): [True: 13.1M, False: 8.98M]
  ------------------
  833|  22.1M|                atomic_fetch_or_explicit(&f->task_thread.error, error, memory_order_relaxed);
  834|  22.1M|            if (((sby + 1) << f->sb_shift) < ts->tiling.row_end) {
  ------------------
  |  Branch (834:17): [True: 21.7M, False: 426k]
  ------------------
  835|  21.7M|                t->sby++;
  836|  21.7M|                t->deps_skip = 0;
  837|  21.7M|                atomic_store_explicit(&ts->progress[p], progress, memory_order_release);
  838|  21.7M|                if (p && !check_tile(t, f, uses_2pass)) {
  ------------------
  |  Branch (838:21): [True: 10.7M, False: 10.9M]
  |  Branch (838:26): [True: 10.6M, False: 91.9k]
  ------------------
  839|  10.6M|                    reset_task_cur_async(ttd, t->frame_idx, c->n_fc);
  840|  10.6M|                    signal_if_ready(c, ttd);
  841|  10.6M|                    goto found_unlocked;
  842|  10.6M|                }
  843|  11.0M|                add_pending(f, t, t);
  844|  11.0M|                pthread_mutex_lock(&ttd->lock);
  845|  11.0M|            } else {
  846|   426k|                if (f->frame_hdr->refresh_context &&
  ------------------
  |  Branch (846:21): [True: 55.9k, False: 370k]
  ------------------
  847|  55.9k|                    tc->frame_thread.pass <= 1 &&
  ------------------
  |  Branch (847:21): [True: 28.0k, False: 27.9k]
  ------------------
  848|  28.0k|                    f->frame_hdr->tiling.update == tile_idx)
  ------------------
  |  Branch (848:21): [True: 21.1k, False: 6.83k]
  ------------------
  849|  21.1k|                {
  850|  21.1k|                    error = atomic_load_explicit(&f->task_thread.error, memory_order_relaxed);
  851|  21.1k|                    if (!error)
  ------------------
  |  Branch (851:25): [True: 12.7k, False: 8.45k]
  ------------------
  852|  12.7k|                        dav1d_cdf_thread_update(f->frame_hdr, f->out_cdf.data.cdf,
  853|  12.7k|                                                &f->ts[f->frame_hdr->tiling.update].cdf);
  854|  21.1k|                    if (c->n_fc > 1)
  ------------------
  |  Branch (854:25): [True: 21.1k, False: 18.4E]
  ------------------
  855|  21.1k|                        atomic_store_explicit(f->out_cdf.progress, error ? TILE_ERROR : 1,
  ------------------
  |  |   36|  8.45k|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (855:68): [True: 8.45k, False: 12.7k]
  ------------------
  856|  21.1k|                                              memory_order_release);
  857|  21.1k|                }
  858|   426k|                pthread_mutex_lock(&ttd->lock);
  859|   426k|                atomic_store_explicit(&ts->progress[p], progress, memory_order_relaxed);
  860|   426k|                reset_task_cur(c, ttd, t->frame_idx);
  861|   426k|                complete_task(f);
  862|   426k|                assert(f->task_thread.task_counter >= 0);
  ------------------
  |  Branch (862:17): [True: 364k, False: 61.9k]
  ------------------
  863|   426k|            }
  864|  11.3M|            continue;
  865|  22.1M|        }
  866|  11.3M|        case DAV1D_TASK_TYPE_DEBLOCK_COLS:
  ------------------
  |  Branch (866:9): [True: 4.72M, False: 39.3M]
  ------------------
  867|  4.72M|            if (!atomic_load_explicit(&f->task_thread.error, memory_order_relaxed))
  ------------------
  |  Branch (867:17): [True: 3.69M, False: 1.02M]
  ------------------
  868|  3.69M|                f->bd_fn.filter_sbrow_deblock_cols(f, sby);
  869|  4.72M|            if (ensure_progress(ttd, f, t, DAV1D_TASK_TYPE_DEBLOCK_ROWS,
  ------------------
  |  Branch (869:17): [True: 72.9k, False: 4.65M]
  ------------------
  870|  4.72M|                                &f->frame_thread.deblock_progress,
  871|  4.72M|                                &t->deblock_progress)) continue;
  872|       |            // fall-through
  873|  4.84M|        case DAV1D_TASK_TYPE_DEBLOCK_ROWS:
  ------------------
  |  Branch (873:9): [True: 188k, False: 43.9M]
  ------------------
  874|  4.84M|            if (!atomic_load_explicit(&f->task_thread.error, memory_order_relaxed))
  ------------------
  |  Branch (874:17): [True: 3.71M, False: 1.12M]
  ------------------
  875|  3.71M|                f->bd_fn.filter_sbrow_deblock_rows(f, sby);
  876|       |            // signal deblock progress
  877|  4.84M|            if (f->frame_hdr->loopfilter.level_y[0] ||
  ------------------
  |  Branch (877:17): [True: 4.40M, False: 438k]
  ------------------
  878|   438k|                f->frame_hdr->loopfilter.level_y[1])
  ------------------
  |  Branch (878:17): [True: 322k, False: 115k]
  ------------------
  879|  4.71M|            {
  880|  4.71M|                error = atomic_load_explicit(&f->task_thread.error, memory_order_relaxed);
  881|  4.71M|                atomic_store_explicit(&f->frame_thread.deblock_progress,
  882|  4.71M|                                      error ? TILE_ERROR : sby + 1, memory_order_release);
  ------------------
  |  |   36|  1.02M|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (882:39): [True: 1.02M, False: 3.68M]
  ------------------
  883|  4.71M|                reset_task_cur_async(ttd, t->frame_idx, c->n_fc);
  884|  4.71M|                signal_if_ready(c, ttd);
  885|  4.71M|            } else if (f->lf.cdef_planes || f->lf.restore_planes) {
  ------------------
  |  Branch (885:24): [True: 30.2k, False: 95.1k]
  |  Branch (885:45): [True: 95.1k, False: 0]
  ------------------
  886|   115k|                atomic_fetch_or_explicit(&f->frame_thread.copy_lpf_progress[sby >> 5],
  887|   115k|                                         1U << (sby & 31), memory_order_release);
  888|       |                // CDEF needs the top buffer to be saved by lr_copy_lpf of the
  889|       |                // previous sbrow
  890|   115k|                if (sby) {
  ------------------
  |  Branch (890:21): [True: 109k, False: 5.73k]
  ------------------
  891|   109k|                    int prog =
  892|   109k|                        atomic_load_explicit(&f->frame_thread.copy_lpf_progress[(sby - 1) >> 5],
  893|   109k|                                             memory_order_acquire);
  894|   109k|                    if (~prog & (1U << ((sby - 1) & 31))) {
  ------------------
  |  Branch (894:25): [True: 1.60k, False: 108k]
  ------------------
  895|  1.60k|                        t->type = DAV1D_TASK_TYPE_CDEF;
  896|  1.60k|                        t->recon_progress = t->deblock_progress = 0;
  897|  1.60k|                        add_pending(f, t, t);
  898|  1.60k|                        pthread_mutex_lock(&ttd->lock);
  899|  1.60k|                        continue;
  900|  1.60k|                    }
  901|   109k|                }
  902|   115k|            }
  903|       |            // fall-through
  904|  4.84M|        case DAV1D_TASK_TYPE_CDEF:
  ------------------
  |  Branch (904:9): [True: 1.60k, False: 44.0M]
  ------------------
  905|  4.84M|            if (f->lf.cdef_planes &&
  ------------------
  |  Branch (905:17): [True: 2.38M, False: 2.45M]
  ------------------
  906|  2.38M|                !atomic_load_explicit(&f->task_thread.error, memory_order_relaxed))
  ------------------
  |  Branch (906:17): [True: 2.05M, False: 331k]
  ------------------
  907|  2.05M|            {
  908|  2.05M|                f->bd_fn.filter_sbrow_cdef(tc, sby);
  909|  2.05M|            }
  910|       |            // fall-through
  911|  4.89M|        case DAV1D_TASK_TYPE_SUPER_RESOLUTION:
  ------------------
  |  Branch (911:9): [True: 54.1k, False: 44.0M]
  ------------------
  912|  4.89M|            if (f->frame_hdr->width[0] != f->frame_hdr->width[1])
  ------------------
  |  Branch (912:17): [True: 677k, False: 4.21M]
  ------------------
  913|   677k|                if (!atomic_load_explicit(&f->task_thread.error, memory_order_relaxed))
  ------------------
  |  Branch (913:21): [True: 160k, False: 516k]
  ------------------
  914|   160k|                    f->bd_fn.filter_sbrow_resize(f, sby);
  915|       |            // fall-through
  916|  4.89M|        case DAV1D_TASK_TYPE_LOOP_RESTORATION:
  ------------------
  |  Branch (916:9): [True: 0, False: 44.0M]
  ------------------
  917|  4.89M|            if (!atomic_load_explicit(&f->task_thread.error, memory_order_relaxed) &&
  ------------------
  |  Branch (917:17): [True: 3.74M, False: 1.14M]
  ------------------
  918|  3.74M|                f->lf.restore_planes)
  ------------------
  |  Branch (918:17): [True: 257k, False: 3.49M]
  ------------------
  919|   257k|            {
  920|   257k|                f->bd_fn.filter_sbrow_lr(f, sby);
  921|   257k|            }
  922|       |            // fall-through
  923|  10.7M|        case DAV1D_TASK_TYPE_RECONSTRUCTION_PROGRESS:
  ------------------
  |  Branch (923:9): [True: 5.86M, False: 38.2M]
  ------------------
  924|       |            // dummy to cover for no post-filters
  925|  21.5M|        case DAV1D_TASK_TYPE_ENTROPY_PROGRESS:
  ------------------
  |  Branch (925:9): [True: 10.7M, False: 33.3M]
  ------------------
  926|       |            // dummy to convert tile progress to frame
  927|  21.5M|            break;
  928|      0|        default: abort();
  ------------------
  |  Branch (928:9): [True: 0, False: 44.0M]
  ------------------
  929|  44.0M|        }
  930|       |        // if task completed [typically LR], signal picture progress as per below
  931|  21.4M|        const int sbh = f->sbh;
  932|  21.4M|        const int sbsz = f->sb_step * 4;
  933|  21.4M|        if (t->type == DAV1D_TASK_TYPE_ENTROPY_PROGRESS) {
  ------------------
  |  Branch (933:13): [True: 10.7M, False: 10.7M]
  ------------------
  934|  10.7M|            error = atomic_load_explicit(&f->task_thread.error, memory_order_relaxed);
  935|  10.7M|            const unsigned y = sby + 1 == sbh ? UINT_MAX : (unsigned)(sby + 1) * sbsz;
  ------------------
  |  Branch (935:32): [True: 161k, False: 10.6M]
  ------------------
  936|  10.7M|            assert(c->n_fc > 1);
  ------------------
  |  Branch (936:13): [True: 10.7M, False: 18.4E]
  ------------------
  937|  10.7M|            atomic_store_explicit(&f->sr_cur.progress[0], error ? FRAME_ERROR : y,
  ------------------
  |  |   35|  6.67M|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  |  Branch (937:59): [True: 6.67M, False: 4.09M]
  ------------------
  938|  10.7M|                                  memory_order_release);
  939|  10.7M|            atomic_store_explicit(&f->frame_thread.entropy_progress,
  940|  10.7M|                                  error ? TILE_ERROR : sby + 1, memory_order_release);
  ------------------
  |  |   36|  6.67M|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (940:35): [True: 6.67M, False: 4.09M]
  ------------------
  941|  10.7M|            pthread_mutex_lock(&ttd->lock);
  942|  10.7M|            if (sby + 1 == sbh)
  ------------------
  |  Branch (942:17): [True: 161k, False: 10.6M]
  ------------------
  943|   161k|                f->task_thread.done[1] = 1;
  944|  10.7M|            complete_task(f);
  945|  10.7M|            reset_task_cur(c, ttd, t->frame_idx);
  946|  10.7M|            continue;
  947|  10.7M|        }
  948|       |    // t->type != DAV1D_TASK_TYPE_ENTROPY_PROGRESS
  949|  21.4M|        atomic_fetch_or_explicit(&f->frame_thread.frame_progress[sby >> 5],
  950|  10.7M|                                 1U << (sby & 31), memory_order_release);
  951|  10.7M|        pthread_mutex_lock(&ttd->lock);
  952|  10.7M|        sby = get_frame_progress(c, f);
  953|  10.7M|        error = atomic_load_explicit(&f->task_thread.error, memory_order_relaxed);
  954|  10.7M|        const unsigned y = sby + 1 == sbh ? UINT_MAX : (unsigned)(sby + 1) * sbsz;
  ------------------
  |  Branch (954:28): [True: 6.73M, False: 3.99M]
  ------------------
  955|  10.7M|        if (c->n_fc > 1)
  ------------------
  |  Branch (955:13): [True: 10.7M, False: 18.4E]
  ------------------
  956|  10.7M|            atomic_store_explicit(&f->sr_cur.progress[1], error ? FRAME_ERROR : y,
  ------------------
  |  |   35|  6.71M|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  |  Branch (956:59): [True: 6.71M, False: 4.06M]
  ------------------
  957|  10.7M|                                  memory_order_relaxed);
  958|  10.7M|        if (sby + 1 == sbh)
  ------------------
  |  Branch (958:13): [True: 6.73M, False: 3.99M]
  ------------------
  959|  6.73M|            f->task_thread.done[0] = 1;
  960|  10.7M|        complete_task(f);
  961|  10.7M|        reset_task_cur(c, ttd, t->frame_idx);
  962|  10.7M|    }
  963|  18.4E|    pthread_mutex_unlock(&ttd->lock);
  964|       |
  965|       |    return NULL;
  966|  60.3k|}
thread_task.c:create_filter_sbrow:
  212|   324k|{
  213|   324k|    const int has_deblock = f->frame_hdr->loopfilter.level_y[0] ||
  ------------------
  |  Branch (213:29): [True: 106k, False: 218k]
  ------------------
  214|   218k|                            f->frame_hdr->loopfilter.level_y[1];
  ------------------
  |  Branch (214:29): [True: 4.31k, False: 213k]
  ------------------
  215|   324k|    const int has_cdef = f->lf.cdef_planes;
  216|   324k|    const int has_resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
  217|   324k|    const int has_lr = f->lf.restore_planes;
  218|       |
  219|   324k|    Dav1dTask *tasks = f->task_thread.tasks;
  220|   324k|    const int uses_2pass = f->c->n_fc > 1;
  221|   324k|    int num_tasks = f->sbh * (1 + uses_2pass);
  222|   324k|    if (num_tasks > f->task_thread.num_tasks) {
  ------------------
  |  Branch (222:9): [True: 21.7k, False: 302k]
  ------------------
  223|  21.7k|        const size_t size = sizeof(Dav1dTask) * num_tasks;
  224|  21.7k|        tasks = dav1d_realloc(ALLOC_COMMON_CTX, f->task_thread.tasks, size);
  ------------------
  |  |  133|  21.7k|#define dav1d_realloc(type, ptr, sz) realloc(ptr, sz)
  ------------------
  225|  21.7k|        if (!tasks) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (225:13): [True: 0, False: 21.7k]
  ------------------
  226|  21.7k|        memset(tasks, 0, size);
  227|  21.7k|        f->task_thread.tasks = tasks;
  228|  21.7k|        f->task_thread.num_tasks = num_tasks;
  229|  21.7k|    }
  230|   324k|    tasks += f->sbh * (pass & 1);
  231|       |
  232|   324k|    if (pass & 1) {
  ------------------
  |  Branch (232:9): [True: 162k, False: 162k]
  ------------------
  233|   162k|        atomic_store_explicit(&f->frame_thread.entropy_progress, 0, memory_order_relaxed);
  234|   162k|    } else {
  235|   162k|        const int prog_sz = ((f->sbh + 31) & ~31) >> 5;
  236|   162k|        if (prog_sz > f->frame_thread.prog_sz) {
  ------------------
  |  Branch (236:13): [True: 22.2k, False: 139k]
  ------------------
  237|  22.2k|            atomic_uint *const prog = dav1d_realloc(ALLOC_COMMON_CTX, f->frame_thread.frame_progress,
  ------------------
  |  |  133|  22.2k|#define dav1d_realloc(type, ptr, sz) realloc(ptr, sz)
  ------------------
  238|  22.2k|                                                    2 * prog_sz * sizeof(*prog));
  239|  22.2k|            if (!prog) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (239:17): [True: 0, False: 22.2k]
  ------------------
  240|  22.2k|            f->frame_thread.frame_progress = prog;
  241|  22.2k|            f->frame_thread.copy_lpf_progress = prog + prog_sz;
  242|  22.2k|        }
  243|   162k|        f->frame_thread.prog_sz = prog_sz;
  244|   162k|        memset(f->frame_thread.frame_progress, 0, prog_sz * sizeof(atomic_uint));
  245|   162k|        memset(f->frame_thread.copy_lpf_progress, 0, prog_sz * sizeof(atomic_uint));
  246|   162k|        atomic_store_explicit(&f->frame_thread.deblock_progress, 0, memory_order_relaxed);
  247|   162k|    }
  248|   324k|    f->frame_thread.next_tile_row[pass & 1] = 0;
  249|       |
  250|   324k|    Dav1dTask *t = &tasks[0];
  251|   324k|    t->sby = 0;
  252|   324k|    t->recon_progress = 1;
  253|   324k|    t->deblock_progress = 0;
  254|   324k|    t->type = pass == 1 ? DAV1D_TASK_TYPE_ENTROPY_PROGRESS :
  ------------------
  |  Branch (254:15): [True: 162k, False: 162k]
  ------------------
  255|   324k|              has_deblock ? DAV1D_TASK_TYPE_DEBLOCK_COLS :
  ------------------
  |  Branch (255:15): [True: 55.3k, False: 106k]
  ------------------
  256|   162k|              has_cdef || has_lr /* i.e. LR backup */ ? DAV1D_TASK_TYPE_DEBLOCK_ROWS :
  ------------------
  |  Branch (256:15): [True: 2.60k, False: 104k]
  |  Branch (256:27): [True: 2.81k, False: 101k]
  ------------------
  257|   106k|              has_resize ? DAV1D_TASK_TYPE_SUPER_RESOLUTION :
  ------------------
  |  Branch (257:15): [True: 5.58k, False: 95.3k]
  ------------------
  258|   100k|              DAV1D_TASK_TYPE_RECONSTRUCTION_PROGRESS;
  259|   324k|    t->frame_idx = (int)(f - f->c->fc);
  260|       |
  261|   324k|    *res_t = t;
  262|   324k|    return 0;
  263|   324k|}
thread_task.c:add_pending:
  180|  11.2M|{
  181|  11.2M|    uintptr_t head = atomic_load_explicit(&f->task_thread.pending_tasks,
  182|  11.2M|                                          memory_order_relaxed);
  183|  11.2M|    do {
  184|  11.2M|        last->next = (Dav1dTask *) head;
  185|  11.2M|    } while (!atomic_compare_exchange_weak_explicit(&f->task_thread.pending_tasks,
  ------------------
  |  Branch (185:14): [True: 33.0k, False: 11.2M]
  ------------------
  186|  11.2M|                                                    &head, (uintptr_t) first,
  187|  11.2M|                                                    memory_order_release,
  188|  11.2M|                                                    memory_order_relaxed));
  189|  11.2M|}
thread_task.c:insert_task:
  174|  33.2M|{
  175|  33.2M|    insert_tasks(f, t, t, cond_signal);
  176|  33.2M|}
thread_task.c:insert_tasks:
  120|  33.2M|{
  121|       |    // insert task back into task queue
  122|  33.2M|    Dav1dTask *t_ptr, *prev_t = NULL;
  123|  33.2M|    for (t_ptr = f->task_thread.task_head;
  124|   101M|         t_ptr; prev_t = t_ptr, t_ptr = t_ptr->next)
  ------------------
  |  Branch (124:10): [True: 72.4M, False: 28.9M]
  ------------------
  125|  72.4M|    {
  126|       |        // entropy coding precedes other steps
  127|  72.4M|        if (t_ptr->type == DAV1D_TASK_TYPE_TILE_ENTROPY) {
  ------------------
  |  Branch (127:13): [True: 1.33M, False: 71.0M]
  ------------------
  128|  1.33M|            if (first->type > DAV1D_TASK_TYPE_TILE_ENTROPY) continue;
  ------------------
  |  Branch (128:17): [True: 1.07M, False: 262k]
  ------------------
  129|       |            // both are entropy
  130|   262k|            if (first->sby > t_ptr->sby) continue;
  ------------------
  |  Branch (130:17): [True: 226k, False: 36.6k]
  ------------------
  131|  36.6k|            if (first->sby < t_ptr->sby) {
  ------------------
  |  Branch (131:17): [True: 653, False: 35.9k]
  ------------------
  132|    653|                insert_tasks_between(f, first, last, prev_t, t_ptr, cond_signal);
  133|    653|                return;
  134|    653|            }
  135|       |            // same sby
  136|  71.0M|        } else {
  137|  71.0M|            if (first->type == DAV1D_TASK_TYPE_TILE_ENTROPY) {
  ------------------
  |  Branch (137:17): [True: 25.0k, False: 71.0M]
  ------------------
  138|  25.0k|                insert_tasks_between(f, first, last, prev_t, t_ptr, cond_signal);
  139|  25.0k|                return;
  140|  25.0k|            }
  141|  71.0M|            if (first->sby > t_ptr->sby) continue;
  ------------------
  |  Branch (141:17): [True: 46.5M, False: 24.4M]
  ------------------
  142|  24.4M|            if (first->sby < t_ptr->sby) {
  ------------------
  |  Branch (142:17): [True: 3.48M, False: 20.9M]
  ------------------
  143|  3.48M|                insert_tasks_between(f, first, last, prev_t, t_ptr, cond_signal);
  144|  3.48M|                return;
  145|  3.48M|            }
  146|       |            // same sby
  147|  20.9M|            if (first->type > t_ptr->type) continue;
  ------------------
  |  Branch (147:17): [True: 20.0M, False: 962k]
  ------------------
  148|   962k|            if (first->type < t_ptr->type) {
  ------------------
  |  Branch (148:17): [True: 807k, False: 155k]
  ------------------
  149|   807k|                insert_tasks_between(f, first, last, prev_t, t_ptr, cond_signal);
  150|   807k|                return;
  151|   807k|            }
  152|       |            // same task type
  153|   962k|        }
  154|       |
  155|       |        // sort by tile-id
  156|  72.4M|        assert(first->type == DAV1D_TASK_TYPE_TILE_RECONSTRUCTION ||
  ------------------
  |  Branch (156:9): [True: 155k, False: 35.9k]
  |  Branch (156:9): [True: 35.9k, False: 0]
  ------------------
  157|   191k|               first->type == DAV1D_TASK_TYPE_TILE_ENTROPY);
  158|   191k|        assert(first->type == t_ptr->type);
  ------------------
  |  Branch (158:9): [True: 191k, False: 0]
  ------------------
  159|   191k|        assert(t_ptr->sby == first->sby);
  ------------------
  |  Branch (159:9): [True: 191k, False: 0]
  ------------------
  160|   191k|        const int p = first->type == DAV1D_TASK_TYPE_TILE_ENTROPY;
  161|   191k|        const int t_tile_idx = (int) (first - f->task_thread.tile_tasks[p]);
  162|   191k|        const int p_tile_idx = (int) (t_ptr - f->task_thread.tile_tasks[p]);
  163|   191k|        assert(t_tile_idx != p_tile_idx);
  ------------------
  |  Branch (163:9): [True: 191k, False: 0]
  ------------------
  164|   191k|        if (t_tile_idx > p_tile_idx) continue;
  ------------------
  |  Branch (164:13): [True: 180k, False: 10.5k]
  ------------------
  165|  10.5k|        insert_tasks_between(f, first, last, prev_t, t_ptr, cond_signal);
  166|  10.5k|        return;
  167|   191k|    }
  168|       |    // append at the end
  169|  28.9M|    insert_tasks_between(f, first, last, prev_t, NULL, cond_signal);
  170|  28.9M|}
thread_task.c:insert_tasks_between:
  104|  33.2M|{
  105|  33.2M|    struct TaskThreadData *const ttd = f->task_thread.ttd;
  106|  33.2M|    if (atomic_load_explicit(f->c->flush, memory_order_relaxed)) return;
  ------------------
  |  Branch (106:9): [True: 54, False: 33.2M]
  ------------------
  107|  33.2M|    assert(!a || a->next == b);
  ------------------
  |  Branch (107:5): [True: 2.58M, False: 30.6M]
  |  Branch (107:5): [True: 30.6M, False: 0]
  ------------------
  108|  33.2M|    if (!a) f->task_thread.task_head = first;
  ------------------
  |  Branch (108:9): [True: 2.58M, False: 30.6M]
  ------------------
  109|  30.6M|    else a->next = first;
  110|  33.2M|    if (!b) f->task_thread.task_tail = last;
  ------------------
  |  Branch (110:9): [True: 28.9M, False: 4.32M]
  ------------------
  111|  33.2M|    last->next = b;
  112|  33.2M|    reset_task_cur(f->c, ttd, first->frame_idx);
  113|  33.2M|    if (cond_signal && !atomic_fetch_or_explicit(&ttd->cond_signaled, 1, memory_order_relaxed))
  ------------------
  |  Branch (113:9): [True: 216k, False: 33.0M]
  |  Branch (113:24): [True: 89.9k, False: 126k]
  ------------------
  114|  89.9k|        pthread_cond_signal(&ttd->cond);
  115|  33.2M|}
thread_task.c:merge_pending:
  203|  37.6M|static inline int merge_pending(const Dav1dContext *const c) {
  204|  37.6M|    int res = 0;
  205|   188M|    for (unsigned i = 0; i < c->n_fc; i++)
  ------------------
  |  Branch (205:26): [True: 150M, False: 37.6M]
  ------------------
  206|   150M|        res |= merge_pending_frame(&c->fc[i]);
  207|  37.6M|    return res;
  208|  37.6M|}
thread_task.c:merge_pending_frame:
  191|   192M|static inline int merge_pending_frame(Dav1dFrameContext *const f) {
  192|   192M|    if (!atomic_load_explicit(&f->task_thread.pending_tasks, memory_order_relaxed)) return 0;
  ------------------
  |  Branch (192:9): [True: 181M, False: 11.2M]
  ------------------
  193|  11.2M|    Dav1dTask *t = (Dav1dTask *) atomic_exchange_explicit(&f->task_thread.pending_tasks, 0,
  194|  11.2M|                                                          memory_order_acquire);
  195|  23.0M|    while (t) {
  ------------------
  |  Branch (195:12): [True: 11.8M, False: 11.2M]
  ------------------
  196|  11.8M|        Dav1dTask *const tmp = t->next;
  197|  11.8M|        insert_task(f, t, 0);
  198|  11.8M|        t = tmp;
  199|  11.8M|    }
  200|  11.2M|    return 1;
  201|   192M|}
thread_task.c:delayed_fg_task:
  622|  7.93k|{
  623|  7.93k|    const Dav1dPicture *const in = ttd->delayed_fg.in;
  624|  7.93k|    Dav1dPicture *const out = ttd->delayed_fg.out;
  625|  7.93k|#if CONFIG_16BPC
  626|  7.93k|    int off;
  627|  7.93k|    if (out->p.bpc != 8)
  ------------------
  |  Branch (627:9): [True: 4.27k, False: 3.65k]
  ------------------
  628|  4.27k|        off = (out->p.bpc >> 1) - 4;
  629|  7.93k|#endif
  630|  7.93k|    switch (ttd->delayed_fg.type) {
  631|  4.01k|    case DAV1D_TASK_TYPE_FG_PREP:
  ------------------
  |  Branch (631:5): [True: 4.01k, False: 3.92k]
  ------------------
  632|  4.01k|        ttd->delayed_fg.exec = 0;
  633|  4.01k|        unlock_and_signal(c, ttd);
  634|  4.01k|        switch (out->p.bpc) {
  635|      0|#if CONFIG_8BPC
  636|  1.72k|        case 8:
  ------------------
  |  Branch (636:9): [True: 1.72k, False: 2.29k]
  ------------------
  637|  1.72k|            dav1d_prep_grain_8bpc(&c->dsp[0].fg, out, in,
  638|  1.72k|                                  ttd->delayed_fg.scaling_8bpc,
  639|  1.72k|                                  ttd->delayed_fg.grain_lut_8bpc);
  640|  1.72k|            break;
  641|      0|#endif
  642|      0|#if CONFIG_16BPC
  643|  1.69k|        case 10:
  ------------------
  |  Branch (643:9): [True: 1.69k, False: 2.31k]
  ------------------
  644|  2.29k|        case 12:
  ------------------
  |  Branch (644:9): [True: 595, False: 3.41k]
  ------------------
  645|  2.29k|            dav1d_prep_grain_16bpc(&c->dsp[off].fg, out, in,
  646|  2.29k|                                   ttd->delayed_fg.scaling_16bpc,
  647|  2.29k|                                   ttd->delayed_fg.grain_lut_16bpc);
  648|  2.29k|            break;
  649|      0|#endif
  650|      0|        default: abort();
  ------------------
  |  Branch (650:9): [True: 0, False: 4.01k]
  ------------------
  651|  4.01k|        }
  652|  4.01k|        ttd->delayed_fg.type = DAV1D_TASK_TYPE_FG_APPLY;
  653|  4.01k|        pthread_mutex_lock(&ttd->lock);
  654|  4.01k|        ttd->delayed_fg.exec = 1;
  655|       |        // fall-through
  656|  7.93k|    case DAV1D_TASK_TYPE_FG_APPLY:;
  ------------------
  |  Branch (656:5): [True: 3.92k, False: 4.01k]
  ------------------
  657|  7.93k|        int row = atomic_fetch_add_explicit(&ttd->delayed_fg.progress[0], 1, memory_order_relaxed);
  658|  7.93k|        pthread_mutex_unlock(&ttd->lock);
  659|  7.93k|        int progmax = (out->p.h + FG_BLOCK_SIZE - 1) / FG_BLOCK_SIZE;
  ------------------
  |  |   37|  7.93k|#define FG_BLOCK_SIZE 32
  ------------------
                      int progmax = (out->p.h + FG_BLOCK_SIZE - 1) / FG_BLOCK_SIZE;
  ------------------
  |  |   37|  7.93k|#define FG_BLOCK_SIZE 32
  ------------------
  660|  31.3k|        while (row < progmax) {
  ------------------
  |  Branch (660:16): [True: 23.3k, False: 8.01k]
  ------------------
  661|  23.3k|            if (row + 1 < progmax)
  ------------------
  |  Branch (661:17): [True: 19.3k, False: 3.99k]
  ------------------
  662|  19.3k|                pthread_cond_signal(&ttd->cond);
  663|  3.99k|            else {
  664|  3.99k|                pthread_mutex_lock(&ttd->lock);
  665|  3.99k|                ttd->delayed_fg.exec = 0;
  666|  3.99k|                pthread_mutex_unlock(&ttd->lock);
  667|  3.99k|            }
  668|  23.3k|            switch (out->p.bpc) {
  669|      0|#if CONFIG_8BPC
  670|  13.4k|            case 8:
  ------------------
  |  Branch (670:13): [True: 13.4k, False: 9.86k]
  ------------------
  671|  13.4k|                dav1d_apply_grain_row_8bpc(&c->dsp[0].fg, out, in,
  672|  13.4k|                                           ttd->delayed_fg.scaling_8bpc,
  673|  13.4k|                                           ttd->delayed_fg.grain_lut_8bpc, row);
  674|  13.4k|                break;
  675|      0|#endif
  676|      0|#if CONFIG_16BPC
  677|  8.21k|            case 10:
  ------------------
  |  Branch (677:13): [True: 8.21k, False: 15.1k]
  ------------------
  678|  9.86k|            case 12:
  ------------------
  |  Branch (678:13): [True: 1.64k, False: 21.6k]
  ------------------
  679|  9.86k|                dav1d_apply_grain_row_16bpc(&c->dsp[off].fg, out, in,
  680|  9.86k|                                            ttd->delayed_fg.scaling_16bpc,
  681|  9.86k|                                            ttd->delayed_fg.grain_lut_16bpc, row);
  682|  9.86k|                break;
  683|      0|#endif
  684|      0|            default: abort();
  ------------------
  |  Branch (684:13): [True: 0, False: 23.3k]
  ------------------
  685|  23.3k|            }
  686|  23.4k|            row = atomic_fetch_add_explicit(&ttd->delayed_fg.progress[0], 1, memory_order_relaxed);
  687|  23.4k|            atomic_fetch_add_explicit(&ttd->delayed_fg.progress[1], 1, memory_order_release);
  688|  23.4k|        }
  689|  8.01k|        pthread_mutex_lock(&ttd->lock);
  690|  8.01k|        ttd->delayed_fg.exec = 0;
  691|  8.01k|        int done = atomic_fetch_add_explicit(&ttd->delayed_fg.progress[1], 1,
  692|  8.01k|                                             memory_order_acquire) + 1;
  693|  8.01k|        progmax = atomic_load_explicit(&ttd->delayed_fg.progress[0], memory_order_relaxed);
  694|       |        // signal for completion only once the last runner reaches this
  695|  8.01k|        if (done >= progmax) {
  ------------------
  |  Branch (695:13): [True: 4.01k, False: 3.99k]
  ------------------
  696|  4.01k|            ttd->delayed_fg.finished = 1;
  697|  4.01k|            pthread_cond_signal(&ttd->delayed_fg.cond);
  698|  4.01k|        }
  699|  8.01k|        break;
  700|      0|    default: abort();
  ------------------
  |  Branch (700:5): [True: 0, False: 7.93k]
  ------------------
  701|  7.93k|    }
  702|  7.93k|}
thread_task.c:find_init_task:
  458|  36.5M|{
  459|  36.5M|    const unsigned first = atomic_load_explicit(&ttd->first, memory_order_relaxed);
  460|   182M|    for (unsigned i = 0; i < c->n_fc; i++) {
  ------------------
  |  Branch (460:26): [True: 145M, False: 36.2M]
  ------------------
  461|   145M|        Dav1dFrameContext *const f = &c->fc[(first + i) % c->n_fc];
  462|   145M|        if (atomic_load_explicit(&f->task_thread.init_done, memory_order_relaxed)) continue;
  ------------------
  |  Branch (462:13): [True: 133M, False: 12.6M]
  ------------------
  463|  12.6M|        Dav1dTask *const t = f->task_thread.task_head;
  464|  12.6M|        if (!t) continue;
  ------------------
  |  Branch (464:13): [True: 10.2M, False: 2.31M]
  ------------------
  465|  2.31M|        if (t->type == DAV1D_TASK_TYPE_INIT) {
  ------------------
  |  Branch (465:13): [True: 257k, False: 2.05M]
  ------------------
  466|   257k|            *res_f = f;
  467|   257k|            return t;
  468|   257k|        }
  469|  2.31M|        assert(t->type == DAV1D_TASK_TYPE_INIT_CDF);
  ------------------
  |  Branch (469:9): [True: 2.05M, False: 0]
  ------------------
  470|  2.05M|        const int p1 = f->in_cdf.progress ?
  ------------------
  |  Branch (470:24): [True: 2.05M, False: 0]
  ------------------
  471|  2.05M|            atomic_load_explicit(f->in_cdf.progress, memory_order_acquire) : 1;
  472|  2.05M|        if (p1) {
  ------------------
  |  Branch (472:13): [True: 14.9k, False: 2.04M]
  ------------------
  473|  14.9k|            if (p1 == TILE_ERROR)
  ------------------
  |  |   36|  14.9k|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (473:17): [True: 6.90k, False: 8.03k]
  ------------------
  474|  14.9k|                atomic_fetch_or_explicit(&f->task_thread.error, 1, memory_order_relaxed);
  475|  14.9k|            *res_f = f;
  476|  14.9k|            return t;
  477|  14.9k|        }
  478|  2.05M|    }
  479|  36.2M|    return NULL;
  480|  36.5M|}
thread_task.c:find_task:
  537|  36.2M|{
  538|  36.2M|    const unsigned first = atomic_load_explicit(&ttd->first, memory_order_relaxed);
  539|  44.1M|    while (ttd->cur < c->n_fc) {
  ------------------
  |  Branch (539:12): [True: 41.9M, False: 2.15M]
  ------------------
  540|  41.9M|        Dav1dFrameContext *const f = &c->fc[(first + ttd->cur) % c->n_fc];
  541|  41.9M|        merge_pending_frame(f);
  542|  41.9M|        Dav1dTask *prev_t = f->task_thread.task_cur_prev;
  543|  41.9M|        for (Dav1dTask *t = prev_t ? prev_t->next : f->task_thread.task_head;
  ------------------
  |  Branch (543:29): [True: 137k, False: 41.8M]
  ------------------
  544|  53.9M|             t; prev_t = t, t = t->next)
  ------------------
  |  Branch (544:14): [True: 46.0M, False: 7.91M]
  ------------------
  545|  46.0M|        {
  546|  46.0M|            if (task_ready(c, f, t)) {
  ------------------
  |  Branch (546:17): [True: 34.0M, False: 11.9M]
  ------------------
  547|  34.0M|                *res_f = f;
  548|  34.0M|                *res_prev_t = prev_t;
  549|  34.0M|                return t;
  550|  34.0M|            }
  551|  11.9M|            f->task_thread.task_cur_prev = t;
  552|  11.9M|        }
  553|  7.91M|        ttd->cur++;
  554|  7.91M|    }
  555|  2.15M|    return NULL;
  556|  36.2M|}
thread_task.c:task_ready:
  485|  46.0M|{
  486|  46.0M|    if (t->type == DAV1D_TASK_TYPE_INIT_CDF) return 0;
  ------------------
  |  Branch (486:9): [True: 87.9k, False: 45.9M]
  ------------------
  487|  45.9M|    if (t->type == DAV1D_TASK_TYPE_TILE_ENTROPY ||
  ------------------
  |  Branch (487:9): [True: 266k, False: 45.6M]
  ------------------
  488|  45.6M|        t->type == DAV1D_TASK_TYPE_TILE_RECONSTRUCTION)
  ------------------
  |  Branch (488:9): [True: 13.0M, False: 32.5M]
  ------------------
  489|  13.3M|    {
  490|       |        // if not bottom sbrow of tile, this task will be re-added
  491|       |        // after it's finished
  492|  13.3M|        return !check_tile(t, f, c->n_fc > 1);
  493|  13.3M|    }
  494|  32.5M|    if (t->recon_progress) {
  ------------------
  |  Branch (494:9): [True: 31.8M, False: 711k]
  ------------------
  495|  31.8M|        const int p = t->type == DAV1D_TASK_TYPE_ENTROPY_PROGRESS;
  496|  31.8M|        int error = atomic_load_explicit(&f->task_thread.error, memory_order_relaxed);
  497|  31.8M|        assert(!f->task_thread.done[p] || error);
  ------------------
  |  Branch (497:9): [True: 25.3M, False: 6.56M]
  |  Branch (497:9): [True: 6.56M, False: 0]
  ------------------
  498|  31.8M|        const int tile_row_base = f->frame_hdr->tiling.cols *
  499|  31.8M|                                  f->frame_thread.next_tile_row[p];
  500|  31.8M|        if (p) {
  ------------------
  |  Branch (500:13): [True: 11.3M, False: 20.5M]
  ------------------
  501|  11.3M|            atomic_int *const prog = &f->frame_thread.entropy_progress;
  502|  11.3M|            const int p1 = atomic_load_explicit(prog, memory_order_acquire);
  503|  11.3M|            if (p1 < t->sby) return 0;
  ------------------
  |  Branch (503:17): [True: 61.7k, False: 11.3M]
  ------------------
  504|  11.3M|            if (p1 == TILE_ERROR)
  ------------------
  |  |   36|  11.3M|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (504:17): [True: 6.60M, False: 4.70M]
  ------------------
  505|  11.3M|                atomic_fetch_or_explicit(&f->task_thread.error, 1, memory_order_relaxed);
  506|  11.3M|        }
  507|  55.0M|        for (int tc = 0; tc < f->frame_hdr->tiling.cols; tc++) {
  ------------------
  |  Branch (507:26): [True: 33.3M, False: 21.6M]
  ------------------
  508|  33.3M|            Dav1dTileState *const ts = &f->ts[tile_row_base + tc];
  509|  33.3M|            const int p2 = atomic_load_explicit(&ts->progress[p], memory_order_acquire);
  510|  33.3M|            if (p2 < t->recon_progress) return 0;
  ------------------
  |  Branch (510:17): [True: 10.1M, False: 23.1M]
  ------------------
  511|  23.1M|            if (p2 == TILE_ERROR)
  ------------------
  |  |   36|  23.1M|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (511:17): [True: 13.4M, False: 9.70M]
  ------------------
  512|  23.1M|                atomic_fetch_or_explicit(&f->task_thread.error, 1, memory_order_relaxed);
  513|  23.1M|        }
  514|  21.6M|        return 1;
  515|  31.8M|    }
  516|   711k|    if (t->type == DAV1D_TASK_TYPE_CDEF) {
  ------------------
  |  Branch (516:9): [True: 11.5k, False: 700k]
  ------------------
  517|  11.5k|        atomic_uint *prog = f->frame_thread.copy_lpf_progress;
  518|  11.5k|        const int p1 = atomic_load_explicit(&prog[(t->sby - 1) >> 5], memory_order_acquire);
  519|  11.5k|        return !!(p1 & (1U << ((t->sby - 1) & 31)));
  520|  11.5k|    }
  521|   711k|    assert(t->deblock_progress);
  ------------------
  |  Branch (521:5): [True: 700k, False: 0]
  ------------------
  522|   700k|    const int p1 = atomic_load_explicit(&f->frame_thread.deblock_progress, memory_order_acquire);
  523|   700k|    if (p1 >= t->deblock_progress) {
  ------------------
  |  Branch (523:9): [True: 75.8k, False: 624k]
  ------------------
  524|  75.8k|        if (p1 == TILE_ERROR)
  ------------------
  |  |   36|  75.8k|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (524:13): [True: 390, False: 75.4k]
  ------------------
  525|  75.8k|            atomic_fetch_or_explicit(&f->task_thread.error, 1, memory_order_relaxed);
  526|  75.8k|        return 1;
  527|  75.8k|    }
  528|   624k|    return 0;
  529|   700k|}
thread_task.c:reset_task_cur:
   50|  59.6M|{
   51|  59.6M|    const unsigned first = atomic_load_explicit(&ttd->first, memory_order_relaxed);
   52|  59.6M|    unsigned reset_frame_idx = atomic_exchange_explicit(&ttd->reset_task_cur, UINT_MAX,
   53|  59.6M|                                                        memory_order_acquire);
   54|  59.6M|    if (reset_frame_idx < first) {
  ------------------
  |  Branch (54:9): [True: 0, False: 59.6M]
  ------------------
   55|      0|        if (frame_idx == UINT_MAX) return 0;
  ------------------
  |  Branch (55:13): [True: 0, False: 0]
  ------------------
   56|      0|        reset_frame_idx = UINT_MAX;
   57|      0|    }
   58|  59.6M|    if (!ttd->cur && c->fc[first].task_thread.task_cur_prev == NULL)
  ------------------
  |  Branch (58:9): [True: 37.6M, False: 22.0M]
  |  Branch (58:22): [True: 36.4M, False: 1.17M]
  ------------------
   59|  36.4M|        return 0;
   60|  23.2M|    if (reset_frame_idx != UINT_MAX) {
  ------------------
  |  Branch (60:9): [True: 3.58M, False: 19.6M]
  ------------------
   61|  3.58M|        if (frame_idx == UINT_MAX) {
  ------------------
  |  Branch (61:13): [True: 460k, False: 3.12M]
  ------------------
   62|   460k|            if (reset_frame_idx > first + ttd->cur)
  ------------------
  |  Branch (62:17): [True: 11.2k, False: 449k]
  ------------------
   63|  11.2k|                return 0;
   64|   449k|            ttd->cur = reset_frame_idx - first;
   65|   449k|            goto cur_found;
   66|   460k|        }
   67|  19.6M|    } else if (frame_idx == UINT_MAX)
  ------------------
  |  Branch (67:16): [True: 2.72M, False: 16.9M]
  ------------------
   68|  2.72M|        return 0;
   69|  20.0M|    if (frame_idx < first) frame_idx += c->n_fc;
  ------------------
  |  Branch (69:9): [True: 7.25M, False: 12.7M]
  ------------------
   70|  20.0M|    const unsigned min_frame_idx = umin(reset_frame_idx, frame_idx);
   71|  20.0M|    const unsigned cur_frame_idx = first + ttd->cur;
   72|  20.0M|    if (ttd->cur < c->n_fc && cur_frame_idx < min_frame_idx)
  ------------------
  |  Branch (72:9): [True: 18.3M, False: 1.72M]
  |  Branch (72:31): [True: 874k, False: 17.4M]
  ------------------
   73|   874k|        return 0;
   74|  19.5M|    for (ttd->cur = min_frame_idx - first; ttd->cur < c->n_fc; ttd->cur++)
  ------------------
  |  Branch (74:44): [True: 19.5M, False: 71.8k]
  ------------------
   75|  19.5M|        if (c->fc[(first + ttd->cur) % c->n_fc].task_thread.task_head)
  ------------------
  |  Branch (75:13): [True: 19.0M, False: 413k]
  ------------------
   76|  19.0M|            break;
   77|  19.6M|cur_found:
   78|  69.5M|    for (unsigned i = ttd->cur; i < c->n_fc; i++)
  ------------------
  |  Branch (78:33): [True: 49.9M, False: 19.6M]
  ------------------
   79|  49.9M|        c->fc[(first + i) % c->n_fc].task_thread.task_cur_prev = NULL;
   80|  19.6M|    return 1;
   81|  19.1M|}
thread_task.c:unlock_and_signal:
  572|  33.5M|{
  573|  33.5M|    const int signal = !atomic_load_explicit(&ttd->cond_signaled, memory_order_relaxed) &&
  ------------------
  |  Branch (573:24): [True: 1.99M, False: 31.5M]
  ------------------
  574|  1.99M|                       has_ready_task(c, ttd);
  ------------------
  |  Branch (574:24): [True: 1.07M, False: 917k]
  ------------------
  575|  33.5M|    if (signal) atomic_store_explicit(&ttd->cond_signaled, 1, memory_order_relaxed);
  ------------------
  |  Branch (575:9): [True: 1.07M, False: 32.4M]
  ------------------
  576|  33.5M|    pthread_mutex_unlock(&ttd->lock);
  577|  33.5M|    if (signal) pthread_cond_signal(&ttd->cond);
  ------------------
  |  Branch (577:9): [True: 1.07M, False: 32.4M]
  ------------------
  578|  33.5M|}
thread_task.c:has_ready_task:
  560|  1.99M|{
  561|  1.99M|    if (ttd->delayed_fg.exec) return 1;
  ------------------
  |  Branch (561:9): [True: 67, False: 1.99M]
  ------------------
  562|  1.99M|    Dav1dFrameContext *f;
  563|  1.99M|    Dav1dTask *prev_t;
  564|  1.99M|    if (c->n_fc > 1 && find_init_task(c, ttd, &f)) return 1;
  ------------------
  |  Branch (564:9): [True: 1.99M, False: 0]
  |  Branch (564:24): [True: 42.4k, False: 1.95M]
  ------------------
  565|  1.95M|    merge_pending(c);
  566|       |    reset_task_cur(c, ttd, UINT_MAX);
  567|  1.95M|    return !!find_task(c, ttd, &f, &prev_t);
  568|  1.99M|}
thread_task.c:abort_frame:
  609|  52.7k|static inline void abort_frame(Dav1dFrameContext *const f, const int error) {
  610|  52.7k|    atomic_store_explicit(&f->task_thread.error, error == DAV1D_ERR(EINVAL) ? 1 : -1,
  ------------------
  |  |   58|  52.7k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (610:50): [True: 52.7k, False: 0]
  ------------------
  611|  52.7k|                          memory_order_relaxed);
  612|  52.7k|    f->task_thread.task_counter = 0;
  613|  52.7k|    f->task_thread.done[0] = 1;
  614|  52.7k|    f->task_thread.done[1] = 1;
  615|  52.7k|    atomic_store_explicit(&f->sr_cur.progress[0], FRAME_ERROR, memory_order_relaxed);
  ------------------
  |  |   35|  52.7k|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  616|  52.7k|    atomic_store_explicit(&f->sr_cur.progress[1], FRAME_ERROR, memory_order_relaxed);
  ------------------
  |  |   35|  52.7k|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  617|  52.7k|    finish_frame(f, error);
  618|  52.7k|}
thread_task.c:finish_frame:
  593|   214k|static inline void finish_frame(Dav1dFrameContext *const f, const int res) {
  594|   214k|    dav1d_decode_frame_exit(f, res);
  595|   214k|    f->n_tile_data = 0;
  596|   214k|    pthread_cond_signal(&f->task_thread.cond);
  597|   214k|}
thread_task.c:check_tile:
  385|  23.8M|{
  386|  23.8M|    const int tp = t->type == DAV1D_TASK_TYPE_TILE_ENTROPY;
  387|  23.8M|    const int tile_idx = (int)(t - f->task_thread.tile_tasks[tp]);
  388|  23.8M|    Dav1dTileState *const ts = &f->ts[tile_idx];
  389|  23.8M|    const int p1 = atomic_load_explicit(&ts->progress[tp], memory_order_relaxed);
  390|  23.8M|    if (p1 < t->sby) return 1;
  ------------------
  |  Branch (390:9): [True: 0, False: 23.8M]
  ------------------
  391|  23.8M|    if (p1 == TILE_ERROR)
  ------------------
  |  |   36|  23.8M|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (391:9): [True: 12.8M, False: 11.0M]
  ------------------
  392|  23.8M|        atomic_fetch_or_explicit(&f->task_thread.error, 1, memory_order_relaxed);
  393|  23.8M|    int error = atomic_load_explicit(&f->task_thread.error, memory_order_relaxed);
  394|  23.8M|    if (!error && frame_mt && !tp) {
  ------------------
  |  Branch (394:9): [True: 10.9M, False: 12.9M]
  |  Branch (394:19): [True: 10.9M, False: 18.4E]
  |  Branch (394:31): [True: 6.30M, False: 4.59M]
  ------------------
  395|  6.30M|        const int p2 = atomic_load_explicit(&ts->progress[1], memory_order_acquire);
  396|  6.30M|        if (p2 <= t->sby) return 1;
  ------------------
  |  Branch (396:13): [True: 232k, False: 6.07M]
  ------------------
  397|  6.07M|        if (p2 == TILE_ERROR)
  ------------------
  |  |   36|  6.07M|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (397:13): [True: 1, False: 6.07M]
  ------------------
  398|  6.07M|            atomic_fetch_or_explicit(&f->task_thread.error, 1, memory_order_relaxed);
  399|  6.07M|        error = atomic_load_explicit(&f->task_thread.error, memory_order_relaxed);
  400|  6.07M|    }
  401|  23.6M|    if (!error && frame_mt && !IS_KEY_OR_INTRA(f->frame_hdr)) {
  ------------------
  |  |   43|  10.6M|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  10.6M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  ------------------
  |  Branch (401:9): [True: 10.6M, False: 12.9M]
  |  Branch (401:19): [True: 10.6M, False: 18.4E]
  |  Branch (401:31): [True: 9.77M, False: 899k]
  ------------------
  402|       |        // check reference state
  403|  9.77M|        const Dav1dThreadPicture *p = &f->sr_cur;
  404|  9.77M|        const int ss_ver = p->p.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  405|  9.77M|        const unsigned p_b = (t->sby + 1) << (f->sb_shift + 2);
  406|  9.77M|        const int tile_sby = t->sby - (ts->tiling.row_start >> f->sb_shift);
  407|  9.77M|        const int (*const lowest_px)[2] = ts->lowest_pixel[tile_sby];
  408|  66.8M|        for (int n = t->deps_skip; n < 7; n++, t->deps_skip++) {
  ------------------
  |  Branch (408:36): [True: 57.8M, False: 9.00M]
  ------------------
  409|  57.8M|            unsigned lowest;
  410|  57.8M|            if (tp) {
  ------------------
  |  Branch (410:17): [True: 29.1M, False: 28.6M]
  ------------------
  411|       |                // if temporal mv refs are disabled, we only need this
  412|       |                // for the primary ref; if segmentation is disabled, we
  413|       |                // don't even need that
  414|  29.1M|                lowest = p_b;
  415|  29.1M|            } else {
  416|       |                // +8 is postfilter-induced delay
  417|  28.6M|                const int y = lowest_px[n][0] == INT_MIN ? INT_MIN :
  ------------------
  |  Branch (417:31): [True: 24.7M, False: 3.97M]
  ------------------
  418|  28.6M|                              lowest_px[n][0] + 8;
  419|  28.6M|                const int uv = lowest_px[n][1] == INT_MIN ? INT_MIN :
  ------------------
  |  Branch (419:32): [True: 29.3M, False: 18.4E]
  ------------------
  420|  18.4E|                               lowest_px[n][1] * (1 << ss_ver) + 8;
  421|  28.6M|                const int max = imax(y, uv);
  422|  28.6M|                if (max == INT_MIN) continue;
  ------------------
  |  Branch (422:21): [True: 24.7M, False: 3.97M]
  ------------------
  423|  3.97M|                lowest = iclip(max, 1, f->refp[n].p.p.h);
  424|  3.97M|            }
  425|  33.1M|            const unsigned p3 = atomic_load_explicit(&f->refp[n].progress[!tp],
  426|  33.1M|                                                     memory_order_acquire);
  427|  33.1M|            if (p3 < lowest) return 1;
  ------------------
  |  Branch (427:17): [True: 772k, False: 32.3M]
  ------------------
  428|  32.3M|            if (p3 == FRAME_ERROR)
  ------------------
  |  |   35|  32.3M|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  |  Branch (428:17): [True: 120k, False: 32.2M]
  ------------------
  429|  32.3M|                atomic_fetch_or_explicit(&f->task_thread.error, 1, memory_order_relaxed);
  430|  32.3M|        }
  431|  9.77M|    }
  432|  22.8M|    return 0;
  433|  23.6M|}
thread_task.c:reset_task_cur_async:
   85|  15.2M|{
   86|  15.2M|    const unsigned first = atomic_load_explicit(&ttd->first, memory_order_relaxed);
   87|  15.2M|    if (frame_idx < first) frame_idx += n_frames;
  ------------------
  |  Branch (87:9): [True: 5.65M, False: 9.61M]
  ------------------
   88|  15.2M|    unsigned last_idx = frame_idx;
   89|  19.1M|    do {
   90|  19.1M|        frame_idx = last_idx;
   91|  19.1M|        last_idx = atomic_exchange_explicit(&ttd->reset_task_cur, frame_idx, memory_order_release);
   92|  19.1M|    } while (last_idx < frame_idx);
  ------------------
  |  Branch (92:14): [True: 3.82M, False: 15.2M]
  ------------------
   93|  15.2M|    if (frame_idx == first && atomic_load_explicit(&ttd->first, memory_order_relaxed) != first) {
  ------------------
  |  Branch (93:9): [True: 3.43M, False: 11.8M]
  |  Branch (93:31): [True: 0, False: 3.43M]
  ------------------
   94|      0|        unsigned expected = frame_idx;
   95|      0|        atomic_compare_exchange_strong_explicit(&ttd->reset_task_cur, &expected, UINT_MAX,
   96|      0|                                                memory_order_relaxed, memory_order_relaxed);
   97|      0|    }
   98|  15.2M|}
thread_task.c:signal_if_ready:
  585|  15.5M|{
  586|  15.5M|    if (atomic_load_explicit(&ttd->cond_signaled, memory_order_relaxed)) return;
  ------------------
  |  Branch (586:9): [True: 15.1M, False: 379k]
  ------------------
  587|   379k|    if (!pthread_mutex_trylock(&ttd->lock))
  ------------------
  |  Branch (587:9): [True: 242k, False: 137k]
  ------------------
  588|   242k|        unlock_and_signal(c, ttd);
  589|   137k|    else if (!atomic_fetch_or_explicit(&ttd->cond_signaled, 1, memory_order_relaxed))
  ------------------
  |  Branch (589:14): [True: 251k, False: 18.4E]
  ------------------
  590|   251k|        pthread_cond_signal(&ttd->cond);
  591|   379k|}
thread_task.c:complete_task:
  599|  21.9M|static inline void complete_task(Dav1dFrameContext *const f) {
  600|  21.9M|    if (--f->task_thread.task_counter || !f->task_thread.done[0] ||
  ------------------
  |  Branch (600:9): [True: 21.7M, False: 161k]
  |  Branch (600:42): [True: 0, False: 161k]
  ------------------
  601|   161k|        (f->c->n_fc > 1 && !f->task_thread.done[1]))
  ------------------
  |  Branch (601:10): [True: 161k, False: 0]
  |  Branch (601:28): [True: 0, False: 161k]
  ------------------
  602|  21.7M|    {
  603|  21.7M|        return;
  604|  21.7M|    }
  605|   161k|    const int error = atomic_load_explicit(&f->task_thread.error, memory_order_relaxed);
  606|   161k|    finish_frame(f, error == 1 ? DAV1D_ERR(EINVAL) : error ? DAV1D_ERR(ENOMEM) : 0);
  ------------------
  |  |   58|   102k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
                  finish_frame(f, error == 1 ? DAV1D_ERR(EINVAL) : error ? DAV1D_ERR(ENOMEM) : 0);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (606:21): [True: 102k, False: 58.6k]
  |  Branch (606:54): [True: 0, False: 58.6k]
  ------------------
  607|   161k|}
thread_task.c:ensure_progress:
  368|  4.72M|{
  369|       |    // deblock_rows (non-LR portion) depends on deblock of previous sbrow,
  370|       |    // so ensure that completed. if not, re-add to task-queue; else, fall-through
  371|  4.72M|    int p1 = atomic_load_explicit(state, memory_order_acquire);
  372|  4.72M|    if (p1 < t->sby) {
  ------------------
  |  Branch (372:9): [True: 72.8k, False: 4.65M]
  ------------------
  373|  72.8k|        t->type = type;
  374|  72.8k|        t->recon_progress = t->deblock_progress = 0;
  375|  72.8k|        *target = t->sby;
  376|  72.8k|        add_pending(f, t, t);
  377|  72.8k|        pthread_mutex_lock(&ttd->lock);
  378|  72.8k|        return 1;
  379|  72.8k|    }
  380|  4.65M|    return 0;
  381|  4.72M|}
thread_task.c:get_frame_progress:
  437|  10.7M|{
  438|  10.7M|    unsigned frame_prog = c->n_fc > 1 ?
  ------------------
  |  Branch (438:27): [True: 10.7M, False: 0]
  ------------------
  439|  10.7M|        atomic_load_explicit(&f->sr_cur.progress[1], memory_order_relaxed) : 0;
  440|  10.7M|    if (frame_prog >= FRAME_ERROR)
  ------------------
  |  |   35|  10.7M|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  |  Branch (440:9): [True: 6.61M, False: 4.16M]
  ------------------
  441|  6.61M|        return f->sbh - 1;
  442|  4.16M|    int idx = frame_prog >> (f->sb_shift + 7);
  443|  4.16M|    int prog;
  444|  4.27M|    do {
  445|  4.27M|        atomic_uint *state = &f->frame_thread.frame_progress[idx];
  446|  4.27M|        const unsigned val = ~atomic_load_explicit(state, memory_order_acquire);
  447|  4.27M|        prog = val ? ctz(val) : 32;
  ------------------
  |  Branch (447:16): [True: 4.15M, False: 124k]
  ------------------
  448|  4.27M|        if (prog != 32) break;
  ------------------
  |  Branch (448:13): [True: 4.15M, False: 124k]
  ------------------
  449|   124k|        prog = 0;
  450|   124k|    } while (++idx < f->frame_thread.prog_sz);
  ------------------
  |  Branch (450:14): [True: 113k, False: 11.4k]
  ------------------
  451|  4.16M|    return ((idx << 5) | prog) - 1;
  452|  10.7M|}

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

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:
   47|  5.08k|static ALWAYS_INLINE void cdef_dsp_init_x86(Dav1dCdefDSPContext *const c) {
   48|  5.08k|    const unsigned flags = dav1d_get_cpu_flags();
   49|       |
   50|  5.08k|#if BITDEPTH == 8
   51|  5.08k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE2)) return;
  ------------------
  |  Branch (51:9): [True: 0, False: 5.08k]
  ------------------
   52|       |
   53|  5.08k|    c->fb[0] = BF(dav1d_cdef_filter_8x8, sse2);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   54|  5.08k|    c->fb[1] = BF(dav1d_cdef_filter_4x8, sse2);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   55|  5.08k|    c->fb[2] = BF(dav1d_cdef_filter_4x4, sse2);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   56|  5.08k|#endif
   57|       |
   58|  5.08k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (58:9): [True: 0, False: 5.08k]
  ------------------
   59|       |
   60|  5.08k|    c->dir = BF(dav1d_cdef_dir, ssse3);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   61|  5.08k|    c->fb[0] = BF(dav1d_cdef_filter_8x8, ssse3);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   62|  5.08k|    c->fb[1] = BF(dav1d_cdef_filter_4x8, ssse3);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   63|  5.08k|    c->fb[2] = BF(dav1d_cdef_filter_4x4, ssse3);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   64|       |
   65|  5.08k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE41)) return;
  ------------------
  |  Branch (65:9): [True: 0, False: 5.08k]
  ------------------
   66|       |
   67|  5.08k|    c->dir = BF(dav1d_cdef_dir, sse4);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   68|  5.08k|#if BITDEPTH == 8
   69|  5.08k|    c->fb[0] = BF(dav1d_cdef_filter_8x8, sse4);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   70|  5.08k|    c->fb[1] = BF(dav1d_cdef_filter_4x8, sse4);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   71|  5.08k|    c->fb[2] = BF(dav1d_cdef_filter_4x4, sse4);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   72|  5.08k|#endif
   73|       |
   74|  5.08k|#if ARCH_X86_64
   75|  5.08k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (75:9): [True: 0, False: 5.08k]
  ------------------
   76|       |
   77|  5.08k|    c->dir = BF(dav1d_cdef_dir, avx2);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   78|  5.08k|    c->fb[0] = BF(dav1d_cdef_filter_8x8, avx2);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   79|  5.08k|    c->fb[1] = BF(dav1d_cdef_filter_4x8, avx2);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   80|  5.08k|    c->fb[2] = BF(dav1d_cdef_filter_4x4, avx2);
  ------------------
  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   81|       |
   82|  5.08k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (82:9): [True: 5.08k, False: 0]
  ------------------
   83|       |
   84|      0|    c->dir = BF(dav1d_cdef_dir, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   85|      0|    c->fb[0] = BF(dav1d_cdef_filter_8x8, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   86|      0|    c->fb[1] = BF(dav1d_cdef_filter_4x8, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   87|      0|    c->fb[2] = BF(dav1d_cdef_filter_4x4, avx512icl);
  ------------------
  |  |   52|      0|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   88|      0|#endif
   89|      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|  13.5k|static ALWAYS_INLINE void film_grain_dsp_init_x86(Dav1dFilmGrainDSPContext *const c) {
   46|  13.5k|    const unsigned flags = dav1d_get_cpu_flags();
   47|       |
   48|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (48:9): [True: 0, False: 13.5k]
  ------------------
   49|       |
   50|  13.5k|    c->generate_grain_y = BF(dav1d_generate_grain_y, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   51|  13.5k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I420 - 1] = BF(dav1d_generate_grain_uv_420, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   52|  13.5k|    c->fgy_32x32xn = BF(dav1d_fgy_32x32xn, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   53|  13.5k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I420 - 1] = BF(dav1d_fguv_32x32xn_i420, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   54|  13.5k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I422 - 1] = BF(dav1d_generate_grain_uv_422, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   55|  13.5k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I444 - 1] = BF(dav1d_generate_grain_uv_444, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   56|  13.5k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I422 - 1] = BF(dav1d_fguv_32x32xn_i422, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   57|  13.5k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I444 - 1] = BF(dav1d_fguv_32x32xn_i444, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   58|       |
   59|  13.5k|#if ARCH_X86_64
   60|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (60:9): [True: 0, False: 13.5k]
  ------------------
   61|       |
   62|  13.5k|    c->generate_grain_y = BF(dav1d_generate_grain_y, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   63|  13.5k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I420 - 1] = BF(dav1d_generate_grain_uv_420, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   64|  13.5k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I422 - 1] = BF(dav1d_generate_grain_uv_422, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   65|  13.5k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I444 - 1] = BF(dav1d_generate_grain_uv_444, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   66|       |
   67|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_SLOW_GATHER)) {
  ------------------
  |  Branch (67:9): [True: 13.5k, False: 0]
  ------------------
   68|  13.5k|        c->fgy_32x32xn = BF(dav1d_fgy_32x32xn, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   69|  13.5k|        c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I420 - 1] = BF(dav1d_fguv_32x32xn_i420, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   70|  13.5k|        c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I422 - 1] = BF(dav1d_fguv_32x32xn_i422, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   71|  13.5k|        c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I444 - 1] = BF(dav1d_fguv_32x32xn_i444, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   72|  13.5k|    }
   73|       |
   74|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (74:9): [True: 13.5k, 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|  13.5k|static ALWAYS_INLINE void intra_pred_dsp_init_x86(Dav1dIntraPredDSPContext *const c) {
   72|  13.5k|    const unsigned flags = dav1d_get_cpu_flags();
   73|       |
   74|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (74:9): [True: 0, False: 13.5k]
  ------------------
   75|       |
   76|  13.5k|    init_angular_ipred_fn(DC_PRED,       ipred_dc,       ssse3);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   77|  13.5k|    init_angular_ipred_fn(DC_128_PRED,   ipred_dc_128,   ssse3);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   78|  13.5k|    init_angular_ipred_fn(TOP_DC_PRED,   ipred_dc_top,   ssse3);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   79|  13.5k|    init_angular_ipred_fn(LEFT_DC_PRED,  ipred_dc_left,  ssse3);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   80|  13.5k|    init_angular_ipred_fn(HOR_PRED,      ipred_h,        ssse3);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|  13.5k|    init_angular_ipred_fn(VERT_PRED,     ipred_v,        ssse3);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   82|  13.5k|    init_angular_ipred_fn(PAETH_PRED,    ipred_paeth,    ssse3);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   83|  13.5k|    init_angular_ipred_fn(SMOOTH_PRED,   ipred_smooth,   ssse3);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   84|  13.5k|    init_angular_ipred_fn(SMOOTH_H_PRED, ipred_smooth_h, ssse3);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   85|  13.5k|    init_angular_ipred_fn(SMOOTH_V_PRED, ipred_smooth_v, ssse3);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   86|  13.5k|    init_angular_ipred_fn(Z1_PRED,       ipred_z1,       ssse3);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   87|  13.5k|    init_angular_ipred_fn(Z2_PRED,       ipred_z2,       ssse3);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|  13.5k|    init_angular_ipred_fn(Z3_PRED,       ipred_z3,       ssse3);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   89|  13.5k|    init_angular_ipred_fn(FILTER_PRED,   ipred_filter,   ssse3);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   90|       |
   91|  13.5k|    init_cfl_pred_fn(DC_PRED,      ipred_cfl,      ssse3);
  ------------------
  |  |   41|  13.5k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   92|  13.5k|    init_cfl_pred_fn(DC_128_PRED,  ipred_cfl_128,  ssse3);
  ------------------
  |  |   41|  13.5k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   93|  13.5k|    init_cfl_pred_fn(TOP_DC_PRED,  ipred_cfl_top,  ssse3);
  ------------------
  |  |   41|  13.5k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   94|  13.5k|    init_cfl_pred_fn(LEFT_DC_PRED, ipred_cfl_left, ssse3);
  ------------------
  |  |   41|  13.5k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   95|       |
   96|  13.5k|    init_cfl_ac_fn(DAV1D_PIXEL_LAYOUT_I420 - 1, ipred_cfl_ac_420, ssse3);
  ------------------
  |  |   43|  13.5k|    init_fn(cfl_ac, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   97|  13.5k|    init_cfl_ac_fn(DAV1D_PIXEL_LAYOUT_I422 - 1, ipred_cfl_ac_422, ssse3);
  ------------------
  |  |   43|  13.5k|    init_fn(cfl_ac, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   98|  13.5k|    init_cfl_ac_fn(DAV1D_PIXEL_LAYOUT_I444 - 1, ipred_cfl_ac_444, ssse3);
  ------------------
  |  |   43|  13.5k|    init_fn(cfl_ac, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   99|       |
  100|  13.5k|    c->pal_pred = BF(dav1d_pal_pred, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  101|       |
  102|  13.5k|#if ARCH_X86_64
  103|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (103:9): [True: 0, False: 13.5k]
  ------------------
  104|       |
  105|  13.5k|    init_angular_ipred_fn(DC_PRED,       ipred_dc,       avx2);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  106|  13.5k|    init_angular_ipred_fn(DC_128_PRED,   ipred_dc_128,   avx2);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  107|  13.5k|    init_angular_ipred_fn(TOP_DC_PRED,   ipred_dc_top,   avx2);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  108|  13.5k|    init_angular_ipred_fn(LEFT_DC_PRED,  ipred_dc_left,  avx2);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  109|  13.5k|    init_angular_ipred_fn(HOR_PRED,      ipred_h,        avx2);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  110|  13.5k|    init_angular_ipred_fn(VERT_PRED,     ipred_v,        avx2);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  111|  13.5k|    init_angular_ipred_fn(PAETH_PRED,    ipred_paeth,    avx2);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  112|  13.5k|    init_angular_ipred_fn(SMOOTH_PRED,   ipred_smooth,   avx2);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|  13.5k|    init_angular_ipred_fn(SMOOTH_H_PRED, ipred_smooth_h, avx2);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  114|  13.5k|    init_angular_ipred_fn(SMOOTH_V_PRED, ipred_smooth_v, avx2);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  115|  13.5k|    init_angular_ipred_fn(Z1_PRED,       ipred_z1,       avx2);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  116|  13.5k|    init_angular_ipred_fn(Z2_PRED,       ipred_z2,       avx2);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  117|  13.5k|    init_angular_ipred_fn(Z3_PRED,       ipred_z3,       avx2);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  118|  13.5k|    init_angular_ipred_fn(FILTER_PRED,   ipred_filter,   avx2);
  ------------------
  |  |   39|  13.5k|    init_fn(intra_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  119|       |
  120|  13.5k|    init_cfl_pred_fn(DC_PRED,      ipred_cfl,      avx2);
  ------------------
  |  |   41|  13.5k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  121|  13.5k|    init_cfl_pred_fn(DC_128_PRED,  ipred_cfl_128,  avx2);
  ------------------
  |  |   41|  13.5k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  122|  13.5k|    init_cfl_pred_fn(TOP_DC_PRED,  ipred_cfl_top,  avx2);
  ------------------
  |  |   41|  13.5k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  123|  13.5k|    init_cfl_pred_fn(LEFT_DC_PRED, ipred_cfl_left, avx2);
  ------------------
  |  |   41|  13.5k|    init_fn(cfl_pred, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  124|       |
  125|  13.5k|    init_cfl_ac_fn(DAV1D_PIXEL_LAYOUT_I420 - 1, ipred_cfl_ac_420, avx2);
  ------------------
  |  |   43|  13.5k|    init_fn(cfl_ac, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  126|  13.5k|    init_cfl_ac_fn(DAV1D_PIXEL_LAYOUT_I422 - 1, ipred_cfl_ac_422, avx2);
  ------------------
  |  |   43|  13.5k|    init_fn(cfl_ac, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  127|  13.5k|    init_cfl_ac_fn(DAV1D_PIXEL_LAYOUT_I444 - 1, ipred_cfl_ac_444, avx2);
  ------------------
  |  |   43|  13.5k|    init_fn(cfl_ac, type, name, suffix)
  |  |  ------------------
  |  |  |  |   36|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  128|       |
  129|  13.5k|    c->pal_pred = BF(dav1d_pal_pred, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  130|       |
  131|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (131:9): [True: 13.5k, 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|  13.5k|    c->type0[type1] = BF(dav1d_##name, suffix)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.5k|#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|  5.08k|{
  113|  5.08k|#define assign_itx_bpc_fn(pfx, w, h, type, type_enum, bpc, ext) \
  114|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  115|  5.08k|        BF_BPC(dav1d_inv_txfm_add_##type##_##w##x##h, bpc, ext)
  116|       |
  117|  5.08k|#define assign_itx1_bpc_fn(pfx, w, h, bpc, ext) \
  118|  5.08k|    assign_itx_bpc_fn(pfx, w, h, dct_dct,           DCT_DCT,           bpc, ext)
  119|       |
  120|  5.08k|#define assign_itx2_bpc_fn(pfx, w, h, bpc, ext) \
  121|  5.08k|    assign_itx1_bpc_fn(pfx, w, h, bpc, ext); \
  122|  5.08k|    assign_itx_bpc_fn(pfx, w, h, identity_identity, IDTX,              bpc, ext)
  123|       |
  124|  5.08k|#define assign_itx12_bpc_fn(pfx, w, h, bpc, ext) \
  125|  5.08k|    assign_itx2_bpc_fn(pfx, w, h, bpc, ext); \
  126|  5.08k|    assign_itx_bpc_fn(pfx, w, h, dct_adst,          ADST_DCT,          bpc, ext); \
  127|  5.08k|    assign_itx_bpc_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      bpc, ext); \
  128|  5.08k|    assign_itx_bpc_fn(pfx, w, h, dct_identity,      H_DCT,             bpc, ext); \
  129|  5.08k|    assign_itx_bpc_fn(pfx, w, h, adst_dct,          DCT_ADST,          bpc, ext); \
  130|  5.08k|    assign_itx_bpc_fn(pfx, w, h, adst_adst,         ADST_ADST,         bpc, ext); \
  131|  5.08k|    assign_itx_bpc_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     bpc, ext); \
  132|  5.08k|    assign_itx_bpc_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      bpc, ext); \
  133|  5.08k|    assign_itx_bpc_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     bpc, ext); \
  134|  5.08k|    assign_itx_bpc_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, bpc, ext); \
  135|  5.08k|    assign_itx_bpc_fn(pfx, w, h, identity_dct,      V_DCT,             bpc, ext)
  136|       |
  137|  5.08k|#define assign_itx16_bpc_fn(pfx, w, h, bpc, ext) \
  138|  5.08k|    assign_itx12_bpc_fn(pfx, w, h, bpc, ext); \
  139|  5.08k|    assign_itx_bpc_fn(pfx, w, h, adst_identity,     H_ADST,            bpc, ext); \
  140|  5.08k|    assign_itx_bpc_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        bpc, ext); \
  141|  5.08k|    assign_itx_bpc_fn(pfx, w, h, identity_adst,     V_ADST,            bpc, ext); \
  142|  5.08k|    assign_itx_bpc_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        bpc, ext)
  143|       |
  144|  5.08k|    const unsigned flags = dav1d_get_cpu_flags();
  145|       |
  146|  5.08k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE2)) return;
  ------------------
  |  Branch (146:9): [True: 0, False: 5.08k]
  ------------------
  147|       |
  148|  5.08k|    assign_itx_fn(, 4, 4, wht_wht, WHT_WHT, sse2);
  ------------------
  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  ------------------
  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  149|       |
  150|  5.08k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (150:9): [True: 0, False: 5.08k]
  ------------------
  151|       |
  152|  5.08k|#if BITDEPTH == 8
  153|  5.08k|    assign_itx16_fn(,   4,  4, ssse3);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  154|  5.08k|    assign_itx16_fn(R,  4,  8, ssse3);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|  5.08k|    assign_itx16_fn(R,  8,  4, ssse3);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  156|  5.08k|    assign_itx16_fn(,   8,  8, ssse3);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|  5.08k|    assign_itx16_fn(R,  4, 16, ssse3);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  158|  5.08k|    assign_itx16_fn(R, 16,  4, ssse3);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  159|  5.08k|    assign_itx16_fn(R,  8, 16, ssse3);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  160|  5.08k|    assign_itx16_fn(R, 16,  8, ssse3);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  161|  5.08k|    assign_itx12_fn(,  16, 16, ssse3);
  ------------------
  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  162|  5.08k|    assign_itx2_fn (R,  8, 32, ssse3);
  ------------------
  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|  5.08k|    assign_itx2_fn (R, 32,  8, ssse3);
  ------------------
  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  164|  5.08k|    assign_itx2_fn (R, 16, 32, ssse3);
  ------------------
  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  165|  5.08k|    assign_itx2_fn (R, 32, 16, ssse3);
  ------------------
  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|  5.08k|    assign_itx2_fn (,  32, 32, ssse3);
  ------------------
  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  167|  5.08k|    assign_itx1_fn (R, 16, 64, ssse3);
  ------------------
  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  168|  5.08k|    assign_itx1_fn (R, 32, 64, ssse3);
  ------------------
  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  169|  5.08k|    assign_itx1_fn (R, 64, 16, ssse3);
  ------------------
  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  170|  5.08k|    assign_itx1_fn (R, 64, 32, ssse3);
  ------------------
  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  171|  5.08k|    assign_itx1_fn ( , 64, 64, ssse3);
  ------------------
  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  172|  5.08k|    *all_simd = 1;
  173|  5.08k|#endif
  174|       |
  175|  5.08k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE41)) return;
  ------------------
  |  Branch (175:9): [True: 0, False: 5.08k]
  ------------------
  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|  5.08k|#if ARCH_X86_64
  203|  5.08k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (203:9): [True: 0, False: 5.08k]
  ------------------
  204|       |
  205|  5.08k|    assign_itx_fn(, 4, 4, wht_wht, WHT_WHT, avx2);
  ------------------
  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  ------------------
  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  206|       |
  207|  5.08k|#if BITDEPTH == 8
  208|  5.08k|    assign_itx16_fn( ,  4,  4, avx2);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  209|  5.08k|    assign_itx16_fn(R,  4,  8, avx2);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|  5.08k|    assign_itx16_fn(R,  4, 16, avx2);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  211|  5.08k|    assign_itx16_fn(R,  8,  4, avx2);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|  5.08k|    assign_itx16_fn( ,  8,  8, avx2);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  213|  5.08k|    assign_itx16_fn(R,  8, 16, avx2);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|  5.08k|    assign_itx2_fn (R,  8, 32, avx2);
  ------------------
  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  215|  5.08k|    assign_itx16_fn(R, 16,  4, avx2);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  216|  5.08k|    assign_itx16_fn(R, 16,  8, avx2);
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  102|  5.08k|    assign_itx_fn(pfx, w, h, adst_identity,     H_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  103|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  5.08k|    assign_itx_fn(pfx, w, h, identity_adst,     V_ADST,            ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  217|  5.08k|    assign_itx12_fn( , 16, 16, avx2);
  ------------------
  |  |   88|  5.08k|    assign_itx2_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   89|  5.08k|    assign_itx_fn(pfx, w, h, dct_adst,          ADST_DCT,          ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   90|  5.08k|    assign_itx_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   91|  5.08k|    assign_itx_fn(pfx, w, h, dct_identity,      H_DCT,             ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   92|  5.08k|    assign_itx_fn(pfx, w, h, adst_dct,          DCT_ADST,          ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|  5.08k|    assign_itx_fn(pfx, w, h, adst_adst,         ADST_ADST,         ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   94|  5.08k|    assign_itx_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   95|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   96|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   97|  5.08k|    assign_itx_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, ext); \
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   98|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  218|  5.08k|    assign_itx2_fn (R, 16, 32, avx2);
  ------------------
  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  219|  5.08k|    assign_itx1_fn (R, 16, 64, avx2);
  ------------------
  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  220|  5.08k|    assign_itx2_fn (R, 32,  8, avx2);
  ------------------
  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  221|  5.08k|    assign_itx2_fn (R, 32, 16, avx2);
  ------------------
  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  222|  5.08k|    assign_itx2_fn ( , 32, 32, avx2);
  ------------------
  |  |   84|  5.08k|    assign_itx1_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  223|  5.08k|    assign_itx1_fn (R, 32, 64, avx2);
  ------------------
  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|  5.08k|    assign_itx1_fn (R, 64, 16, avx2);
  ------------------
  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|  5.08k|    assign_itx1_fn (R, 64, 32, avx2);
  ------------------
  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  226|  5.08k|    assign_itx1_fn ( , 64, 64, avx2);
  ------------------
  |  |   81|  5.08k|    assign_itx_fn(pfx, w, h, dct_dct,           DCT_DCT,           ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#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|  5.08k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (266:9): [True: 5.08k, False: 0]
  ------------------
  267|       |
  268|      0|#if BITDEPTH == 8
  269|  5.08k|    assign_itx16_fn( ,  4,  4, avx512icl); // no wht
  ------------------
  |  |  101|  5.08k|    assign_itx12_fn(pfx, w, h, ext); \
  |  |  ------------------
  |  |  |  |   88|  5.08k|    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|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  5.08k|    assign_itx_fn(pfx, w, h, identity_identity, IDTX,              ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   52|  5.08k|#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|  5.08k|    assign_itx_fn(pfx, w, h, identity_dct,      V_DCT,             ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  5.08k|#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|  5.08k|    assign_itx_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        ext)
  |  |  ------------------
  |  |  |  |   77|  5.08k|    c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
  |  |  |  |   78|  5.08k|        BF(dav1d_inv_txfm_add_##type##_##w##x##h, ext)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  5.08k|#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|}

lf_mask.c:lf_mask_dsp_init_x86:
   40|  15.1k|static ALWAYS_INLINE void lf_mask_dsp_init_x86(Dav1dLfMaskDSPContext *const s) {
   41|  15.1k|    const unsigned flags = dav1d_get_cpu_flags();
   42|       |
   43|  15.1k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE2)) return;
  ------------------
  |  Branch (43:9): [True: 0, False: 15.1k]
  ------------------
   44|  15.1k|    s->fill_levelcache_block = dav1d_fill_levelcache_block_sse2;
   45|  15.1k|    s->mask_edges_inter_outer = dav1d_mask_edges_inter_outer_sse2;
   46|       |
   47|  15.1k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (47:9): [True: 0, False: 15.1k]
  ------------------
   48|  15.1k|    s->fill_levelcache_block = dav1d_fill_levelcache_block_avx2;
   49|  15.1k|    s->mask_edges_inter_outer = dav1d_mask_edges_inter_outer_avx2;
   50|  15.1k|}

loopfilter_tmpl.c:loop_filter_dsp_init_x86:
   41|  13.5k|static ALWAYS_INLINE void loop_filter_dsp_init_x86(Dav1dLoopFilterDSPContext *const c) {
   42|  13.5k|    const unsigned flags = dav1d_get_cpu_flags();
   43|       |
   44|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (44:9): [True: 0, False: 13.5k]
  ------------------
   45|       |
   46|  13.5k|    c->loop_filter_sb[0][0] = BF(dav1d_lpf_h_sb_y, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   47|  13.5k|    c->loop_filter_sb[0][1] = BF(dav1d_lpf_v_sb_y, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   48|  13.5k|    c->loop_filter_sb[1][0] = BF(dav1d_lpf_h_sb_uv, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   49|  13.5k|    c->loop_filter_sb[1][1] = BF(dav1d_lpf_v_sb_uv, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   50|       |
   51|  13.5k|#if ARCH_X86_64
   52|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (52:9): [True: 0, False: 13.5k]
  ------------------
   53|       |
   54|  13.5k|    c->loop_filter_sb[0][0] = BF(dav1d_lpf_h_sb_y, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   55|  13.5k|    c->loop_filter_sb[0][1] = BF(dav1d_lpf_v_sb_y, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   56|  13.5k|    c->loop_filter_sb[1][0] = BF(dav1d_lpf_h_sb_uv, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   57|  13.5k|    c->loop_filter_sb[1][1] = BF(dav1d_lpf_v_sb_uv, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   58|       |
   59|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (59:9): [True: 13.5k, 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|  13.5k|static ALWAYS_INLINE void loop_restoration_dsp_init_x86(Dav1dLoopRestorationDSPContext *const c, const int bpc) {
   51|  13.5k|    const unsigned flags = dav1d_get_cpu_flags();
   52|       |
   53|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE2)) return;
  ------------------
  |  Branch (53:9): [True: 0, False: 13.5k]
  ------------------
   54|  13.5k|#if BITDEPTH == 8
   55|  13.5k|    c->wiener[0] = BF(dav1d_wiener_filter7, sse2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   56|  13.5k|    c->wiener[1] = BF(dav1d_wiener_filter5, sse2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   57|  13.5k|#endif
   58|       |
   59|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (59:9): [True: 0, False: 13.5k]
  ------------------
   60|  13.5k|    c->wiener[0] = BF(dav1d_wiener_filter7, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   61|  13.5k|    c->wiener[1] = BF(dav1d_wiener_filter5, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   62|  13.5k|    if (BITDEPTH == 8 || bpc == 10) {
  ------------------
  |  Branch (62:9): [True: 5.08k, Folded]
  |  Branch (62:26): [True: 3.41k, False: 5.05k]
  ------------------
   63|  8.49k|        c->sgr[0] = BF(dav1d_sgr_filter_5x5, ssse3);
  ------------------
  |  |   52|  8.49k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   64|  8.49k|        c->sgr[1] = BF(dav1d_sgr_filter_3x3, ssse3);
  ------------------
  |  |   52|  8.49k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   65|  8.49k|        c->sgr[2] = BF(dav1d_sgr_filter_mix, ssse3);
  ------------------
  |  |   52|  8.49k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   66|  8.49k|    }
   67|       |
   68|  13.5k|#if ARCH_X86_64
   69|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (69:9): [True: 0, False: 13.5k]
  ------------------
   70|       |
   71|  13.5k|    c->wiener[0] = BF(dav1d_wiener_filter7, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   72|  13.5k|    c->wiener[1] = BF(dav1d_wiener_filter5, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   73|  13.5k|    if (BITDEPTH == 8 || bpc == 10) {
  ------------------
  |  Branch (73:9): [True: 5.08k, Folded]
  |  Branch (73:26): [True: 3.41k, False: 5.05k]
  ------------------
   74|  8.49k|        c->sgr[0] = BF(dav1d_sgr_filter_5x5, avx2);
  ------------------
  |  |   52|  8.49k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   75|  8.49k|        c->sgr[1] = BF(dav1d_sgr_filter_3x3, avx2);
  ------------------
  |  |   52|  8.49k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   76|  8.49k|        c->sgr[2] = BF(dav1d_sgr_filter_mix, avx2);
  ------------------
  |  |   52|  8.49k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
   77|  8.49k|    }
   78|       |
   79|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (79:9): [True: 13.5k, 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|  13.5k|static ALWAYS_INLINE void mc_dsp_init_x86(Dav1dMCDSPContext *const c) {
   93|  13.5k|    const unsigned flags = dav1d_get_cpu_flags();
   94|       |
   95|  13.5k|    if(!(flags & DAV1D_X86_CPU_FLAG_SSSE3))
  ------------------
  |  Branch (95:8): [True: 0, False: 13.5k]
  ------------------
   96|      0|        return;
   97|       |
   98|  13.5k|    init_8tap_fns(ssse3);
  ------------------
  |  |  143|  13.5k|    init_8tap_gen(mc,  opt); \
  |  |  ------------------
  |  |  |  |  132|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR,        8tap_regular,        opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  133|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  134|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  135|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  136|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH,         8tap_smooth,         opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  137|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  138|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  139|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  140|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SHARP,          8tap_sharp,          opt)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  144|  13.5k|    init_8tap_gen(mct, opt)
  |  |  ------------------
  |  |  |  |  132|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR,        8tap_regular,        opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  133|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  134|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  135|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  136|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH,         8tap_smooth,         opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  137|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  138|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  139|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  140|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SHARP,          8tap_sharp,          opt)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   99|       |
  100|  13.5k|    init_mc_fn(FILTER_2D_BILINEAR,             bilin,               ssse3);
  ------------------
  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  101|  13.5k|    init_mct_fn(FILTER_2D_BILINEAR,            bilin,               ssse3);
  ------------------
  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  102|       |
  103|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_REGULAR,        8tap_scaled_regular,        ssse3);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  104|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_scaled_regular_smooth, ssse3);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  105|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_scaled_regular_sharp,  ssse3);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  106|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_scaled_smooth_regular, ssse3);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  107|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_SMOOTH,         8tap_scaled_smooth,         ssse3);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  108|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_scaled_smooth_sharp,   ssse3);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  109|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_scaled_sharp_regular,  ssse3);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  110|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_scaled_sharp_smooth,   ssse3);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  111|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_SHARP,          8tap_scaled_sharp,          ssse3);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  112|  13.5k|    init_mc_scaled_fn(FILTER_2D_BILINEAR,            bilin_scaled,               ssse3);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  113|       |
  114|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_REGULAR,        8tap_scaled_regular,        ssse3);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  115|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_scaled_regular_smooth, ssse3);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  116|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_scaled_regular_sharp,  ssse3);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  117|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_scaled_smooth_regular, ssse3);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  118|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_SMOOTH,         8tap_scaled_smooth,         ssse3);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  119|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_scaled_smooth_sharp,   ssse3);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  120|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_scaled_sharp_regular,  ssse3);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  121|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_scaled_sharp_smooth,   ssse3);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  122|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_SHARP,          8tap_scaled_sharp,          ssse3);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  123|  13.5k|    init_mct_scaled_fn(FILTER_2D_BILINEAR,            bilin_scaled,               ssse3);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  124|       |
  125|  13.5k|    c->avg = BF(dav1d_avg, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  126|  13.5k|    c->w_avg = BF(dav1d_w_avg, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  127|  13.5k|    c->mask = BF(dav1d_mask, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  128|  13.5k|    c->w_mask[0] = BF(dav1d_w_mask_444, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  129|  13.5k|    c->w_mask[1] = BF(dav1d_w_mask_422, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  130|  13.5k|    c->w_mask[2] = BF(dav1d_w_mask_420, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  131|  13.5k|    c->blend = BF(dav1d_blend, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  132|  13.5k|    c->blend_v = BF(dav1d_blend_v, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  133|  13.5k|    c->blend_h = BF(dav1d_blend_h, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  134|  13.5k|    c->warp8x8  = BF(dav1d_warp_affine_8x8, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  135|  13.5k|    c->warp8x8t = BF(dav1d_warp_affine_8x8t, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  136|  13.5k|    c->emu_edge = BF(dav1d_emu_edge, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  137|  13.5k|    c->resize = BF(dav1d_resize, ssse3);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  138|       |
  139|  13.5k|    if(!(flags & DAV1D_X86_CPU_FLAG_SSE41))
  ------------------
  |  Branch (139:8): [True: 0, False: 13.5k]
  ------------------
  140|      0|        return;
  141|       |
  142|  13.5k|#if BITDEPTH == 8
  143|  13.5k|    c->warp8x8  = BF(dav1d_warp_affine_8x8, sse4);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  144|  13.5k|    c->warp8x8t = BF(dav1d_warp_affine_8x8t, sse4);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  145|  13.5k|#endif
  146|       |
  147|  13.5k|#if ARCH_X86_64
  148|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2))
  ------------------
  |  Branch (148:9): [True: 0, False: 13.5k]
  ------------------
  149|      0|        return;
  150|       |
  151|  13.5k|    init_8tap_fns(avx2);
  ------------------
  |  |  143|  13.5k|    init_8tap_gen(mc,  opt); \
  |  |  ------------------
  |  |  |  |  132|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR,        8tap_regular,        opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  133|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  134|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  135|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  136|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH,         8tap_smooth,         opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  137|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  138|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  139|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  140|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SHARP,          8tap_sharp,          opt)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  144|  13.5k|    init_8tap_gen(mct, opt)
  |  |  ------------------
  |  |  |  |  132|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR,        8tap_regular,        opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  133|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_regular_smooth, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  134|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_regular_sharp,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  135|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_smooth_regular, opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  136|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH,         8tap_smooth,         opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  137|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_smooth_sharp,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  138|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_sharp_regular,  opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  139|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_sharp_smooth,   opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  140|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SHARP,          8tap_sharp,          opt)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  152|       |
  153|  13.5k|    init_mc_fn(FILTER_2D_BILINEAR,            bilin,               avx2);
  ------------------
  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  154|  13.5k|    init_mct_fn(FILTER_2D_BILINEAR,           bilin,               avx2);
  ------------------
  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  155|       |
  156|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_REGULAR,        8tap_scaled_regular,        avx2);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  157|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_scaled_regular_smooth, avx2);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  158|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_scaled_regular_sharp,  avx2);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  159|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_scaled_smooth_regular, avx2);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  160|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_SMOOTH,         8tap_scaled_smooth,         avx2);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  161|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_scaled_smooth_sharp,   avx2);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  162|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_scaled_sharp_regular,  avx2);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  163|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_scaled_sharp_smooth,   avx2);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  164|  13.5k|    init_mc_scaled_fn(FILTER_2D_8TAP_SHARP,          8tap_scaled_sharp,          avx2);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  165|  13.5k|    init_mc_scaled_fn(FILTER_2D_BILINEAR,            bilin_scaled,               avx2);
  ------------------
  |  |   40|  13.5k|    c->mc_scaled[type] = BF(dav1d_put_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  166|       |
  167|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_REGULAR,        8tap_scaled_regular,        avx2);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  168|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_REGULAR_SMOOTH, 8tap_scaled_regular_smooth, avx2);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  169|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_REGULAR_SHARP,  8tap_scaled_regular_sharp,  avx2);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  170|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_SMOOTH_REGULAR, 8tap_scaled_smooth_regular, avx2);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  171|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_SMOOTH,         8tap_scaled_smooth,         avx2);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  172|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_SMOOTH_SHARP,   8tap_scaled_smooth_sharp,   avx2);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  173|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_SHARP_REGULAR,  8tap_scaled_sharp_regular,  avx2);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  174|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_SHARP_SMOOTH,   8tap_scaled_sharp_smooth,   avx2);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  175|  13.5k|    init_mct_scaled_fn(FILTER_2D_8TAP_SHARP,          8tap_scaled_sharp,          avx2);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  176|  13.5k|    init_mct_scaled_fn(FILTER_2D_BILINEAR,            bilin_scaled,               avx2);
  ------------------
  |  |   42|  13.5k|    c->mct_scaled[type] = BF(dav1d_prep_##name, suffix)
  |  |  ------------------
  |  |  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  |  |  ------------------
  ------------------
  177|       |
  178|  13.5k|    c->avg = BF(dav1d_avg, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  179|  13.5k|    c->w_avg = BF(dav1d_w_avg, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  180|  13.5k|    c->mask = BF(dav1d_mask, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  181|  13.5k|    c->w_mask[0] = BF(dav1d_w_mask_444, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  182|  13.5k|    c->w_mask[1] = BF(dav1d_w_mask_422, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  183|  13.5k|    c->w_mask[2] = BF(dav1d_w_mask_420, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  184|  13.5k|    c->blend = BF(dav1d_blend, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  185|  13.5k|    c->blend_v = BF(dav1d_blend_v, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  186|  13.5k|    c->blend_h = BF(dav1d_blend_h, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  187|  13.5k|    c->warp8x8  = BF(dav1d_warp_affine_8x8, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  188|  13.5k|    c->warp8x8t = BF(dav1d_warp_affine_8x8t, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  189|  13.5k|    c->emu_edge = BF(dav1d_emu_edge, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  190|  13.5k|    c->resize = BF(dav1d_resize, avx2);
  ------------------
  |  |   52|  13.5k|#define BF(x, suffix) x##_8bpc_##suffix
  ------------------
  191|       |
  192|  13.5k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL))
  ------------------
  |  Branch (192:9): [True: 13.5k, False: 0]
  ------------------
  193|  13.5k|        return;
  194|       |
  195|  13.5k|    init_8tap_fns(avx512icl);
  ------------------
  |  |  143|      0|    init_8tap_gen(mc,  opt); \
  |  |  ------------------
  |  |  |  |  132|      0|    init_##name##_fn(FILTER_2D_8TAP_REGULAR,        8tap_regular,        opt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#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|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SHARP,          8tap_sharp,          opt)
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  13.5k|    c->mc[type] = BF(dav1d_put_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#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|  13.5k|    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|  13.5k|    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|  13.5k|    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|  13.5k|    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|  13.5k|    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|  13.5k|    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|  13.5k|    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|  13.5k|    init_##name##_fn(FILTER_2D_8TAP_SHARP,          8tap_sharp,          opt)
  |  |  |  |  ------------------
  |  |  |  |  |  |   38|  13.5k|    c->mct[type] = BF(dav1d_prep_##name, suffix)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   52|  13.5k|#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|   183k|static ALWAYS_INLINE void msac_init_x86(MsacContext *const s) {
   60|   183k|    const unsigned flags = dav1d_get_cpu_flags();
   61|       |
   62|   183k|    if (flags & DAV1D_X86_CPU_FLAG_SSE2) {
  ------------------
  |  Branch (62:9): [True: 183k, False: 18.4E]
  ------------------
   63|   183k|        s->symbol_adapt16 = dav1d_msac_decode_symbol_adapt16_sse2;
   64|   183k|    }
   65|       |
   66|   183k|    if (flags & DAV1D_X86_CPU_FLAG_AVX2) {
  ------------------
  |  Branch (66:9): [True: 183k, False: 18.4E]
  ------------------
   67|   183k|        s->symbol_adapt16 = dav1d_msac_decode_symbol_adapt16_avx2;
   68|   183k|    }
   69|   183k|}

pal.c:pal_dsp_init_x86:
   34|  15.1k|static ALWAYS_INLINE void pal_dsp_init_x86(Dav1dPalDSPContext *const c) {
   35|  15.1k|    const unsigned flags = dav1d_get_cpu_flags();
   36|       |
   37|  15.1k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (37:9): [True: 0, False: 15.1k]
  ------------------
   38|       |
   39|  15.1k|    c->pal_idx_finish = dav1d_pal_idx_finish_ssse3;
   40|       |
   41|  15.1k|#if ARCH_X86_64
   42|  15.1k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (42:9): [True: 0, False: 15.1k]
  ------------------
   43|       |
   44|  15.1k|    c->pal_idx_finish = dav1d_pal_idx_finish_avx2;
   45|       |
   46|  15.1k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (46:9): [True: 15.1k, 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|  15.1k|static ALWAYS_INLINE void refmvs_dsp_init_x86(Dav1dRefmvsDSPContext *const c) {
   42|  15.1k|    const unsigned flags = dav1d_get_cpu_flags();
   43|       |
   44|  15.1k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE2)) return;
  ------------------
  |  Branch (44:9): [True: 0, False: 15.1k]
  ------------------
   45|       |
   46|  15.1k|    c->splat_mv = dav1d_splat_mv_sse2;
   47|       |
   48|  15.1k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (48:9): [True: 0, False: 15.1k]
  ------------------
   49|       |
   50|  15.1k|    c->save_tmvs = dav1d_save_tmvs_ssse3;
   51|       |
   52|  15.1k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE41)) return;
  ------------------
  |  Branch (52:9): [True: 0, False: 15.1k]
  ------------------
   53|  15.1k|#if ARCH_X86_64
   54|  15.1k|    c->load_tmvs = dav1d_load_tmvs_sse4;
   55|       |
   56|  15.1k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (56:9): [True: 0, False: 15.1k]
  ------------------
   57|       |
   58|  15.1k|    c->save_tmvs = dav1d_save_tmvs_avx2;
   59|  15.1k|    c->splat_mv = dav1d_splat_mv_avx2;
   60|       |
   61|  15.1k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (61:9): [True: 15.1k, 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|}

LLVMFuzzerInitialize:
   59|      2|int LLVMFuzzerInitialize(int *argc, char ***argv) {
   60|      2|    int i = 1;
   61|     11|    for (; i < *argc; i++) {
  ------------------
  |  Branch (61:12): [True: 9, False: 2]
  ------------------
   62|      9|        if (!strcmp((*argv)[i], "--cpumask")) {
  ------------------
  |  Branch (62:13): [True: 0, False: 9]
  ------------------
   63|      0|            const char * cpumask = (*argv)[i+1];
   64|      0|            if (cpumask) {
  ------------------
  |  Branch (64:17): [True: 0, False: 0]
  ------------------
   65|      0|                char *end;
   66|      0|                unsigned res;
   67|      0|                if (!strncmp(cpumask, "0x", 2)) {
  ------------------
  |  Branch (67:21): [True: 0, False: 0]
  ------------------
   68|      0|                    cpumask += 2;
   69|      0|                    res = (unsigned) strtoul(cpumask, &end, 16);
   70|      0|                } else {
   71|      0|                    res = (unsigned) strtoul(cpumask, &end, 0);
   72|      0|                }
   73|      0|                if (end != cpumask && !end[0]) {
  ------------------
  |  Branch (73:21): [True: 0, False: 0]
  |  Branch (73:39): [True: 0, False: 0]
  ------------------
   74|      0|                    dav1d_set_cpu_flags_mask(res);
   75|      0|                }
   76|      0|            }
   77|      0|            break;
   78|      0|        }
   79|      9|    }
   80|       |
   81|      2|    for (; i < *argc - 2; i++) {
  ------------------
  |  Branch (81:12): [True: 0, False: 2]
  ------------------
   82|      0|        (*argv)[i] = (*argv)[i + 2];
   83|      0|    }
   84|       |
   85|      2|    *argc = i;
   86|       |
   87|      2|    return 0;
   88|      2|}
LLVMFuzzerTestOneInput:
   94|  15.1k|{
   95|  15.1k|    Dav1dSettings settings = { 0 };
   96|  15.1k|    Dav1dContext * ctx = NULL;
   97|  15.1k|    Dav1dPicture pic;
   98|  15.1k|    const uint8_t *ptr = data;
   99|  15.1k|    int have_seq_hdr = 0;
  100|  15.1k|    int err;
  101|       |
  102|  15.1k|    dav1d_version();
  103|       |
  104|  15.1k|    if (size < 32) goto end;
  ------------------
  |  Branch (104:9): [True: 8, False: 15.1k]
  ------------------
  105|       |#ifdef DAV1D_ALLOC_FAIL
  106|       |    unsigned h = djb_xor(ptr, 32);
  107|       |    unsigned seed = h;
  108|       |    unsigned probability = h > (RAND_MAX >> 5) ? RAND_MAX >> 5 : h;
  109|       |    int max_frame_delay = (h & 0xf) + 1;
  110|       |    int n_threads = ((h >> 4) & 0x7) + 1;
  111|       |    if (max_frame_delay > 5) max_frame_delay = 1;
  112|       |    if (n_threads > 3) n_threads = 1;
  113|       |#endif
  114|  15.1k|    ptr += 32; // skip ivf header
  115|       |
  116|  15.1k|    dav1d_default_settings(&settings);
  117|       |
  118|  15.1k|#ifdef DAV1D_MT_FUZZING
  119|  15.1k|    settings.max_frame_delay = settings.n_threads = 4;
  120|       |#elif defined(DAV1D_ALLOC_FAIL)
  121|       |    settings.max_frame_delay = max_frame_delay;
  122|       |    settings.n_threads = n_threads;
  123|       |    dav1d_setup_alloc_fail(seed, probability);
  124|       |#else
  125|       |    settings.max_frame_delay = settings.n_threads = 1;
  126|       |#endif
  127|  15.1k|#if defined(DAV1D_FUZZ_MAX_SIZE)
  128|  15.1k|    settings.frame_size_limit = DAV1D_FUZZ_MAX_SIZE;
  ------------------
  |  |   56|  15.1k|#define DAV1D_FUZZ_MAX_SIZE 4096 * 4096
  ------------------
  129|  15.1k|#endif
  130|       |
  131|  15.1k|    err = dav1d_open(&ctx, &settings);
  132|  15.1k|    if (err < 0) goto end;
  ------------------
  |  Branch (132:9): [True: 0, False: 15.1k]
  ------------------
  133|       |
  134|   307k|    while (ptr <= data + size - 12) {
  ------------------
  |  Branch (134:12): [True: 293k, False: 13.7k]
  ------------------
  135|   293k|        Dav1dData buf;
  136|   293k|        uint8_t *p;
  137|       |
  138|   293k|        size_t frame_size = r32le(ptr);
  139|   293k|        ptr += 12;
  140|       |
  141|   293k|        if (frame_size > size || ptr > data + size - frame_size)
  ------------------
  |  Branch (141:13): [True: 1.10k, False: 292k]
  |  Branch (141:34): [True: 305, False: 292k]
  ------------------
  142|  1.40k|            break;
  143|       |
  144|   292k|        if (!frame_size) continue;
  ------------------
  |  Branch (144:13): [True: 4.60k, False: 287k]
  ------------------
  145|       |
  146|   287k|        if (!have_seq_hdr) {
  ------------------
  |  Branch (146:13): [True: 18.5k, False: 268k]
  ------------------
  147|  18.5k|            Dav1dSequenceHeader seq;
  148|  18.5k|            int err = dav1d_parse_sequence_header(&seq, ptr, frame_size);
  149|       |            // skip frames until we see a sequence header
  150|  18.5k|            if  (err != 0) {
  ------------------
  |  Branch (150:18): [True: 3.82k, False: 14.6k]
  ------------------
  151|  3.82k|                ptr += frame_size;
  152|  3.82k|                continue;
  153|  3.82k|            }
  154|  14.6k|            have_seq_hdr = 1;
  155|  14.6k|        }
  156|       |
  157|       |        // copy frame data to a new buffer to catch reads past the end of input
  158|   283k|        p = dav1d_data_create(&buf, frame_size);
  159|   283k|        if (!p) goto cleanup;
  ------------------
  |  Branch (159:13): [True: 0, False: 283k]
  ------------------
  160|   283k|        memcpy(p, ptr, frame_size);
  161|   283k|        ptr += frame_size;
  162|       |
  163|   295k|        do {
  164|   295k|            if ((err = dav1d_send_data(ctx, &buf)) < 0) {
  ------------------
  |  Branch (164:17): [True: 64.1k, False: 231k]
  ------------------
  165|  64.1k|                if (err != DAV1D_ERR(EAGAIN))
  ------------------
  |  |   58|  64.1k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (165:21): [True: 48.0k, False: 16.0k]
  ------------------
  166|  48.0k|                    break;
  167|  64.1k|            }
  168|   247k|            memset(&pic, 0, sizeof(pic));
  169|   247k|            err = dav1d_get_picture(ctx, &pic);
  170|   247k|            if (err == 0) {
  ------------------
  |  Branch (170:17): [True: 40.4k, False: 207k]
  ------------------
  171|  40.4k|                dav1d_picture_unref(&pic);
  172|   207k|            } else if (err != DAV1D_ERR(EAGAIN)) {
  ------------------
  |  |   58|   207k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (172:24): [True: 150k, False: 57.0k]
  ------------------
  173|   150k|                break;
  174|   150k|            }
  175|   247k|        } while (buf.sz > 0);
  ------------------
  |  Branch (175:18): [True: 12.2k, False: 85.1k]
  ------------------
  176|       |
  177|   283k|        if (buf.sz > 0)
  ------------------
  |  Branch (177:13): [True: 51.8k, False: 231k]
  ------------------
  178|  51.8k|            dav1d_data_unref(&buf);
  179|   283k|    }
  180|       |
  181|  15.1k|    memset(&pic, 0, sizeof(pic));
  182|  15.1k|    if ((err = dav1d_get_picture(ctx, &pic)) == 0) {
  ------------------
  |  Branch (182:9): [True: 8.84k, False: 6.26k]
  ------------------
  183|       |        /* Test calling dav1d_picture_unref() after dav1d_close() */
  184|  16.0k|        do {
  185|  16.0k|            Dav1dPicture pic2 = { 0 };
  186|  16.0k|            if ((err = dav1d_get_picture(ctx, &pic2)) == 0)
  ------------------
  |  Branch (186:17): [True: 4.68k, False: 11.4k]
  ------------------
  187|  4.68k|                dav1d_picture_unref(&pic2);
  188|  16.0k|        } while (err != DAV1D_ERR(EAGAIN));
  ------------------
  |  |   58|  16.0k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (188:18): [True: 7.24k, False: 8.84k]
  ------------------
  189|       |
  190|  8.84k|        dav1d_close(&ctx);
  191|  8.84k|        dav1d_picture_unref(&pic);
  192|  8.84k|        return 0;
  193|  8.84k|    }
  194|       |
  195|  6.26k|cleanup:
  196|  6.26k|    dav1d_close(&ctx);
  197|  6.27k|end:
  198|  6.27k|    return 0;
  199|  6.26k|}
dav1d_fuzzer.c:r32le:
   52|   293k|static unsigned r32le(const uint8_t *const p) {
   53|   293k|    return ((uint32_t)p[3] << 24U) | (p[2] << 16U) | (p[1] << 8U) | p[0];
   54|   293k|}

