obu.c:clz:
  186|  5.04k|static inline int clz(const unsigned int mask) {
  187|  5.04k|    return __builtin_clz(mask);
  188|  5.04k|}
decode.c:ctz:
  182|  92.0k|static inline int ctz(const unsigned int mask) {
  183|  92.0k|    return __builtin_ctz(mask);
  184|  92.0k|}
decode.c:clz:
  186|  7.08M|static inline int clz(const unsigned int mask) {
  187|  7.08M|    return __builtin_clz(mask);
  188|  7.08M|}
getbits.c:clz:
  186|   112k|static inline int clz(const unsigned int mask) {
  187|   112k|    return __builtin_clz(mask);
  188|   112k|}
lf_mask.c:clz:
  186|  1.55M|static inline int clz(const unsigned int mask) {
  187|  1.55M|    return __builtin_clz(mask);
  188|  1.55M|}
warpmv.c:clz:
  186|  65.5k|static inline int clz(const unsigned int mask) {
  187|  65.5k|    return __builtin_clz(mask);
  188|  65.5k|}
warpmv.c:clzll:
  190|  60.7k|static inline int clzll(const unsigned long long mask) {
  191|  60.7k|    return __builtin_clzll(mask);
  192|  60.7k|}
looprestoration_tmpl.c:clz:
  186|   512k|static inline int clz(const unsigned int mask) {
  187|   512k|    return __builtin_clz(mask);
  188|   512k|}
recon_tmpl.c:clz:
  186|  18.4M|static inline int clz(const unsigned int mask) {
  187|  18.4M|    return __builtin_clz(mask);
  188|  18.4M|}
cdef_apply_tmpl.c:ctz:
  182|   609k|static inline int ctz(const unsigned int mask) {
  183|   609k|    return __builtin_ctz(mask);
  184|   609k|}
cdef_apply_tmpl.c:clz:
  186|   166k|static inline int clz(const unsigned int mask) {
  187|   166k|    return __builtin_clz(mask);
  188|   166k|}
ipred_prepare_tmpl.c:clz:
  186|  7.92M|static inline int clz(const unsigned int mask) {
  187|  7.92M|    return __builtin_clz(mask);
  188|  7.92M|}

fg_apply_tmpl.c:PXSTRIDE:
   79|  45.0k|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  45.0k|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 45.0k, False: 0]
  ------------------
   81|  45.0k|    return x >> 1;
   82|  45.0k|}
itx_tmpl.c:PXSTRIDE:
   79|  5.83M|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  5.83M|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 5.83M, False: 0]
  ------------------
   81|  5.83M|    return x >> 1;
   82|  5.83M|}
looprestoration_tmpl.c:PXSTRIDE:
   79|  1.38M|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  1.38M|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 1.38M, False: 0]
  ------------------
   81|  1.38M|    return x >> 1;
   82|  1.38M|}
recon_tmpl.c:PXSTRIDE:
   79|  13.2M|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  13.2M|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 13.2M, False: 0]
  ------------------
   81|  13.2M|    return x >> 1;
   82|  13.2M|}
cdef_apply_tmpl.c:PXSTRIDE:
   79|   426k|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|   426k|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 426k, False: 0]
  ------------------
   81|   426k|    return x >> 1;
   82|   426k|}
ipred_prepare_tmpl.c:PXSTRIDE:
   79|  85.4M|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  85.4M|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 85.4M, False: 0]
  ------------------
   81|  85.4M|    return x >> 1;
   82|  85.4M|}
ipred_prepare_tmpl.c:pixel_set:
   66|  1.28M|static inline void pixel_set(pixel *const dst, const int val, const int num) {
   67|  21.8M|    for (int n = 0; n < num; n++)
  ------------------
  |  Branch (67:21): [True: 20.5M, False: 1.28M]
  ------------------
   68|  20.5M|        dst[n] = val;
   69|  1.28M|}
lf_apply_tmpl.c:PXSTRIDE:
   79|  1.85M|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|  1.85M|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 1.85M, False: 0]
  ------------------
   81|  1.85M|    return x >> 1;
   82|  1.85M|}
lr_apply_tmpl.c:PXSTRIDE:
   79|   496k|static inline ptrdiff_t PXSTRIDE(const ptrdiff_t x) {
   80|   496k|    assert(!(x & 1));
  ------------------
  |  Branch (80:5): [True: 496k, False: 0]
  ------------------
   81|   496k|    return x >> 1;
   82|   496k|}

lib.c:umin:
   47|  11.2k|static inline unsigned umin(const unsigned a, const unsigned b) {
   48|  11.2k|    return a < b ? a : b;
  ------------------
  |  Branch (48:12): [True: 0, False: 11.2k]
  ------------------
   49|  11.2k|}
obu.c:ulog2:
   71|  5.04k|static inline int ulog2(const unsigned v) {
   72|  5.04k|    return 31 ^ clz(v);
   73|  5.04k|}
obu.c:imin:
   39|   300k|static inline int imin(const int a, const int b) {
   40|   300k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 230k, False: 70.0k]
  ------------------
   41|   300k|}
obu.c:imax:
   35|   208k|static inline int imax(const int a, const int b) {
   36|   208k|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 17.2k, False: 191k]
  ------------------
   37|   208k|}
obu.c:iclip_u8:
   55|  98.4k|static inline int iclip_u8(const int v) {
   56|  98.4k|    return iclip(v, 0, 255);
   57|  98.4k|}
obu.c:iclip:
   51|  98.4k|static inline int iclip(const int v, const int min, const int max) {
   52|  98.4k|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 1.36k, False: 97.0k]
  |  Branch (52:28): [True: 1.11k, False: 95.9k]
  ------------------
   53|  98.4k|}
refmvs.c:imin:
   39|  21.1M|static inline int imin(const int a, const int b) {
   40|  21.1M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 9.82M, False: 11.2M]
  ------------------
   41|  21.1M|}
refmvs.c:apply_sign:
   59|   395k|static inline int apply_sign(const int v, const int s) {
   60|   395k|    return s < 0 ? -v : v;
  ------------------
  |  Branch (60:12): [True: 146k, False: 249k]
  ------------------
   61|   395k|}
refmvs.c:imax:
   35|  10.3M|static inline int imax(const int a, const int b) {
   36|  10.3M|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 1.96M, False: 8.35M]
  ------------------
   37|  10.3M|}
refmvs.c:apply_sign_bool:
   67|  2.34M|static inline int apply_sign_bool(const int v, const int s) {
   68|  2.34M|    return (v - s) ^ -s;
   69|  2.34M|}
refmvs.c:iclip:
   51|  8.30M|static inline int iclip(const int v, const int min, const int max) {
   52|  8.30M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 210k, False: 8.09M]
  |  Branch (52:28): [True: 193k, False: 7.90M]
  ------------------
   53|  8.30M|}
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.77k, False: 23.1k]
  ------------------
   41|  27.9k|}
cdf.c:imin:
   39|   148k|static inline int imin(const int a, const int b) {
   40|   148k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 37.2k, False: 111k]
  ------------------
   41|   148k|}
decode.c:apply_sign_bool:
   67|  2.37M|static inline int apply_sign_bool(const int v, const int s) {
   68|  2.37M|    return (v - s) ^ -s;
   69|  2.37M|}
decode.c:iclip:
   51|  1.16M|static inline int iclip(const int v, const int min, const int max) {
   52|  1.16M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 58.1k, False: 1.10M]
  |  Branch (52:28): [True: 22.8k, False: 1.08M]
  ------------------
   53|  1.16M|}
decode.c:apply_sign:
   59|   130k|static inline int apply_sign(const int v, const int s) {
   60|   130k|    return s < 0 ? -v : v;
  ------------------
  |  Branch (60:12): [True: 54.9k, False: 75.1k]
  ------------------
   61|   130k|}
decode.c:ulog2:
   71|  7.08M|static inline int ulog2(const unsigned v) {
   72|  7.08M|    return 31 ^ clz(v);
   73|  7.08M|}
decode.c:imax:
   35|  6.78M|static inline int imax(const int a, const int b) {
   36|  6.78M|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 2.54M, False: 4.24M]
  ------------------
   37|  6.78M|}
decode.c:imin:
   39|  16.2M|static inline int imin(const int a, const int b) {
   40|  16.2M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 9.81M, False: 6.46M]
  ------------------
   41|  16.2M|}
decode.c:iclip_u8:
   55|   822k|static inline int iclip_u8(const int v) {
   56|   822k|    return iclip(v, 0, 255);
   57|   822k|}
getbits.c:ulog2:
   71|   112k|static inline int ulog2(const unsigned v) {
   72|   112k|    return 31 ^ clz(v);
   73|   112k|}
getbits.c:inv_recenter:
   79|  35.9k|static inline unsigned inv_recenter(const unsigned r, const unsigned v) {
   80|  35.9k|    if (v > (r << 1))
  ------------------
  |  Branch (80:9): [True: 2.24k, False: 33.6k]
  ------------------
   81|  2.24k|        return v;
   82|  33.6k|    else if ((v & 1) == 0)
  ------------------
  |  Branch (82:14): [True: 22.2k, False: 11.4k]
  ------------------
   83|  22.2k|        return (v >> 1) + r;
   84|  11.4k|    else
   85|  11.4k|        return r - ((v + 1) >> 1);
   86|  35.9k|}
lf_mask.c:imin:
   39|  15.0M|static inline int imin(const int a, const int b) {
   40|  15.0M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 1.89M, False: 13.1M]
  ------------------
   41|  15.0M|}
lf_mask.c:ulog2:
   71|  1.55M|static inline int ulog2(const unsigned v) {
   72|  1.55M|    return 31 ^ clz(v);
   73|  1.55M|}
lf_mask.c:imax:
   35|   994k|static inline int imax(const int a, const int b) {
   36|   994k|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 939k, False: 55.1k]
  ------------------
   37|   994k|}
lf_mask.c:iclip:
   51|  3.40M|static inline int iclip(const int v, const int min, const int max) {
   52|  3.40M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 326k, False: 3.08M]
  |  Branch (52:28): [True: 72.9k, False: 3.00M]
  ------------------
   53|  3.40M|}
msac.c:inv_recenter:
   79|   119k|static inline unsigned inv_recenter(const unsigned r, const unsigned v) {
   80|   119k|    if (v > (r << 1))
  ------------------
  |  Branch (80:9): [True: 27.7k, False: 91.6k]
  ------------------
   81|  27.7k|        return v;
   82|  91.6k|    else if ((v & 1) == 0)
  ------------------
  |  Branch (82:14): [True: 42.8k, False: 48.7k]
  ------------------
   83|  42.8k|        return (v >> 1) + r;
   84|  48.7k|    else
   85|  48.7k|        return r - ((v + 1) >> 1);
   86|   119k|}
warpmv.c:apply_sign:
   59|   327k|static inline int apply_sign(const int v, const int s) {
   60|   327k|    return s < 0 ? -v : v;
  ------------------
  |  Branch (60:12): [True: 81.7k, False: 246k]
  ------------------
   61|   327k|}
warpmv.c:ulog2:
   71|  65.5k|static inline int ulog2(const unsigned v) {
   72|  65.5k|    return 31 ^ clz(v);
   73|  65.5k|}
warpmv.c:apply_sign64:
   63|   434k|static inline int apply_sign64(const int v, const int64_t s) {
   64|   434k|    return s < 0 ? -v : v;
  ------------------
  |  Branch (64:12): [True: 48.2k, False: 386k]
  ------------------
   65|   434k|}
warpmv.c:iclip:
   51|   626k|static inline int iclip(const int v, const int min, const int max) {
   52|   626k|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 12.4k, False: 614k]
  |  Branch (52:28): [True: 13.3k, False: 600k]
  ------------------
   53|   626k|}
warpmv.c:u64log2:
   75|  60.7k|static inline int u64log2(const uint64_t v) {
   76|  60.7k|    return 63 ^ clzll(v);
   77|  60.7k|}
itx_tmpl.c:iclip:
   51|   384M|static inline int iclip(const int v, const int min, const int max) {
   52|   384M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 16.7M, False: 367M]
  |  Branch (52:28): [True: 17.3M, False: 350M]
  ------------------
   53|   384M|}
itx_tmpl.c:imin:
   39|   242k|static inline int imin(const int a, const int b) {
   40|   242k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 50.0k, False: 192k]
  ------------------
   41|   242k|}
looprestoration_tmpl.c:iclip:
   51|  54.3M|static inline int iclip(const int v, const int min, const int max) {
   52|  54.3M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 3.66k, False: 54.3M]
  |  Branch (52:28): [True: 3.93k, False: 54.3M]
  ------------------
   53|  54.3M|}
looprestoration_tmpl.c:imax:
   35|  55.6M|static inline int imax(const int a, const int b) {
   36|  55.6M|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 4.32M, False: 51.2M]
  ------------------
   37|  55.6M|}
looprestoration_tmpl.c:umin:
   47|  55.6M|static inline unsigned umin(const unsigned a, const unsigned b) {
   48|  55.6M|    return a < b ? a : b;
  ------------------
  |  Branch (48:12): [True: 55.5M, False: 26.4k]
  ------------------
   49|  55.6M|}
recon_tmpl.c:ulog2:
   71|  18.4M|static inline int ulog2(const unsigned v) {
   72|  18.4M|    return 31 ^ clz(v);
   73|  18.4M|}
recon_tmpl.c:imin:
   39|  57.1M|static inline int imin(const int a, const int b) {
   40|  57.1M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 47.6M, False: 9.49M]
  ------------------
   41|  57.1M|}
recon_tmpl.c:imax:
   35|  4.21M|static inline int imax(const int a, const int b) {
   36|  4.21M|    return a > b ? a : b;
  ------------------
  |  Branch (36:12): [True: 2.53M, False: 1.68M]
  ------------------
   37|  4.21M|}
recon_tmpl.c:umin:
   47|   181M|static inline unsigned umin(const unsigned a, const unsigned b) {
   48|   181M|    return a < b ? a : b;
  ------------------
  |  Branch (48:12): [True: 105M, False: 75.7M]
  ------------------
   49|   181M|}
recon_tmpl.c:apply_sign64:
   63|  2.17M|static inline int apply_sign64(const int v, const int64_t s) {
   64|  2.17M|    return s < 0 ? -v : v;
  ------------------
  |  Branch (64:12): [True: 272k, False: 1.89M]
  ------------------
   65|  2.17M|}
recon_tmpl.c:iclip:
   51|   599k|static inline int iclip(const int v, const int min, const int max) {
   52|   599k|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 47.0k, False: 552k]
  |  Branch (52:28): [True: 8.35k, False: 543k]
  ------------------
   53|   599k|}
recon_tmpl.c:apply_sign_bool:
   67|  36.3M|static inline int apply_sign_bool(const int v, const int s) {
   68|  36.3M|    return (v - s) ^ -s;
   69|  36.3M|}
itx_1d.c:iclip:
   51|   951M|static inline int iclip(const int v, const int min, const int max) {
   52|   951M|    return v < min ? min : v > max ? max : v;
  ------------------
  |  Branch (52:12): [True: 8.98M, False: 942M]
  |  Branch (52:28): [True: 8.82M, False: 933M]
  ------------------
   53|   951M|}
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|   259k|static inline int imin(const int a, const int b) {
   40|   259k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 222k, False: 36.7k]
  ------------------
   41|   259k|}
cdef_apply_tmpl.c:ulog2:
   71|   166k|static inline int ulog2(const unsigned v) {
   72|   166k|    return 31 ^ clz(v);
   73|   166k|}
ipred_prepare_tmpl.c:imin:
   39|  30.2M|static inline int imin(const int a, const int b) {
   40|  30.2M|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 27.1M, False: 3.03M]
  ------------------
   41|  30.2M|}
lf_apply_tmpl.c:imin:
   39|   624k|static inline int imin(const int a, const int b) {
   40|   624k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 139k, False: 484k]
  ------------------
   41|   624k|}
lr_apply_tmpl.c:imin:
   39|   115k|static inline int imin(const int a, const int b) {
   40|   115k|    return a < b ? a : b;
  ------------------
  |  Branch (40:12): [True: 54.8k, False: 60.4k]
  ------------------
   41|   115k|}

dav1d_cdef_brow_8bpc:
  111|  38.4k|{
  112|  38.4k|    Dav1dFrameContext *const f = (Dav1dFrameContext *)tc->f;
  113|  38.4k|    const int bitdepth_min_8 = BITDEPTH == 8 ? 0 : f->cur.p.bpc - 8;
  ------------------
  |  Branch (113:32): [True: 38.4k, Folded]
  ------------------
  114|  38.4k|    const Dav1dDSPContext *const dsp = f->dsp;
  115|  38.4k|    enum CdefEdgeFlags edges = CDEF_HAVE_BOTTOM | (by_start > 0 ? CDEF_HAVE_TOP : 0);
  ------------------
  |  Branch (115:52): [True: 37.8k, False: 624]
  ------------------
  116|  38.4k|    pixel *ptrs[3] = { p[0], p[1], p[2] };
  117|  38.4k|    const int sbsz = 16;
  118|  38.4k|    const int sb64w = f->sb128w << 1;
  119|  38.4k|    const int damping = f->frame_hdr->cdef.damping + bitdepth_min_8;
  120|  38.4k|    const enum Dav1dPixelLayout layout = f->cur.p.layout;
  121|  38.4k|    const int uv_idx = DAV1D_PIXEL_LAYOUT_I444 - layout;
  122|  38.4k|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
  123|  38.4k|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
  124|  38.4k|    static const uint8_t uv_dirs[2][8] = { { 0, 1, 2, 3, 4, 5, 6, 7 },
  125|  38.4k|                                           { 7, 0, 2, 4, 5, 6, 6, 6 } };
  126|  38.4k|    const uint8_t *uv_dir = uv_dirs[layout == DAV1D_PIXEL_LAYOUT_I422];
  127|  38.4k|    assert(f->lf.cdef_planes);
  ------------------
  |  Branch (127:5): [True: 38.4k, False: 0]
  ------------------
  128|  38.4k|    assert(BACKUP_2X8_Y == 1 && BACKUP_2X8_UV == 2);
  ------------------
  |  Branch (128:5): [True: 0, Folded]
  |  Branch (128:5): [True: 0, Folded]
  ------------------
  129|  38.4k|    const enum Backup2x8Flags frame_backup_flag = f->lf.cdef_planes;
  130|  38.4k|    const int have_tt = f->c->n_tc > 1;
  131|  38.4k|    const int sb128 = f->seq_hdr->sb128;
  132|  38.4k|    const int resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
  133|  38.4k|    const ptrdiff_t y_stride = PXSTRIDE(f->cur.stride[0]);
  ------------------
  |  |   53|  38.4k|#define PXSTRIDE(x) (x)
  ------------------
  134|  38.4k|    const ptrdiff_t uv_stride = PXSTRIDE(f->cur.stride[1]);
  ------------------
  |  |   53|  38.4k|#define PXSTRIDE(x) (x)
  ------------------
  135|       |
  136|   213k|    for (int bit = 0, by = by_start; by < by_end; by += 2, edges |= CDEF_HAVE_TOP) {
  ------------------
  |  Branch (136:38): [True: 174k, False: 38.4k]
  ------------------
  137|   174k|        const int tf = tc->top_pre_cdef_toggle;
  138|   174k|        const int by_idx = (by & 30) >> 1;
  139|   174k|        if (by + 2 >= f->bh) edges &= ~CDEF_HAVE_BOTTOM;
  ------------------
  |  Branch (139:13): [True: 541, False: 174k]
  ------------------
  140|       |
  141|   174k|        if ((!have_tt || sbrow_start || by + 2 < by_end) &&
  ------------------
  |  Branch (141:14): [True: 174k, False: 0]
  |  Branch (141:26): [True: 0, False: 0]
  |  Branch (141:41): [True: 0, False: 0]
  ------------------
  142|   174k|            edges & CDEF_HAVE_BOTTOM)
  ------------------
  |  Branch (142:13): [True: 174k, False: 541]
  ------------------
  143|   174k|        {
  144|       |            // backup pre-filter data for next iteration
  145|   174k|            pixel *const cdef_top_bak[3] = {
  146|   174k|                f->lf.cdef_line[!tf][0] + have_tt * sby * 4 * y_stride,
  147|   174k|                f->lf.cdef_line[!tf][1] + have_tt * sby * 8 * uv_stride,
  148|   174k|                f->lf.cdef_line[!tf][2] + have_tt * sby * 8 * uv_stride
  149|   174k|            };
  150|   174k|            backup2lines(cdef_top_bak, ptrs, f->cur.stride, layout, frame_backup_flag);
  151|   174k|        }
  152|       |
  153|   174k|        const pixel *top_base[3], *bot_base[3];
  154|   174k|        pixel *const *const lpf = resize ? f->lf.cdef_lpf_line : f->lf.lr_lpf_line;
  ------------------
  |  Branch (154:35): [True: 10.4k, False: 164k]
  ------------------
  155|   174k|        if (have_tt && sbrow_start && by == by_start) {
  ------------------
  |  Branch (155:13): [True: 0, False: 174k]
  |  Branch (155:24): [True: 0, False: 0]
  |  Branch (155:39): [True: 0, False: 0]
  ------------------
  156|      0|            const int line = resize ? (sby - 1) * 4 : sby * (4 << sb128) - 4;
  ------------------
  |  Branch (156:30): [True: 0, False: 0]
  ------------------
  157|      0|            for (int pl = 0; pl < 3; pl++)
  ------------------
  |  Branch (157:30): [True: 0, False: 0]
  ------------------
  158|      0|                top_base[pl] = &lpf[pl][line * (pl ? uv_stride : y_stride)];
  ------------------
  |  Branch (158:49): [True: 0, False: 0]
  ------------------
  159|   174k|        } else {
  160|   174k|            top_base[0] = &f->lf.cdef_line[tf][0][have_tt * sby * 4 * y_stride];
  161|   174k|            top_base[1] = &f->lf.cdef_line[tf][1][have_tt * sby * 8 * uv_stride];
  162|   174k|            top_base[2] = &f->lf.cdef_line[tf][2][have_tt * sby * 8 * uv_stride];
  163|   174k|        }
  164|   174k|        if (have_tt && !sbrow_start && by + 2 >= by_end) {
  ------------------
  |  Branch (164:13): [True: 0, False: 174k]
  |  Branch (164:24): [True: 0, False: 0]
  |  Branch (164:40): [True: 0, False: 0]
  ------------------
  165|      0|            const int line = resize ? sby * 4 + 2 : sby * (4 << sb128) + 4 * sb128 + 2;
  ------------------
  |  Branch (165:30): [True: 0, False: 0]
  ------------------
  166|      0|            for (int pl = 0; pl < 3; pl++)
  ------------------
  |  Branch (166:30): [True: 0, False: 0]
  ------------------
  167|      0|                bot_base[pl] = &lpf[pl][line * (pl ? uv_stride : y_stride)];
  ------------------
  |  Branch (167:49): [True: 0, False: 0]
  ------------------
  168|   174k|        } else {
  169|   174k|            bot_base[0] = ptrs[0] + 8 * y_stride;
  170|   174k|            bot_base[1] = ptrs[1] + (8 >> ss_ver) * uv_stride;
  171|   174k|            bot_base[2] = ptrs[2] + (8 >> ss_ver) * uv_stride;
  172|   174k|        }
  173|       |
  174|   174k|        ALIGN_STK_16(pixel, lr_bak, 2 /* idx */, [3 /* plane */][8 /* y */][2 /* x */]);
  ------------------
  |  |  100|   174k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|   174k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  175|   174k|        enum Backup2x8Flags prev_flag = 0;
  176|   596k|        for (int sbx = 0; sbx < sb64w; sbx++) {
  ------------------
  |  Branch (176:27): [True: 421k, False: 174k]
  ------------------
  177|   421k|            const int sb128x = sbx >> 1;
  178|   421k|            const int sb64_idx = ((by & sbsz) >> 3) + (sbx & 1);
  179|   421k|            const int cdef_idx = lflvl[sb128x].cdef_idx[sb64_idx];
  180|   421k|            unsigned row_mask = lflvl[sb128x].noskip_mask[by_idx][sbx & 1];
  181|   421k|            const int y_lvl = cdef_idx == -1 ? 0 : f->frame_hdr->cdef.y_strength[cdef_idx];
  ------------------
  |  Branch (181:31): [True: 354k, False: 66.6k]
  ------------------
  182|   421k|            const int uv_lvl = cdef_idx == -1 ? 0 : f->frame_hdr->cdef.uv_strength[cdef_idx];
  ------------------
  |  Branch (182:32): [True: 354k, False: 66.6k]
  ------------------
  183|   421k|            if (!row_mask || !(y_lvl | uv_lvl)) {
  ------------------
  |  Branch (183:17): [True: 365k, False: 55.9k]
  |  Branch (183:30): [True: 2.44k, False: 53.4k]
  ------------------
  184|   368k|                prev_flag = 0;
  185|   368k|                continue;
  186|   368k|            }
  187|       |
  188|  53.4k|            const enum Backup2x8Flags flag = (!!y_lvl) | ((!!uv_lvl) << 1);
  189|       |
  190|  53.4k|            const int y_pri_lvl = (y_lvl >> 2) << bitdepth_min_8;
  191|  53.4k|            int y_sec_lvl = y_lvl & 3;
  192|  53.4k|            y_sec_lvl += y_sec_lvl == 3;
  193|  53.4k|            y_sec_lvl <<= bitdepth_min_8;
  194|       |
  195|  53.4k|            const int uv_pri_lvl = (uv_lvl >> 2) << bitdepth_min_8;
  196|  53.4k|            int uv_sec_lvl = uv_lvl & 3;
  197|  53.4k|            uv_sec_lvl += uv_sec_lvl == 3;
  198|  53.4k|            uv_sec_lvl <<= bitdepth_min_8;
  199|       |
  200|  53.4k|            const int bx_base = sbx * sbsz, bx_limit = imin(sbsz, f->bw - bx_base);
  201|   396k|            while (row_mask) {
  ------------------
  |  Branch (201:20): [True: 354k, False: 42.8k]
  ------------------
  202|   354k|                const int bx_off = ctz(row_mask) & ~1;
  203|   354k|                row_mask &= ~(3U << bx_off);
  204|   354k|                if (bx_off >= bx_limit) break;
  ------------------
  |  Branch (204:21): [True: 10.6k, False: 343k]
  ------------------
  205|       |
  206|   343k|                const int bx = bx_base + bx_off;
  207|   343k|                const int have_right = bx + 2 < f->bw;
  208|   343k|                const enum CdefEdgeFlags b_edges = edges |
  209|   343k|                    (bx > 0 ? CDEF_HAVE_LEFT : 0) | (have_right ? CDEF_HAVE_RIGHT : 0);
  ------------------
  |  Branch (209:22): [True: 330k, False: 13.3k]
  |  Branch (209:54): [True: 329k, False: 13.6k]
  ------------------
  210|       |
  211|   343k|                const ptrdiff_t x_y = (ptrdiff_t) bx * 4, x_uv = x_y >> ss_hor;
  212|   343k|                pixel *const bptrs[3] = { ptrs[0] + x_y, ptrs[1] + x_uv, ptrs[2] + x_uv };
  213|       |
  214|   343k|                const enum Backup2x8Flags do_left = (prev_flag ^ flag) & flag;
  215|   343k|                if (do_left && bx > 0)
  ------------------
  |  Branch (215:21): [True: 20.6k, False: 322k]
  |  Branch (215:32): [True: 7.29k, False: 13.3k]
  ------------------
  216|  7.29k|                    backup2x8(lr_bak[bit], bptrs, f->cur.stride, 0, layout, do_left);
  217|   343k|                if (have_right &&
  ------------------
  |  Branch (217:21): [True: 329k, False: 13.6k]
  ------------------
  218|   329k|                    (bx_off < 14 ? ((row_mask >> (bx_off + 2)) & 3)
  ------------------
  |  Branch (218:21): [True: 323k, False: 5.93k]
  |  Branch (218:22): [True: 292k, False: 37.3k]
  ------------------
  219|   329k|                                 : (lflvl[(sbx + 1) >> 1].noskip_mask[by_idx][(sbx + 1) & 1] & 3)))
  220|   323k|                {
  221|   323k|                    backup2x8(lr_bak[!bit], bptrs, f->cur.stride, 8, layout, flag);
  222|   323k|                    prev_flag = flag;
  223|   323k|                } else {
  224|  19.6k|                    prev_flag = 0;
  225|  19.6k|                }
  226|       |
  227|   343k|                int dir;
  228|   343k|                unsigned variance;
  229|   343k|                if (y_pri_lvl || uv_pri_lvl)
  ------------------
  |  Branch (229:21): [True: 311k, False: 31.8k]
  |  Branch (229:34): [True: 22.7k, False: 9.06k]
  ------------------
  230|   334k|                    dir = dsp->cdef.dir(bptrs[0], f->cur.stride[0],
  231|   334k|                                        &variance HIGHBD_CALL_SUFFIX);
  232|       |
  233|   343k|                if (y_lvl) {
  ------------------
  |  Branch (233:21): [True: 322k, False: 21.3k]
  ------------------
  234|   322k|                    const int adj_y_pri_lvl = y_pri_lvl ? adjust_strength(y_pri_lvl, variance) : 0;
  ------------------
  |  Branch (234:47): [True: 311k, False: 10.5k]
  ------------------
  235|   322k|                    if (adj_y_pri_lvl || y_sec_lvl)
  ------------------
  |  Branch (235:25): [True: 162k, False: 159k]
  |  Branch (235:42): [True: 76.8k, False: 82.9k]
  ------------------
  236|   239k|                        dsp->cdef.fb[0](bptrs[0], f->cur.stride[0], lr_bak[bit][0],
  237|   239k|                                        top_base[0] + x_y, bot_base[0] + x_y,
  238|   239k|                                        adj_y_pri_lvl, y_sec_lvl,
  239|   239k|                                        y_pri_lvl ? dir : 0, damping,
  ------------------
  |  Branch (239:41): [True: 228k, False: 10.5k]
  ------------------
  240|   239k|                                        b_edges HIGHBD_CALL_SUFFIX);
  241|   322k|                }
  242|   343k|                if (uv_lvl) {
  ------------------
  |  Branch (242:21): [True: 245k, False: 98.3k]
  ------------------
  243|   245k|                    assert(layout != DAV1D_PIXEL_LAYOUT_I400);
  ------------------
  |  Branch (243:21): [True: 245k, False: 0]
  ------------------
  244|   245k|                    const int uvdir = uv_pri_lvl ? uv_dir[dir] : 0;
  ------------------
  |  Branch (244:39): [True: 241k, False: 3.62k]
  ------------------
  245|   735k|                    for (int pl = 1; pl <= 2; pl++)
  ------------------
  |  Branch (245:38): [True: 490k, False: 245k]
  ------------------
  246|   490k|                        dsp->cdef.fb[uv_idx](bptrs[pl], f->cur.stride[1], lr_bak[bit][pl],
  247|   490k|                                             top_base[pl] + x_uv, bot_base[pl] + x_uv,
  248|   490k|                                             uv_pri_lvl, uv_sec_lvl, uvdir,
  249|   490k|                                             damping - 1, b_edges HIGHBD_CALL_SUFFIX);
  250|   245k|                }
  251|       |
  252|   343k|                bit ^= 1;
  253|   343k|            }
  254|  53.4k|        }
  255|       |
  256|   174k|        ptrs[0] += 8 * y_stride;
  257|   174k|        ptrs[1] += (8 >> ss_ver) * uv_stride;
  258|   174k|        ptrs[2] += (8 >> ss_ver) * uv_stride;
  259|   174k|        tc->top_pre_cdef_toggle ^= 1;
  260|   174k|    }
  261|  38.4k|}
cdef_apply_tmpl.c:backup2lines:
   45|   242k|{
   46|   242k|    if (flag & BACKUP_2X8_Y) {
  ------------------
  |  Branch (46:9): [True: 228k, False: 13.6k]
  ------------------
   47|   228k|        const ptrdiff_t y_stride = PXSTRIDE(stride[0]);
  ------------------
  |  |   53|   228k|#define PXSTRIDE(x) (x)
  ------------------
   48|   228k|        if (y_stride < 0)
  ------------------
  |  Branch (48:13): [True: 0, False: 228k]
  ------------------
   49|      0|            pixel_copy(dst[0] + y_stride, src[0] + 7 * y_stride, -2 * y_stride);
  ------------------
  |  |   47|      0|#define pixel_copy memcpy
  ------------------
   50|   228k|        else
   51|   228k|            pixel_copy(dst[0], src[0] + 6 * y_stride, 2 * y_stride);
  ------------------
  |  |   47|   228k|#define pixel_copy memcpy
  ------------------
   52|   228k|    }
   53|       |
   54|   242k|    if (flag & BACKUP_2X8_UV) {
  ------------------
  |  Branch (54:9): [True: 85.6k, False: 156k]
  ------------------
   55|  85.6k|        assert(layout != DAV1D_PIXEL_LAYOUT_I400);
  ------------------
  |  Branch (55:9): [True: 85.6k, False: 0]
  ------------------
   56|  85.6k|        const ptrdiff_t uv_stride = PXSTRIDE(stride[1]);
  ------------------
  |  |   53|  85.6k|#define PXSTRIDE(x) (x)
  ------------------
   57|  85.6k|        if (uv_stride < 0) {
  ------------------
  |  Branch (57:13): [True: 0, False: 85.6k]
  ------------------
   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|  85.6k|        } else {
   62|  85.6k|            const int uv_off = layout == DAV1D_PIXEL_LAYOUT_I420 ? 2 : 6;
  ------------------
  |  Branch (62:32): [True: 50.8k, False: 34.7k]
  ------------------
   63|  85.6k|            pixel_copy(dst[1], src[1] + uv_off * uv_stride, 2 * uv_stride);
  ------------------
  |  |   47|  85.6k|#define pixel_copy memcpy
  ------------------
   64|  85.6k|            pixel_copy(dst[2], src[2] + uv_off * uv_stride, 2 * uv_stride);
  ------------------
  |  |   47|  85.6k|#define pixel_copy memcpy
  ------------------
   65|  85.6k|        }
   66|  85.6k|    }
   67|   242k|}
cdef_apply_tmpl.c:backup2x8:
   74|   559k|{
   75|   559k|    ptrdiff_t y_off = 0;
   76|   559k|    if (flag & BACKUP_2X8_Y) {
  ------------------
  |  Branch (76:9): [True: 522k, False: 37.1k]
  ------------------
   77|   522k|        const ptrdiff_t y_stride = PXSTRIDE(src_stride[0]);
  ------------------
  |  |   53|   522k|#define PXSTRIDE(x) (x)
  ------------------
   78|   522k|        const pixel *src0 = &src[0][x_off - 2];
   79|  4.70M|        for (int y = 0; y < 8; y++, y_off += y_stride)
  ------------------
  |  Branch (79:25): [True: 4.18M, False: 522k]
  ------------------
   80|  4.18M|            pixel_copy(dst[0][y], &src0[y_off], 2);
  ------------------
  |  |   47|  4.18M|#define pixel_copy memcpy
  ------------------
   81|   522k|    }
   82|       |
   83|   559k|    if (!(flag & BACKUP_2X8_UV))
  ------------------
  |  Branch (83:9): [True: 224k, False: 335k]
  ------------------
   84|   224k|        return;
   85|   559k|    assert(layout != DAV1D_PIXEL_LAYOUT_I400);
  ------------------
  |  Branch (85:5): [True: 335k, False: 0]
  ------------------
   86|       |
   87|   335k|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
   88|   335k|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
   89|       |
   90|   335k|    x_off >>= ss_hor;
   91|   335k|    y_off = 0;
   92|   335k|    const ptrdiff_t uv_stride = PXSTRIDE(src_stride[1]);
  ------------------
  |  |   53|   335k|#define PXSTRIDE(x) (x)
  ------------------
   93|   335k|    const pixel *src1 = &src[1][x_off - 2], *const src2 = &src[2][x_off - 2];
   94|  1.96M|    for (int y = 0; y < (8 >> ss_ver); y++, y_off += uv_stride) {
  ------------------
  |  Branch (94:21): [True: 1.62M, False: 335k]
  ------------------
   95|  1.62M|        pixel_copy(dst[1][y], &src1[y_off], 2);
  ------------------
  |  |   47|  1.62M|#define pixel_copy memcpy
  ------------------
   96|  1.62M|        pixel_copy(dst[2][y], &src2[y_off], 2);
  ------------------
  |  |   47|  1.62M|#define pixel_copy memcpy
  ------------------
   97|  1.62M|    }
   98|   335k|}
cdef_apply_tmpl.c:adjust_strength:
  100|   513k|static int adjust_strength(const int strength, const unsigned var) {
  101|   513k|    if (!var) return 0;
  ------------------
  |  Branch (101:9): [True: 309k, False: 204k]
  ------------------
  102|   204k|    const int i = var >> 6 ? imin(ulog2(var >> 6), 12) : 0;
  ------------------
  |  Branch (102:19): [True: 166k, False: 37.8k]
  ------------------
  103|   204k|    return (strength * (4 + i) + 8) >> 4;
  104|   513k|}
dav1d_cdef_brow_16bpc:
  111|  13.1k|{
  112|  13.1k|    Dav1dFrameContext *const f = (Dav1dFrameContext *)tc->f;
  113|  13.1k|    const int bitdepth_min_8 = BITDEPTH == 8 ? 0 : f->cur.p.bpc - 8;
  ------------------
  |  Branch (113:32): [Folded, False: 13.1k]
  ------------------
  114|  13.1k|    const Dav1dDSPContext *const dsp = f->dsp;
  115|  13.1k|    enum CdefEdgeFlags edges = CDEF_HAVE_BOTTOM | (by_start > 0 ? CDEF_HAVE_TOP : 0);
  ------------------
  |  Branch (115:52): [True: 12.4k, False: 770]
  ------------------
  116|  13.1k|    pixel *ptrs[3] = { p[0], p[1], p[2] };
  117|  13.1k|    const int sbsz = 16;
  118|  13.1k|    const int sb64w = f->sb128w << 1;
  119|  13.1k|    const int damping = f->frame_hdr->cdef.damping + bitdepth_min_8;
  120|  13.1k|    const enum Dav1dPixelLayout layout = f->cur.p.layout;
  121|  13.1k|    const int uv_idx = DAV1D_PIXEL_LAYOUT_I444 - layout;
  122|  13.1k|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
  123|  13.1k|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
  124|  13.1k|    static const uint8_t uv_dirs[2][8] = { { 0, 1, 2, 3, 4, 5, 6, 7 },
  125|  13.1k|                                           { 7, 0, 2, 4, 5, 6, 6, 6 } };
  126|  13.1k|    const uint8_t *uv_dir = uv_dirs[layout == DAV1D_PIXEL_LAYOUT_I422];
  127|  13.1k|    assert(f->lf.cdef_planes);
  ------------------
  |  Branch (127:5): [True: 13.1k, False: 0]
  ------------------
  128|  13.1k|    assert(BACKUP_2X8_Y == 1 && BACKUP_2X8_UV == 2);
  ------------------
  |  Branch (128:5): [True: 0, Folded]
  |  Branch (128:5): [True: 0, Folded]
  ------------------
  129|  13.1k|    const enum Backup2x8Flags frame_backup_flag = f->lf.cdef_planes;
  130|  13.1k|    const int have_tt = f->c->n_tc > 1;
  131|  13.1k|    const int sb128 = f->seq_hdr->sb128;
  132|  13.1k|    const int resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
  133|  13.1k|    const ptrdiff_t y_stride = PXSTRIDE(f->cur.stride[0]);
  134|  13.1k|    const ptrdiff_t uv_stride = PXSTRIDE(f->cur.stride[1]);
  135|       |
  136|  82.1k|    for (int bit = 0, by = by_start; by < by_end; by += 2, edges |= CDEF_HAVE_TOP) {
  ------------------
  |  Branch (136:38): [True: 68.9k, False: 13.1k]
  ------------------
  137|  68.9k|        const int tf = tc->top_pre_cdef_toggle;
  138|  68.9k|        const int by_idx = (by & 30) >> 1;
  139|  68.9k|        if (by + 2 >= f->bh) edges &= ~CDEF_HAVE_BOTTOM;
  ------------------
  |  Branch (139:13): [True: 659, False: 68.3k]
  ------------------
  140|       |
  141|  68.9k|        if ((!have_tt || sbrow_start || by + 2 < by_end) &&
  ------------------
  |  Branch (141:14): [True: 68.9k, False: 0]
  |  Branch (141:26): [True: 0, False: 0]
  |  Branch (141:41): [True: 0, False: 0]
  ------------------
  142|  68.9k|            edges & CDEF_HAVE_BOTTOM)
  ------------------
  |  Branch (142:13): [True: 68.3k, False: 659]
  ------------------
  143|  68.3k|        {
  144|       |            // backup pre-filter data for next iteration
  145|  68.3k|            pixel *const cdef_top_bak[3] = {
  146|  68.3k|                f->lf.cdef_line[!tf][0] + have_tt * sby * 4 * y_stride,
  147|  68.3k|                f->lf.cdef_line[!tf][1] + have_tt * sby * 8 * uv_stride,
  148|  68.3k|                f->lf.cdef_line[!tf][2] + have_tt * sby * 8 * uv_stride
  149|  68.3k|            };
  150|  68.3k|            backup2lines(cdef_top_bak, ptrs, f->cur.stride, layout, frame_backup_flag);
  151|  68.3k|        }
  152|       |
  153|  68.9k|        const pixel *top_base[3], *bot_base[3];
  154|  68.9k|        pixel *const *const lpf = resize ? f->lf.cdef_lpf_line : f->lf.lr_lpf_line;
  ------------------
  |  Branch (154:35): [True: 8.09k, False: 60.8k]
  ------------------
  155|  68.9k|        if (have_tt && sbrow_start && by == by_start) {
  ------------------
  |  Branch (155:13): [True: 0, False: 68.9k]
  |  Branch (155:24): [True: 0, False: 0]
  |  Branch (155:39): [True: 0, False: 0]
  ------------------
  156|      0|            const int line = resize ? (sby - 1) * 4 : sby * (4 << sb128) - 4;
  ------------------
  |  Branch (156:30): [True: 0, False: 0]
  ------------------
  157|      0|            for (int pl = 0; pl < 3; pl++)
  ------------------
  |  Branch (157:30): [True: 0, False: 0]
  ------------------
  158|      0|                top_base[pl] = &lpf[pl][line * (pl ? uv_stride : y_stride)];
  ------------------
  |  Branch (158:49): [True: 0, False: 0]
  ------------------
  159|  68.9k|        } else {
  160|  68.9k|            top_base[0] = &f->lf.cdef_line[tf][0][have_tt * sby * 4 * y_stride];
  161|  68.9k|            top_base[1] = &f->lf.cdef_line[tf][1][have_tt * sby * 8 * uv_stride];
  162|  68.9k|            top_base[2] = &f->lf.cdef_line[tf][2][have_tt * sby * 8 * uv_stride];
  163|  68.9k|        }
  164|  68.9k|        if (have_tt && !sbrow_start && by + 2 >= by_end) {
  ------------------
  |  Branch (164:13): [True: 0, False: 68.9k]
  |  Branch (164:24): [True: 0, False: 0]
  |  Branch (164:40): [True: 0, False: 0]
  ------------------
  165|      0|            const int line = resize ? sby * 4 + 2 : sby * (4 << sb128) + 4 * sb128 + 2;
  ------------------
  |  Branch (165:30): [True: 0, False: 0]
  ------------------
  166|      0|            for (int pl = 0; pl < 3; pl++)
  ------------------
  |  Branch (166:30): [True: 0, False: 0]
  ------------------
  167|      0|                bot_base[pl] = &lpf[pl][line * (pl ? uv_stride : y_stride)];
  ------------------
  |  Branch (167:49): [True: 0, False: 0]
  ------------------
  168|  68.9k|        } else {
  169|  68.9k|            bot_base[0] = ptrs[0] + 8 * y_stride;
  170|  68.9k|            bot_base[1] = ptrs[1] + (8 >> ss_ver) * uv_stride;
  171|  68.9k|            bot_base[2] = ptrs[2] + (8 >> ss_ver) * uv_stride;
  172|  68.9k|        }
  173|       |
  174|  68.9k|        ALIGN_STK_16(pixel, lr_bak, 2 /* idx */, [3 /* plane */][8 /* y */][2 /* x */]);
  ------------------
  |  |  100|  68.9k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  68.9k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  175|  68.9k|        enum Backup2x8Flags prev_flag = 0;
  176|   253k|        for (int sbx = 0; sbx < sb64w; sbx++) {
  ------------------
  |  Branch (176:27): [True: 185k, False: 68.9k]
  ------------------
  177|   185k|            const int sb128x = sbx >> 1;
  178|   185k|            const int sb64_idx = ((by & sbsz) >> 3) + (sbx & 1);
  179|   185k|            const int cdef_idx = lflvl[sb128x].cdef_idx[sb64_idx];
  180|   185k|            unsigned row_mask = lflvl[sb128x].noskip_mask[by_idx][sbx & 1];
  181|   185k|            const int y_lvl = cdef_idx == -1 ? 0 : f->frame_hdr->cdef.y_strength[cdef_idx];
  ------------------
  |  Branch (181:31): [True: 136k, False: 48.9k]
  ------------------
  182|   185k|            const int uv_lvl = cdef_idx == -1 ? 0 : f->frame_hdr->cdef.uv_strength[cdef_idx];
  ------------------
  |  Branch (182:32): [True: 136k, False: 48.9k]
  ------------------
  183|   185k|            if (!row_mask || !(y_lvl | uv_lvl)) {
  ------------------
  |  Branch (183:17): [True: 142k, False: 42.4k]
  |  Branch (183:30): [True: 2.57k, False: 39.8k]
  ------------------
  184|   145k|                prev_flag = 0;
  185|   145k|                continue;
  186|   145k|            }
  187|       |
  188|  39.8k|            const enum Backup2x8Flags flag = (!!y_lvl) | ((!!uv_lvl) << 1);
  189|       |
  190|  39.8k|            const int y_pri_lvl = (y_lvl >> 2) << bitdepth_min_8;
  191|  39.8k|            int y_sec_lvl = y_lvl & 3;
  192|  39.8k|            y_sec_lvl += y_sec_lvl == 3;
  193|  39.8k|            y_sec_lvl <<= bitdepth_min_8;
  194|       |
  195|  39.8k|            const int uv_pri_lvl = (uv_lvl >> 2) << bitdepth_min_8;
  196|  39.8k|            int uv_sec_lvl = uv_lvl & 3;
  197|  39.8k|            uv_sec_lvl += uv_sec_lvl == 3;
  198|  39.8k|            uv_sec_lvl <<= bitdepth_min_8;
  199|       |
  200|  39.8k|            const int bx_base = sbx * sbsz, bx_limit = imin(sbsz, f->bw - bx_base);
  201|   283k|            while (row_mask) {
  ------------------
  |  Branch (201:20): [True: 255k, False: 27.3k]
  ------------------
  202|   255k|                const int bx_off = ctz(row_mask) & ~1;
  203|   255k|                row_mask &= ~(3U << bx_off);
  204|   255k|                if (bx_off >= bx_limit) break;
  ------------------
  |  Branch (204:21): [True: 12.4k, False: 243k]
  ------------------
  205|       |
  206|   243k|                const int bx = bx_base + bx_off;
  207|   243k|                const int have_right = bx + 2 < f->bw;
  208|   243k|                const enum CdefEdgeFlags b_edges = edges |
  209|   243k|                    (bx > 0 ? CDEF_HAVE_LEFT : 0) | (have_right ? CDEF_HAVE_RIGHT : 0);
  ------------------
  |  Branch (209:22): [True: 227k, False: 15.7k]
  |  Branch (209:54): [True: 227k, False: 15.4k]
  ------------------
  210|       |
  211|   243k|                const ptrdiff_t x_y = (ptrdiff_t) bx * 4, x_uv = x_y >> ss_hor;
  212|   243k|                pixel *const bptrs[3] = { ptrs[0] + x_y, ptrs[1] + x_uv, ptrs[2] + x_uv };
  213|       |
  214|   243k|                const enum Backup2x8Flags do_left = (prev_flag ^ flag) & flag;
  215|   243k|                if (do_left && bx > 0)
  ------------------
  |  Branch (215:21): [True: 18.6k, False: 224k]
  |  Branch (215:32): [True: 2.89k, False: 15.7k]
  ------------------
  216|  2.89k|                    backup2x8(lr_bak[bit], bptrs, f->cur.stride, 0, layout, do_left);
  217|   243k|                if (have_right &&
  ------------------
  |  Branch (217:21): [True: 227k, False: 15.4k]
  ------------------
  218|   227k|                    (bx_off < 14 ? ((row_mask >> (bx_off + 2)) & 3)
  ------------------
  |  Branch (218:21): [True: 225k, False: 2.29k]
  |  Branch (218:22): [True: 204k, False: 23.5k]
  ------------------
  219|   227k|                                 : (lflvl[(sbx + 1) >> 1].noskip_mask[by_idx][(sbx + 1) & 1] & 3)))
  220|   225k|                {
  221|   225k|                    backup2x8(lr_bak[!bit], bptrs, f->cur.stride, 8, layout, flag);
  222|   225k|                    prev_flag = flag;
  223|   225k|                } else {
  224|  17.6k|                    prev_flag = 0;
  225|  17.6k|                }
  226|       |
  227|   243k|                int dir;
  228|   243k|                unsigned variance;
  229|   243k|                if (y_pri_lvl || uv_pri_lvl)
  ------------------
  |  Branch (229:21): [True: 202k, False: 41.0k]
  |  Branch (229:34): [True: 18.6k, False: 22.4k]
  ------------------
  230|   220k|                    dir = dsp->cdef.dir(bptrs[0], f->cur.stride[0],
  231|   220k|                                        &variance HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   220k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
  232|       |
  233|   243k|                if (y_lvl) {
  ------------------
  |  Branch (233:21): [True: 225k, False: 18.1k]
  ------------------
  234|   225k|                    const int adj_y_pri_lvl = y_pri_lvl ? adjust_strength(y_pri_lvl, variance) : 0;
  ------------------
  |  Branch (234:47): [True: 202k, False: 22.9k]
  ------------------
  235|   225k|                    if (adj_y_pri_lvl || y_sec_lvl)
  ------------------
  |  Branch (235:25): [True: 34.7k, False: 190k]
  |  Branch (235:42): [True: 139k, False: 51.0k]
  ------------------
  236|   174k|                        dsp->cdef.fb[0](bptrs[0], f->cur.stride[0], lr_bak[bit][0],
  237|   174k|                                        top_base[0] + x_y, bot_base[0] + x_y,
  238|   174k|                                        adj_y_pri_lvl, y_sec_lvl,
  239|   174k|                                        y_pri_lvl ? dir : 0, damping,
  ------------------
  |  Branch (239:41): [True: 151k, False: 22.9k]
  ------------------
  240|   174k|                                        b_edges HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   174k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
  241|   225k|                }
  242|   243k|                if (uv_lvl) {
  ------------------
  |  Branch (242:21): [True: 104k, False: 138k]
  ------------------
  243|   104k|                    assert(layout != DAV1D_PIXEL_LAYOUT_I400);
  ------------------
  |  Branch (243:21): [True: 104k, False: 0]
  ------------------
  244|   104k|                    const int uvdir = uv_pri_lvl ? uv_dir[dir] : 0;
  ------------------
  |  Branch (244:39): [True: 101k, False: 3.30k]
  ------------------
  245|   314k|                    for (int pl = 1; pl <= 2; pl++)
  ------------------
  |  Branch (245:38): [True: 209k, False: 104k]
  ------------------
  246|   209k|                        dsp->cdef.fb[uv_idx](bptrs[pl], f->cur.stride[1], lr_bak[bit][pl],
  247|   209k|                                             top_base[pl] + x_uv, bot_base[pl] + x_uv,
  248|   209k|                                             uv_pri_lvl, uv_sec_lvl, uvdir,
  249|   209k|                                             damping - 1, b_edges HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   209k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
  250|   104k|                }
  251|       |
  252|   243k|                bit ^= 1;
  253|   243k|            }
  254|  39.8k|        }
  255|       |
  256|  68.9k|        ptrs[0] += 8 * y_stride;
  257|  68.9k|        ptrs[1] += (8 >> ss_ver) * uv_stride;
  258|  68.9k|        ptrs[2] += (8 >> ss_ver) * uv_stride;
  259|  68.9k|        tc->top_pre_cdef_toggle ^= 1;
  260|  68.9k|    }
  261|  13.1k|}

dav1d_cdef_dsp_init_8bpc:
  320|  3.82k|COLD void bitfn(dav1d_cdef_dsp_init)(Dav1dCdefDSPContext *const c) {
  321|  3.82k|    c->dir = cdef_find_dir_c;
  322|  3.82k|    c->fb[0] = cdef_filter_block_8x8_c;
  323|  3.82k|    c->fb[1] = cdef_filter_block_4x8_c;
  324|  3.82k|    c->fb[2] = cdef_filter_block_4x4_c;
  325|       |
  326|  3.82k|#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|  3.82k|#endif
  339|  3.82k|}
dav1d_cdef_dsp_init_16bpc:
  320|  5.54k|COLD void bitfn(dav1d_cdef_dsp_init)(Dav1dCdefDSPContext *const c) {
  321|  5.54k|    c->dir = cdef_find_dir_c;
  322|  5.54k|    c->fb[0] = cdef_filter_block_8x8_c;
  323|  5.54k|    c->fb[1] = cdef_filter_block_4x8_c;
  324|  5.54k|    c->fb[2] = cdef_filter_block_4x4_c;
  325|       |
  326|  5.54k|#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.54k|#endif
  339|  5.54k|}

dav1d_cdf_thread_update:
 3918|  12.4k|{
 3919|  12.4k|#define update_cdf_1d(n1d, name) \
 3920|  12.4k|    do { \
 3921|  12.4k|        dst->name[n1d] = 0; \
 3922|  12.4k|    } while (0)
 3923|  12.4k|#define update_cdf_2d(n1d, n2d, name) \
 3924|  12.4k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
 3925|  12.4k|#define update_cdf_3d(n1d, n2d, n3d, name) \
 3926|  12.4k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
 3927|  12.4k|#define update_cdf_4d(n1d, n2d, n3d, n4d, name) \
 3928|  12.4k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
 3929|       |
 3930|  12.4k|    memcpy(dst, src, offsetof(CdfContext, m.intrabc));
 3931|       |
 3932|  12.4k|    update_cdf_3d(2, 2, 4, coef.eob_bin_16);
  ------------------
  |  | 3926|  37.2k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  74.4k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  49.6k|    do { \
  |  |  |  |  |  | 3921|  49.6k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  49.6k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 49.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 49.6k, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 24.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3933|  12.4k|    update_cdf_3d(2, 2, 5, coef.eob_bin_32);
  ------------------
  |  | 3926|  37.2k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  74.4k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  49.6k|    do { \
  |  |  |  |  |  | 3921|  49.6k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  49.6k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 49.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 49.6k, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 24.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3934|  12.4k|    update_cdf_3d(2, 2, 6, coef.eob_bin_64);
  ------------------
  |  | 3926|  37.2k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  74.4k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  49.6k|    do { \
  |  |  |  |  |  | 3921|  49.6k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  49.6k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 49.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 49.6k, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 24.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3935|  12.4k|    update_cdf_3d(2, 2, 7, coef.eob_bin_128);
  ------------------
  |  | 3926|  37.2k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  74.4k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  49.6k|    do { \
  |  |  |  |  |  | 3921|  49.6k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  49.6k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 49.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 49.6k, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 24.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3936|  12.4k|    update_cdf_3d(2, 2, 8, coef.eob_bin_256);
  ------------------
  |  | 3926|  37.2k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  74.4k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  49.6k|    do { \
  |  |  |  |  |  | 3921|  49.6k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  49.6k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 49.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 49.6k, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 24.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3937|  12.4k|    update_cdf_2d(2, 9, coef.eob_bin_512);
  ------------------
  |  | 3924|  37.2k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  24.8k|    do { \
  |  |  |  | 3921|  24.8k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  24.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 24.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3938|  12.4k|    update_cdf_2d(2, 10, coef.eob_bin_1024);
  ------------------
  |  | 3924|  37.2k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  24.8k|    do { \
  |  |  |  | 3921|  24.8k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  24.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 24.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3939|  12.4k|    update_cdf_4d(N_TX_SIZES, 2, 4, 2, coef.eob_base_tok);
  ------------------
  |  | 3928|  74.4k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   186k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3924|   620k|    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: 124k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 124k, False: 62.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 62.0k, False: 12.4k]
  |  |  ------------------
  ------------------
 3940|  12.4k|    update_cdf_4d(N_TX_SIZES, 2, 41 /*42*/, 3, coef.base_tok);
  ------------------
  |  | 3928|  74.4k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   186k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3924|  5.21M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3920|  5.08M|    do { \
  |  |  |  |  |  |  |  | 3921|  5.08M|        dst->name[n1d] = 0; \
  |  |  |  |  |  |  |  | 3922|  5.08M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 5.08M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3924:21): [True: 5.08M, False: 124k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 124k, False: 62.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 62.0k, False: 12.4k]
  |  |  ------------------
  ------------------
 3941|  12.4k|    update_cdf_4d(4, 2, 21, 3, coef.br_tok);
  ------------------
  |  | 3928|  62.0k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   148k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3924|  2.18M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3920|  2.08M|    do { \
  |  |  |  |  |  |  |  | 3921|  2.08M|        dst->name[n1d] = 0; \
  |  |  |  |  |  |  |  | 3922|  2.08M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 2.08M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3924:21): [True: 2.08M, False: 99.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 99.2k, False: 49.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 49.6k, False: 12.4k]
  |  |  ------------------
  ------------------
 3942|  12.4k|    update_cdf_4d(N_TX_SIZES, 2, 9, 1, coef.eob_hi_bit);
  ------------------
  |  | 3928|  74.4k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   186k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3924|  1.24M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3920|  1.11M|    do { \
  |  |  |  |  |  |  |  | 3921|  1.11M|        dst->name[n1d] = 0; \
  |  |  |  |  |  |  |  | 3922|  1.11M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 1.11M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3924:21): [True: 1.11M, False: 124k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 124k, False: 62.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 62.0k, False: 12.4k]
  |  |  ------------------
  ------------------
 3943|  12.4k|    update_cdf_3d(N_TX_SIZES, 13, 1, coef.skip);
  ------------------
  |  | 3926|  74.4k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   868k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   806k|    do { \
  |  |  |  |  |  | 3921|   806k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   806k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 806k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 806k, False: 62.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 62.0k, False: 12.4k]
  |  |  ------------------
  ------------------
 3944|  12.4k|    update_cdf_3d(2, 3, 1, coef.dc_sign);
  ------------------
  |  | 3926|  37.2k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  99.2k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  74.4k|    do { \
  |  |  |  |  |  | 3921|  74.4k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  74.4k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 74.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 74.4k, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 24.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3945|       |
 3946|  12.4k|    update_cdf_3d(2, N_INTRA_PRED_MODES, N_UV_INTRA_PRED_MODES - 1 - !k, m.uv_mode);
  ------------------
  |  | 3926|  37.2k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   347k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   322k|    do { \
  |  |  |  |  |  | 3921|   322k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   322k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 322k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 322k, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 24.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3947|  12.4k|    update_cdf_2d(4, N_PARTITIONS - 3, m.partition[BL_128X128]);
  ------------------
  |  | 3924|  62.0k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  49.6k|    do { \
  |  |  |  | 3921|  49.6k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  49.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 49.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 49.6k, False: 12.4k]
  |  |  ------------------
  ------------------
 3948|  49.6k|    for (int k = BL_64X64; k < BL_8X8; k++)
  ------------------
  |  Branch (3948:28): [True: 37.2k, False: 12.4k]
  ------------------
 3949|  37.2k|        update_cdf_2d(4, N_PARTITIONS - 1, m.partition[k]);
  ------------------
  |  | 3924|   186k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   148k|    do { \
  |  |  |  | 3921|   148k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   148k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 148k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 148k, False: 37.2k]
  |  |  ------------------
  ------------------
 3950|  12.4k|    update_cdf_2d(4, N_SUB8X8_PARTITIONS - 1, m.partition[BL_8X8]);
  ------------------
  |  | 3924|  62.0k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  49.6k|    do { \
  |  |  |  | 3921|  49.6k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  49.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 49.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 49.6k, False: 12.4k]
  |  |  ------------------
  ------------------
 3951|  12.4k|    update_cdf_2d(6, 15, m.cfl_alpha);
  ------------------
  |  | 3924|  86.8k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  74.4k|    do { \
  |  |  |  | 3921|  74.4k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  74.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 74.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 74.4k, False: 12.4k]
  |  |  ------------------
  ------------------
 3952|  12.4k|    update_cdf_2d(2, 15, m.txtp_inter1);
  ------------------
  |  | 3924|  37.2k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  24.8k|    do { \
  |  |  |  | 3921|  24.8k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  24.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 24.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3953|  12.4k|    update_cdf_1d(11, m.txtp_inter2);
  ------------------
  |  | 3920|  12.4k|    do { \
  |  | 3921|  12.4k|        dst->name[n1d] = 0; \
  |  | 3922|  12.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.4k]
  |  |  ------------------
  ------------------
 3954|  12.4k|    update_cdf_3d(2, N_INTRA_PRED_MODES, 6, m.txtp_intra1);
  ------------------
  |  | 3926|  37.2k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   347k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   322k|    do { \
  |  |  |  |  |  | 3921|   322k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   322k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 322k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 322k, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 24.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3955|  12.4k|    update_cdf_3d(3, N_INTRA_PRED_MODES, 4, m.txtp_intra2);
  ------------------
  |  | 3926|  49.6k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   521k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   484k|    do { \
  |  |  |  |  |  | 3921|   484k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   484k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 484k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 484k, False: 37.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 37.2k, False: 12.4k]
  |  |  ------------------
  ------------------
 3956|  12.4k|    update_cdf_1d(7, m.cfl_sign);
  ------------------
  |  | 3920|  12.4k|    do { \
  |  | 3921|  12.4k|        dst->name[n1d] = 0; \
  |  | 3922|  12.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.4k]
  |  |  ------------------
  ------------------
 3957|  12.4k|    update_cdf_2d(8, 6, m.angle_delta);
  ------------------
  |  | 3924|   111k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  99.2k|    do { \
  |  |  |  | 3921|  99.2k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  99.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 99.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 99.2k, False: 12.4k]
  |  |  ------------------
  ------------------
 3958|  12.4k|    update_cdf_1d(4, m.filter_intra);
  ------------------
  |  | 3920|  12.4k|    do { \
  |  | 3921|  12.4k|        dst->name[n1d] = 0; \
  |  | 3922|  12.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.4k]
  |  |  ------------------
  ------------------
 3959|  12.4k|    update_cdf_2d(3, DAV1D_MAX_SEGMENTS - 1, m.seg_id);
  ------------------
  |  | 3924|  49.6k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  37.2k|    do { \
  |  |  |  | 3921|  37.2k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  37.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 37.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 37.2k, False: 12.4k]
  |  |  ------------------
  ------------------
 3960|  12.4k|    update_cdf_3d(2, 7, 6, m.pal_sz);
  ------------------
  |  | 3926|  37.2k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   198k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   173k|    do { \
  |  |  |  |  |  | 3921|   173k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   173k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 173k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 173k, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 24.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3961|  12.4k|    update_cdf_4d(2, 7, 5, k + 1, m.color_map);
  ------------------
  |  | 3928|  37.2k|    for (int l = 0; l < (n1d); l++) update_cdf_3d(n2d, n3d, n4d, name[l])
  |  |  ------------------
  |  |  |  | 3926|   198k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3924|  1.04M|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 3920|   868k|    do { \
  |  |  |  |  |  |  |  | 3921|   868k|        dst->name[n1d] = 0; \
  |  |  |  |  |  |  |  | 3922|   868k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 868k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3924:21): [True: 868k, False: 173k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3926:21): [True: 173k, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3928:21): [True: 24.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3962|  12.4k|    update_cdf_3d(N_TX_SIZES - 1, 3, imin(k + 1, 2), m.txsz);
  ------------------
  |  | 3926|  62.0k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   198k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   148k|    do { \
  |  |  |  |  |  | 3921|   148k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   148k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 148k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 148k, False: 49.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 49.6k, False: 12.4k]
  |  |  ------------------
  ------------------
 3963|  12.4k|    update_cdf_1d(3, m.delta_q);
  ------------------
  |  | 3920|  12.4k|    do { \
  |  | 3921|  12.4k|        dst->name[n1d] = 0; \
  |  | 3922|  12.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.4k]
  |  |  ------------------
  ------------------
 3964|  12.4k|    update_cdf_2d(5, 3, m.delta_lf);
  ------------------
  |  | 3924|  74.4k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  62.0k|    do { \
  |  |  |  | 3921|  62.0k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  62.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 62.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 62.0k, False: 12.4k]
  |  |  ------------------
  ------------------
 3965|  12.4k|    update_cdf_1d(2, m.restore_switchable);
  ------------------
  |  | 3920|  12.4k|    do { \
  |  | 3921|  12.4k|        dst->name[n1d] = 0; \
  |  | 3922|  12.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.4k]
  |  |  ------------------
  ------------------
 3966|  12.4k|    update_cdf_1d(1, m.restore_wiener);
  ------------------
  |  | 3920|  12.4k|    do { \
  |  | 3921|  12.4k|        dst->name[n1d] = 0; \
  |  | 3922|  12.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.4k]
  |  |  ------------------
  ------------------
 3967|  12.4k|    update_cdf_1d(1, m.restore_sgrproj);
  ------------------
  |  | 3920|  12.4k|    do { \
  |  | 3921|  12.4k|        dst->name[n1d] = 0; \
  |  | 3922|  12.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 12.4k]
  |  |  ------------------
  ------------------
 3968|  12.4k|    update_cdf_2d(4, 1, m.txtp_inter3);
  ------------------
  |  | 3924|  62.0k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  49.6k|    do { \
  |  |  |  | 3921|  49.6k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  49.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 49.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 49.6k, False: 12.4k]
  |  |  ------------------
  ------------------
 3969|  12.4k|    update_cdf_2d(N_BS_SIZES, 1, m.use_filter_intra);
  ------------------
  |  | 3924|   285k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   273k|    do { \
  |  |  |  | 3921|   273k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   273k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 273k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 273k, False: 12.4k]
  |  |  ------------------
  ------------------
 3970|  12.4k|    update_cdf_3d(7, 3, 1, m.txpart);
  ------------------
  |  | 3926|  99.2k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   347k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   260k|    do { \
  |  |  |  |  |  | 3921|   260k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   260k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 260k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 260k, False: 86.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 86.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3971|  12.4k|    update_cdf_2d(3, 1, m.skip);
  ------------------
  |  | 3924|  49.6k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  37.2k|    do { \
  |  |  |  | 3921|  37.2k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  37.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 37.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 37.2k, False: 12.4k]
  |  |  ------------------
  ------------------
 3972|  12.4k|    update_cdf_3d(7, 3, 1, m.pal_y);
  ------------------
  |  | 3926|  99.2k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   347k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   260k|    do { \
  |  |  |  |  |  | 3921|   260k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   260k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 260k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 260k, False: 86.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 86.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3973|  12.4k|    update_cdf_2d(2, 1, m.pal_uv);
  ------------------
  |  | 3924|  37.2k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  24.8k|    do { \
  |  |  |  | 3921|  24.8k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  24.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 24.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 24.8k, False: 12.4k]
  |  |  ------------------
  ------------------
 3974|       |
 3975|  12.4k|    if (IS_KEY_OR_INTRA(hdr))
  ------------------
  |  |   43|  12.4k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  12.4k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 4.64k, False: 7.76k]
  |  |  ------------------
  ------------------
 3976|  4.64k|        return;
 3977|       |
 3978|  7.76k|    memcpy(dst->m.y_mode, src->m.y_mode,
 3979|  7.76k|           offsetof(CdfContext, kfym) - offsetof(CdfContext, m.y_mode));
 3980|       |
 3981|  7.76k|    update_cdf_2d(4, N_INTRA_PRED_MODES - 1, m.y_mode);
  ------------------
  |  | 3924|  38.8k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  38.8k|    do { \
  |  |  |  | 3921|  31.0k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  31.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 31.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 31.0k, False: 7.76k]
  |  |  ------------------
  ------------------
 3982|  7.76k|    update_cdf_2d(9, 15, m.wedge_idx);
  ------------------
  |  | 3924|  77.6k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  77.6k|    do { \
  |  |  |  | 3921|  69.8k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  69.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 69.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 69.8k, False: 7.76k]
  |  |  ------------------
  ------------------
 3983|  7.76k|    update_cdf_2d(8, N_COMP_INTER_PRED_MODES - 1, m.comp_inter_mode);
  ------------------
  |  | 3924|  69.8k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  69.8k|    do { \
  |  |  |  | 3921|  62.1k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  62.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 62.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 62.1k, False: 7.76k]
  |  |  ------------------
  ------------------
 3984|  7.76k|    update_cdf_3d(2, 8, DAV1D_N_SWITCHABLE_FILTERS - 1, m.filter);
  ------------------
  |  | 3926|  23.2k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   139k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   132k|    do { \
  |  |  |  |  |  | 3921|   124k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   124k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 124k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 124k, False: 15.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 15.5k, False: 7.76k]
  |  |  ------------------
  ------------------
 3985|  7.76k|    update_cdf_2d(4, 3, m.interintra_mode);
  ------------------
  |  | 3924|  38.8k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  38.8k|    do { \
  |  |  |  | 3921|  31.0k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  31.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 31.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 31.0k, False: 7.76k]
  |  |  ------------------
  ------------------
 3986|  7.76k|    update_cdf_2d(N_BS_SIZES, 2, m.motion_mode);
  ------------------
  |  | 3924|   178k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   178k|    do { \
  |  |  |  | 3921|   170k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   170k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 170k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 170k, False: 7.76k]
  |  |  ------------------
  ------------------
 3987|  7.76k|    update_cdf_2d(3, 1, m.skip_mode);
  ------------------
  |  | 3924|  31.0k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  31.0k|    do { \
  |  |  |  | 3921|  23.2k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  23.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 23.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 23.2k, False: 7.76k]
  |  |  ------------------
  ------------------
 3988|  7.76k|    update_cdf_2d(6, 1, m.newmv_mode);
  ------------------
  |  | 3924|  54.3k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  54.3k|    do { \
  |  |  |  | 3921|  46.5k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  46.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 46.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 46.5k, False: 7.76k]
  |  |  ------------------
  ------------------
 3989|  7.76k|    update_cdf_2d(2, 1, m.globalmv_mode);
  ------------------
  |  | 3924|  23.2k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  23.2k|    do { \
  |  |  |  | 3921|  15.5k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  15.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 15.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 15.5k, False: 7.76k]
  |  |  ------------------
  ------------------
 3990|  7.76k|    update_cdf_2d(6, 1, m.refmv_mode);
  ------------------
  |  | 3924|  54.3k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  54.3k|    do { \
  |  |  |  | 3921|  46.5k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  46.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 46.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 46.5k, False: 7.76k]
  |  |  ------------------
  ------------------
 3991|  7.76k|    update_cdf_2d(3, 1, m.drl_bit);
  ------------------
  |  | 3924|  31.0k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  31.0k|    do { \
  |  |  |  | 3921|  23.2k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  23.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 23.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 23.2k, False: 7.76k]
  |  |  ------------------
  ------------------
 3992|  7.76k|    update_cdf_2d(4, 1, m.intra);
  ------------------
  |  | 3924|  38.8k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  38.8k|    do { \
  |  |  |  | 3921|  31.0k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  31.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 31.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 31.0k, False: 7.76k]
  |  |  ------------------
  ------------------
 3993|  7.76k|    update_cdf_2d(5, 1, m.comp);
  ------------------
  |  | 3924|  46.5k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  46.5k|    do { \
  |  |  |  | 3921|  38.8k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  38.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 38.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 38.8k, False: 7.76k]
  |  |  ------------------
  ------------------
 3994|  7.76k|    update_cdf_2d(5, 1, m.comp_dir);
  ------------------
  |  | 3924|  46.5k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  46.5k|    do { \
  |  |  |  | 3921|  38.8k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  38.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 38.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 38.8k, False: 7.76k]
  |  |  ------------------
  ------------------
 3995|  7.76k|    update_cdf_2d(6, 1, m.jnt_comp);
  ------------------
  |  | 3924|  54.3k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  54.3k|    do { \
  |  |  |  | 3921|  46.5k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  46.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 46.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 46.5k, False: 7.76k]
  |  |  ------------------
  ------------------
 3996|  7.76k|    update_cdf_2d(6, 1, m.mask_comp);
  ------------------
  |  | 3924|  54.3k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  54.3k|    do { \
  |  |  |  | 3921|  46.5k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  46.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 46.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 46.5k, False: 7.76k]
  |  |  ------------------
  ------------------
 3997|  7.76k|    update_cdf_2d(9, 1, m.wedge_comp);
  ------------------
  |  | 3924|  77.6k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  77.6k|    do { \
  |  |  |  | 3921|  69.8k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  69.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 69.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 69.8k, False: 7.76k]
  |  |  ------------------
  ------------------
 3998|  7.76k|    update_cdf_3d(6, 3, 1, m.ref);
  ------------------
  |  | 3926|  54.3k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|   186k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|   147k|    do { \
  |  |  |  |  |  | 3921|   139k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|   139k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 139k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 139k, False: 46.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 46.5k, False: 7.76k]
  |  |  ------------------
  ------------------
 3999|  7.76k|    update_cdf_3d(3, 3, 1, m.comp_fwd_ref);
  ------------------
  |  | 3926|  31.0k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  93.1k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  77.6k|    do { \
  |  |  |  |  |  | 3921|  69.8k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  69.8k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 69.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 69.8k, False: 23.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 23.2k, False: 7.76k]
  |  |  ------------------
  ------------------
 4000|  7.76k|    update_cdf_3d(2, 3, 1, m.comp_bwd_ref);
  ------------------
  |  | 3926|  23.2k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  62.1k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  54.3k|    do { \
  |  |  |  |  |  | 3921|  46.5k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  46.5k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 46.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 46.5k, False: 15.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 15.5k, False: 7.76k]
  |  |  ------------------
  ------------------
 4001|  7.76k|    update_cdf_3d(3, 3, 1, m.comp_uni_ref);
  ------------------
  |  | 3926|  31.0k|    for (int k = 0; k < (n1d); k++) update_cdf_2d(n2d, n3d, name[k])
  |  |  ------------------
  |  |  |  | 3924|  93.1k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  |  |  ------------------
  |  |  |  |  |  | 3920|  77.6k|    do { \
  |  |  |  |  |  | 3921|  69.8k|        dst->name[n1d] = 0; \
  |  |  |  |  |  | 3922|  69.8k|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (3922:14): [Folded, False: 69.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3924:21): [True: 69.8k, False: 23.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3926:21): [True: 23.2k, False: 7.76k]
  |  |  ------------------
  ------------------
 4002|  7.76k|    update_cdf_2d(3, 1, m.seg_pred);
  ------------------
  |  | 3924|  31.0k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  31.0k|    do { \
  |  |  |  | 3921|  23.2k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  23.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 23.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 23.2k, False: 7.76k]
  |  |  ------------------
  ------------------
 4003|  7.76k|    update_cdf_2d(4, 1, m.interintra);
  ------------------
  |  | 3924|  38.8k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  38.8k|    do { \
  |  |  |  | 3921|  31.0k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  31.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 31.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 31.0k, False: 7.76k]
  |  |  ------------------
  ------------------
 4004|  7.76k|    update_cdf_2d(7, 1, m.interintra_wedge);
  ------------------
  |  | 3924|  62.1k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  62.1k|    do { \
  |  |  |  | 3921|  54.3k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  54.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 54.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 54.3k, False: 7.76k]
  |  |  ------------------
  ------------------
 4005|  7.76k|    update_cdf_2d(N_BS_SIZES, 1, m.obmc);
  ------------------
  |  | 3924|   178k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   178k|    do { \
  |  |  |  | 3921|   170k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   170k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 170k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 170k, False: 7.76k]
  |  |  ------------------
  ------------------
 4006|       |
 4007|  23.2k|    for (int k = 0; k < 2; k++) {
  ------------------
  |  Branch (4007:21): [True: 15.5k, False: 7.76k]
  ------------------
 4008|  15.5k|        update_cdf_1d(10, mv.comp[k].classes);
  ------------------
  |  | 3920|  15.5k|    do { \
  |  | 3921|  15.5k|        dst->name[n1d] = 0; \
  |  | 3922|  15.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
 4009|  15.5k|        update_cdf_1d(1, mv.comp[k].sign);
  ------------------
  |  | 3920|  15.5k|    do { \
  |  | 3921|  15.5k|        dst->name[n1d] = 0; \
  |  | 3922|  15.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
 4010|  15.5k|        update_cdf_1d(1, mv.comp[k].class0);
  ------------------
  |  | 3920|  15.5k|    do { \
  |  | 3921|  15.5k|        dst->name[n1d] = 0; \
  |  | 3922|  15.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
 4011|  15.5k|        update_cdf_2d(2, 3, mv.comp[k].class0_fp);
  ------------------
  |  | 3924|  46.5k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|  31.0k|    do { \
  |  |  |  | 3921|  31.0k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|  31.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 31.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 31.0k, False: 15.5k]
  |  |  ------------------
  ------------------
 4012|  15.5k|        update_cdf_1d(1, mv.comp[k].class0_hp);
  ------------------
  |  | 3920|  15.5k|    do { \
  |  | 3921|  15.5k|        dst->name[n1d] = 0; \
  |  | 3922|  15.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
 4013|  15.5k|        update_cdf_2d(10, 1, mv.comp[k].classN);
  ------------------
  |  | 3924|   170k|    for (int j = 0; j < (n1d); j++) update_cdf_1d(n2d, name[j])
  |  |  ------------------
  |  |  |  | 3920|   155k|    do { \
  |  |  |  | 3921|   155k|        dst->name[n1d] = 0; \
  |  |  |  | 3922|   155k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3922:14): [Folded, False: 155k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3924:21): [True: 155k, False: 15.5k]
  |  |  ------------------
  ------------------
 4014|  15.5k|        update_cdf_1d(3, mv.comp[k].classN_fp);
  ------------------
  |  | 3920|  15.5k|    do { \
  |  | 3921|  15.5k|        dst->name[n1d] = 0; \
  |  | 3922|  15.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
 4015|  15.5k|        update_cdf_1d(1, mv.comp[k].classN_hp);
  ------------------
  |  | 3920|  15.5k|    do { \
  |  | 3921|  15.5k|        dst->name[n1d] = 0; \
  |  | 3922|  15.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
 4016|  15.5k|    }
 4017|  7.76k|    update_cdf_1d(N_MV_JOINTS - 1, mv.joint);
  ------------------
  |  | 3920|  7.76k|    do { \
  |  | 3921|  7.76k|        dst->name[n1d] = 0; \
  |  | 3922|  7.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (3922:14): [Folded, False: 7.76k]
  |  |  ------------------
  ------------------
 4018|  7.76k|}
dav1d_cdf_thread_init_static:
 4023|  33.4k|void dav1d_cdf_thread_init_static(CdfThreadContext *const cdf, const unsigned qidx) {
 4024|       |    cdf->ref = NULL;
 4025|  33.4k|    cdf->data.qcat = (qidx > 20) + (qidx > 60) + (qidx > 120);
 4026|  33.4k|}
dav1d_cdf_thread_copy:
 4028|  64.7k|void dav1d_cdf_thread_copy(CdfContext *const dst, const CdfThreadContext *const src) {
 4029|  64.7k|    if (src->ref) {
  ------------------
  |  Branch (4029:9): [True: 15.4k, False: 49.3k]
  ------------------
 4030|  15.4k|        memcpy(dst, src->data.cdf, sizeof(*dst));
 4031|  49.3k|    } else {
 4032|  49.3k|        dst->coef = default_coef_cdf[src->data.qcat];
 4033|  49.3k|        memcpy(&dst->m, &default_cdf.m,
 4034|  49.3k|               offsetof(CdfDefaultContext, mv.joint));
 4035|  49.3k|        memcpy(&dst->mv.comp[1], &default_cdf.mv.comp,
 4036|       |               sizeof(default_cdf) - offsetof(CdfDefaultContext, mv.comp));
 4037|  49.3k|    }
 4038|  64.7k|}
dav1d_cdf_thread_alloc:
 4042|  14.7k|{
 4043|  14.7k|    cdf->ref = dav1d_ref_create_using_pool(c->cdf_pool,
 4044|  14.7k|                                           sizeof(CdfContext) + sizeof(atomic_uint));
 4045|  14.7k|    if (!cdf->ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (4045:9): [True: 0, False: 14.7k]
  ------------------
 4046|  14.7k|    cdf->data.cdf = cdf->ref->data;
 4047|  14.7k|    if (have_frame_mt) {
  ------------------
  |  Branch (4047:9): [True: 0, False: 14.7k]
  ------------------
 4048|      0|        cdf->progress = (atomic_uint *) &cdf->data.cdf[1];
 4049|       |        atomic_init(cdf->progress, 0);
 4050|      0|    }
 4051|  14.7k|    return 0;
 4052|  14.7k|}
dav1d_cdf_thread_ref:
 4056|   345k|{
 4057|   345k|    *dst = *src;
 4058|   345k|    if (src->ref)
  ------------------
  |  Branch (4058:9): [True: 91.5k, False: 254k]
  ------------------
 4059|  91.5k|        dav1d_ref_inc(src->ref);
 4060|   345k|}
dav1d_cdf_thread_unref:
 4062|   825k|void dav1d_cdf_thread_unref(CdfThreadContext *const cdf) {
 4063|       |    memset(&cdf->data, 0, sizeof(*cdf) - offsetof(CdfThreadContext, data));
 4064|   825k|    dav1d_ref_dec(&cdf->ref);
 4065|   825k|}

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|  11.2k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  11.2k|    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|  11.2k|    return flags;
  134|  11.2k|}
refmvs.c:dav1d_get_cpu_flags:
  124|  11.2k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  11.2k|    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|  11.2k|    return flags;
  134|  11.2k|}
lf_mask.c:dav1d_get_cpu_flags:
  124|  11.2k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  11.2k|    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|  11.2k|    return flags;
  134|  11.2k|}
msac.c:dav1d_get_cpu_flags:
  124|  49.9k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  49.9k|    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|  49.9k|    return flags;
  134|  49.9k|}
cdef_tmpl.c:dav1d_get_cpu_flags:
  124|  9.37k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  9.37k|    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|  9.37k|    return flags;
  134|  9.37k|}
filmgrain_tmpl.c:dav1d_get_cpu_flags:
  124|  9.37k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  9.37k|    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|  9.37k|    return flags;
  134|  9.37k|}
ipred_tmpl.c:dav1d_get_cpu_flags:
  124|  9.37k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  9.37k|    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|  9.37k|    return flags;
  134|  9.37k|}
itx_tmpl.c:dav1d_get_cpu_flags:
  124|  9.37k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  9.37k|    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|  9.37k|    return flags;
  134|  9.37k|}
loopfilter_tmpl.c:dav1d_get_cpu_flags:
  124|  9.37k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  9.37k|    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|  9.37k|    return flags;
  134|  9.37k|}
looprestoration_tmpl.c:dav1d_get_cpu_flags:
  124|  9.37k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  9.37k|    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|  9.37k|    return flags;
  134|  9.37k|}
mc_tmpl.c:dav1d_get_cpu_flags:
  124|  9.37k|static ALWAYS_INLINE unsigned dav1d_get_cpu_flags(void) {
  125|  9.37k|    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|  9.37k|    return flags;
  134|  9.37k|}

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

lf_mask.c:dav1d_memset_likely_pow2:
   44|  1.63M|static inline void dav1d_memset_likely_pow2(void *const ptr, const int value, const int n) {
   45|  1.63M|    assert(n >= 1 && n <= 32);
  ------------------
  |  Branch (45:5): [True: 1.63M, False: 0]
  |  Branch (45:5): [True: 1.63M, False: 0]
  ------------------
   46|  1.63M|    if ((n&(n-1)) == 0) {
  ------------------
  |  Branch (46:9): [True: 1.55M, False: 80.5k]
  ------------------
   47|  1.55M|        dav1d_memset_pow2[ulog2(n)](ptr, value);
   48|  1.55M|    } else {
   49|  80.5k|        memset(ptr, value, n);
   50|  80.5k|    }
   51|  1.63M|}
recon_tmpl.c:dav1d_memset_likely_pow2:
   44|  17.5M|static inline void dav1d_memset_likely_pow2(void *const ptr, const int value, const int n) {
   45|  17.5M|    assert(n >= 1 && n <= 32);
  ------------------
  |  Branch (45:5): [True: 17.5M, False: 0]
  |  Branch (45:5): [True: 17.5M, False: 0]
  ------------------
   46|  17.5M|    if ((n&(n-1)) == 0) {
  ------------------
  |  Branch (46:9): [True: 17.3M, False: 195k]
  ------------------
   47|  17.3M|        dav1d_memset_pow2[ulog2(n)](ptr, value);
   48|  17.3M|    } else {
   49|   195k|        memset(ptr, value, n);
   50|   195k|    }
   51|  17.5M|}

dav1d_data_create_internal:
   43|  80.2k|uint8_t *dav1d_data_create_internal(Dav1dData *const buf, const size_t sz) {
   44|  80.2k|    validate_input_or_ret(buf != NULL, NULL);
  ------------------
  |  |   52|  80.2k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 80.2k]
  |  |  ------------------
  |  |   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|  80.2k|    if (sz > SIZE_MAX / 2) return NULL;
  ------------------
  |  Branch (46:9): [True: 0, False: 80.2k]
  ------------------
   47|  80.2k|    buf->ref = dav1d_ref_create(ALLOC_DAV1DDATA, sz);
  ------------------
  |  |   49|  80.2k|#define dav1d_ref_create(type, size) dav1d_ref_create(size)
  ------------------
   48|  80.2k|    if (!buf->ref) return NULL;
  ------------------
  |  Branch (48:9): [True: 0, False: 80.2k]
  ------------------
   49|  80.2k|    buf->data = buf->ref->const_data;
   50|  80.2k|    buf->sz = sz;
   51|  80.2k|    dav1d_data_props_set_defaults(&buf->m);
   52|  80.2k|    buf->m.size = sz;
   53|       |
   54|  80.2k|    return buf->ref->data;
   55|  80.2k|}
dav1d_data_ref:
   98|   128k|void dav1d_data_ref(Dav1dData *const dst, const Dav1dData *const src) {
   99|   128k|    assert(dst != NULL);
  ------------------
  |  Branch (99:5): [True: 128k, False: 0]
  ------------------
  100|   128k|    assert(dst->data == NULL);
  ------------------
  |  Branch (100:5): [True: 128k, False: 0]
  ------------------
  101|   128k|    assert(src != NULL);
  ------------------
  |  Branch (101:5): [True: 128k, False: 0]
  ------------------
  102|       |
  103|   128k|    if (src->ref) {
  ------------------
  |  Branch (103:9): [True: 128k, False: 0]
  ------------------
  104|   128k|        assert(src->data != NULL);
  ------------------
  |  Branch (104:9): [True: 128k, False: 0]
  ------------------
  105|   128k|        dav1d_ref_inc(src->ref);
  106|   128k|    }
  107|   128k|    if (src->m.user_data.ref) dav1d_ref_inc(src->m.user_data.ref);
  ------------------
  |  Branch (107:9): [True: 0, False: 128k]
  ------------------
  108|   128k|    *dst = *src;
  109|   128k|}
dav1d_data_props_copy:
  113|   116k|{
  114|   116k|    assert(dst != NULL);
  ------------------
  |  Branch (114:5): [True: 116k, False: 0]
  ------------------
  115|   116k|    assert(src != NULL);
  ------------------
  |  Branch (115:5): [True: 116k, False: 0]
  ------------------
  116|       |
  117|   116k|    dav1d_ref_dec(&dst->user_data.ref);
  118|   116k|    *dst = *src;
  119|   116k|    if (dst->user_data.ref) dav1d_ref_inc(dst->user_data.ref);
  ------------------
  |  Branch (119:9): [True: 0, False: 116k]
  ------------------
  120|   116k|}
dav1d_data_props_set_defaults:
  122|  1.05M|void dav1d_data_props_set_defaults(Dav1dDataProps *const props) {
  123|  1.05M|    assert(props != NULL);
  ------------------
  |  Branch (123:5): [True: 1.05M, False: 0]
  ------------------
  124|       |
  125|  1.05M|    memset(props, 0, sizeof(*props));
  126|       |    props->timestamp = INT64_MIN;
  127|  1.05M|    props->offset = -1;
  128|  1.05M|}
dav1d_data_props_unref_internal:
  130|  11.2k|void dav1d_data_props_unref_internal(Dav1dDataProps *const props) {
  131|  11.2k|    validate_input(props != NULL);
  ------------------
  |  |   59|  11.2k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|  11.2k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 11.2k]
  |  |  |  |  ------------------
  |  |  |  |   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|  11.2k|    struct Dav1dRef *user_data_ref = props->user_data.ref;
  134|  11.2k|    dav1d_data_props_set_defaults(props);
  135|  11.2k|    dav1d_ref_dec(&user_data_ref);
  136|  11.2k|}
dav1d_data_unref_internal:
  138|   220k|void dav1d_data_unref_internal(Dav1dData *const buf) {
  139|   220k|    validate_input(buf != NULL);
  ------------------
  |  |   59|   220k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|   220k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 220k]
  |  |  |  |  ------------------
  |  |  |  |   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|   220k|    struct Dav1dRef *user_data_ref = buf->m.user_data.ref;
  142|   220k|    if (buf->ref) {
  ------------------
  |  Branch (142:9): [True: 209k, False: 11.2k]
  ------------------
  143|   209k|        validate_input(buf->data != NULL);
  ------------------
  |  |   59|   209k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|   209k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 209k]
  |  |  |  |  ------------------
  |  |  |  |   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|   209k|        dav1d_ref_dec(&buf->ref);
  145|   209k|    }
  146|   220k|    memset(buf, 0, sizeof(*buf));
  147|   220k|    dav1d_data_props_set_defaults(&buf->m);
  148|   220k|    dav1d_ref_dec(&user_data_ref);
  149|   220k|}

dav1d_decode_tile_sbrow:
 2638|   186k|int dav1d_decode_tile_sbrow(Dav1dTaskContext *const t) {
 2639|   186k|    const Dav1dFrameContext *const f = t->f;
 2640|   186k|    const enum BlockLevel root_bl = f->seq_hdr->sb128 ? BL_128X128 : BL_64X64;
  ------------------
  |  Branch (2640:37): [True: 103k, False: 83.4k]
  ------------------
 2641|   186k|    Dav1dTileState *const ts = t->ts;
 2642|   186k|    const Dav1dContext *const c = f->c;
 2643|   186k|    const int sb_step = f->sb_step;
 2644|   186k|    const int tile_row = ts->tiling.row, tile_col = ts->tiling.col;
 2645|   186k|    const int col_sb_start = f->frame_hdr->tiling.col_start_sb[tile_col];
 2646|   186k|    const int col_sb128_start = col_sb_start >> !f->seq_hdr->sb128;
 2647|       |
 2648|   186k|    if (IS_INTER_OR_SWITCH(f->frame_hdr) || f->frame_hdr->allow_intrabc) {
  ------------------
  |  |   36|   373k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 51.4k, False: 135k]
  |  |  ------------------
  ------------------
  |  Branch (2648:45): [True: 92.6k, False: 42.5k]
  ------------------
 2649|   144k|        dav1d_refmvs_tile_sbrow_init(&t->rt, &f->rf, ts->tiling.col_start,
 2650|   144k|                                     ts->tiling.col_end, ts->tiling.row_start,
 2651|   144k|                                     ts->tiling.row_end, t->by >> f->sb_shift,
 2652|   144k|                                     ts->tiling.row, t->frame_thread.pass);
 2653|   144k|    }
 2654|       |
 2655|   186k|    if (IS_INTER_OR_SWITCH(f->frame_hdr) && c->n_fc > 1) {
  ------------------
  |  |   36|   373k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 51.4k, False: 135k]
  |  |  ------------------
  ------------------
  |  Branch (2655:45): [True: 0, False: 51.4k]
  ------------------
 2656|      0|        const int sby = (t->by - ts->tiling.row_start) >> f->sb_shift;
 2657|      0|        int (*const lowest_px)[2] = ts->lowest_pixel[sby];
 2658|      0|        for (int n = 0; n < 7; n++)
  ------------------
  |  Branch (2658:25): [True: 0, False: 0]
  ------------------
 2659|      0|            for (int m = 0; m < 2; m++)
  ------------------
  |  Branch (2659:29): [True: 0, False: 0]
  ------------------
 2660|      0|                lowest_px[n][m] = INT_MIN;
 2661|      0|    }
 2662|       |
 2663|   186k|    reset_context(&t->l, IS_KEY_OR_INTRA(f->frame_hdr), t->frame_thread.pass);
  ------------------
  |  |   43|   186k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|   186k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  ------------------
 2664|   186k|    if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (2664:9): [True: 0, False: 186k]
  ------------------
 2665|      0|        const int off_2pass = c->n_tc > 1 ? f->sb128w * f->frame_hdr->tiling.rows : 0;
  ------------------
  |  Branch (2665:31): [True: 0, False: 0]
  ------------------
 2666|      0|        for (t->bx = ts->tiling.col_start,
 2667|      0|             t->a = f->a + off_2pass + col_sb128_start + tile_row * f->sb128w;
 2668|      0|             t->bx < ts->tiling.col_end; t->bx += sb_step)
  ------------------
  |  Branch (2668:14): [True: 0, False: 0]
  ------------------
 2669|      0|        {
 2670|      0|            if (atomic_load_explicit(c->flush, memory_order_relaxed))
  ------------------
  |  Branch (2670:17): [True: 0, False: 0]
  ------------------
 2671|      0|                return 1;
 2672|      0|            if (decode_sb(t, root_bl, dav1d_intra_edge_tree[root_bl]))
  ------------------
  |  Branch (2672:17): [True: 0, False: 0]
  ------------------
 2673|      0|                return 1;
 2674|      0|            if (t->bx & 16 || f->seq_hdr->sb128)
  ------------------
  |  Branch (2674:17): [True: 0, False: 0]
  |  Branch (2674:31): [True: 0, False: 0]
  ------------------
 2675|      0|                t->a++;
 2676|      0|        }
 2677|      0|        f->bd_fn.backup_ipred_edge(t);
 2678|      0|        return 0;
 2679|      0|    }
 2680|       |
 2681|   186k|    if (f->c->n_tc > 1 && f->frame_hdr->use_ref_frame_mvs) {
  ------------------
  |  Branch (2681:9): [True: 0, False: 186k]
  |  Branch (2681:27): [True: 0, False: 0]
  ------------------
 2682|      0|        f->c->refmvs_dsp.load_tmvs(&f->rf, ts->tiling.row,
 2683|      0|                                   ts->tiling.col_start >> 1, ts->tiling.col_end >> 1,
 2684|      0|                                   t->by >> 1, (t->by + sb_step) >> 1);
 2685|      0|    }
 2686|   186k|    memset(t->pal_sz_uv[1], 0, sizeof(*t->pal_sz_uv));
 2687|   186k|    const int sb128y = t->by >> 5;
 2688|   186k|    for (t->bx = ts->tiling.col_start, t->a = f->a + col_sb128_start + tile_row * f->sb128w,
 2689|   186k|         t->lf_mask = f->lf.mask + sb128y * f->sb128w + col_sb128_start;
 2690|   796k|         t->bx < ts->tiling.col_end; t->bx += sb_step)
  ------------------
  |  Branch (2690:10): [True: 618k, False: 177k]
  ------------------
 2691|   618k|    {
 2692|   618k|        if (atomic_load_explicit(c->flush, memory_order_relaxed))
  ------------------
  |  Branch (2692:13): [True: 0, False: 618k]
  ------------------
 2693|      0|            return 1;
 2694|   618k|        if (root_bl == BL_128X128) {
  ------------------
  |  Branch (2694:13): [True: 230k, False: 388k]
  ------------------
 2695|   230k|            t->cur_sb_cdef_idx_ptr = t->lf_mask->cdef_idx;
 2696|   230k|            t->cur_sb_cdef_idx_ptr[0] = -1;
 2697|   230k|            t->cur_sb_cdef_idx_ptr[1] = -1;
 2698|   230k|            t->cur_sb_cdef_idx_ptr[2] = -1;
 2699|   230k|            t->cur_sb_cdef_idx_ptr[3] = -1;
 2700|   388k|        } else {
 2701|   388k|            t->cur_sb_cdef_idx_ptr =
 2702|   388k|                &t->lf_mask->cdef_idx[((t->bx & 16) >> 4) +
 2703|   388k|                                      ((t->by & 16) >> 3)];
 2704|   388k|            t->cur_sb_cdef_idx_ptr[0] = -1;
 2705|   388k|        }
 2706|       |        // Restoration filter
 2707|  2.47M|        for (int p = 0; p < 3; p++) {
  ------------------
  |  Branch (2707:25): [True: 1.85M, False: 618k]
  ------------------
 2708|  1.85M|            if (!((f->lf.restore_planes >> p) & 1U))
  ------------------
  |  Branch (2708:17): [True: 1.69M, False: 157k]
  ------------------
 2709|  1.69M|                continue;
 2710|       |
 2711|   157k|            const int ss_ver = p && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (2711:32): [True: 66.1k, False: 91.0k]
  |  Branch (2711:37): [True: 25.9k, False: 40.1k]
  ------------------
 2712|   157k|            const int ss_hor = p && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (2712:32): [True: 66.1k, False: 91.0k]
  |  Branch (2712:37): [True: 35.6k, False: 30.4k]
  ------------------
 2713|   157k|            const int unit_size_log2 = f->frame_hdr->restoration.unit_size[!!p];
 2714|   157k|            const int y = t->by * 4 >> ss_ver;
 2715|   157k|            const int h = (f->cur.p.h + ss_ver) >> ss_ver;
 2716|       |
 2717|   157k|            const int unit_size = 1 << unit_size_log2;
 2718|   157k|            const unsigned mask = unit_size - 1;
 2719|   157k|            if (y & mask) continue;
  ------------------
  |  Branch (2719:17): [True: 38.8k, False: 118k]
  ------------------
 2720|   118k|            const int half_unit = unit_size >> 1;
 2721|       |            // Round half up at frame boundaries, if there's more than one
 2722|       |            // restoration unit
 2723|   118k|            if (y && y + half_unit > h) continue;
  ------------------
  |  Branch (2723:17): [True: 43.1k, False: 75.1k]
  |  Branch (2723:22): [True: 1.65k, False: 41.5k]
  ------------------
 2724|       |
 2725|   116k|            const enum Dav1dRestorationType frame_type = f->frame_hdr->restoration.type[p];
 2726|       |
 2727|   116k|            if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (2727:17): [True: 24.6k, False: 92.0k]
  ------------------
 2728|  24.6k|                const int w = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
 2729|  24.6k|                const int n_units = imax(1, (w + half_unit) >> unit_size_log2);
 2730|       |
 2731|  24.6k|                const int d = f->frame_hdr->super_res.width_scale_denominator;
 2732|  24.6k|                const int rnd = unit_size * 8 - 1, shift = unit_size_log2 + 3;
 2733|  24.6k|                const int x0 = ((4 *  t->bx            * d >> ss_hor) + rnd) >> shift;
 2734|  24.6k|                const int x1 = ((4 * (t->bx + sb_step) * d >> ss_hor) + rnd) >> shift;
 2735|       |
 2736|  52.4k|                for (int x = x0; x < imin(x1, n_units); x++) {
  ------------------
  |  Branch (2736:34): [True: 27.8k, False: 24.6k]
  ------------------
 2737|  27.8k|                    const int px_x = x << (unit_size_log2 + ss_hor);
 2738|  27.8k|                    const int sb_idx = (t->by >> 5) * f->sr_sb128w + (px_x >> 7);
 2739|  27.8k|                    const int unit_idx = ((t->by & 16) >> 3) + ((px_x & 64) >> 6);
 2740|  27.8k|                    Av1RestorationUnit *const lr = &f->lf.lr_mask[sb_idx].lr[p][unit_idx];
 2741|       |
 2742|  27.8k|                    read_restoration_info(t, lr, p, frame_type);
 2743|  27.8k|                }
 2744|  92.0k|            } else {
 2745|  92.0k|                const int x = 4 * t->bx >> ss_hor;
 2746|  92.0k|                if (x & mask) continue;
  ------------------
  |  Branch (2746:21): [True: 10.7k, False: 81.2k]
  ------------------
 2747|  81.2k|                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|  81.2k|                if (x && x + half_unit > w) continue;
  ------------------
  |  Branch (2750:21): [True: 49.8k, False: 31.3k]
  |  Branch (2750:26): [True: 654, False: 49.2k]
  ------------------
 2751|  80.5k|                const int sb_idx = (t->by >> 5) * f->sr_sb128w + (t->bx >> 5);
 2752|  80.5k|                const int unit_idx = ((t->by & 16) >> 3) + ((t->bx & 16) >> 4);
 2753|  80.5k|                Av1RestorationUnit *const lr = &f->lf.lr_mask[sb_idx].lr[p][unit_idx];
 2754|       |
 2755|  80.5k|                read_restoration_info(t, lr, p, frame_type);
 2756|  80.5k|            }
 2757|   116k|        }
 2758|   618k|        if (decode_sb(t, root_bl, dav1d_intra_edge_tree[root_bl]))
  ------------------
  |  Branch (2758:13): [True: 9.13k, False: 609k]
  ------------------
 2759|  9.13k|            return 1;
 2760|   609k|        if (t->bx & 16 || f->seq_hdr->sb128) {
  ------------------
  |  Branch (2760:13): [True: 181k, False: 428k]
  |  Branch (2760:27): [True: 224k, False: 204k]
  ------------------
 2761|   405k|            t->a++;
 2762|   405k|            t->lf_mask++;
 2763|   405k|        }
 2764|   609k|    }
 2765|       |
 2766|   177k|    if (f->seq_hdr->ref_frame_mvs && f->c->n_tc > 1 && IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|      0|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2766:9): [True: 120k, False: 57.0k]
  |  Branch (2766:38): [True: 0, False: 120k]
  ------------------
 2767|      0|        dav1d_refmvs_save_tmvs(&f->c->refmvs_dsp, &t->rt,
 2768|      0|                               ts->tiling.col_start >> 1, ts->tiling.col_end >> 1,
 2769|      0|                               t->by >> 1, (t->by + sb_step) >> 1);
 2770|      0|    }
 2771|       |
 2772|       |    // backup pre-loopfilter pixels for intra prediction of the next sbrow
 2773|   177k|    if (t->frame_thread.pass != 1)
  ------------------
  |  Branch (2773:9): [True: 177k, False: 0]
  ------------------
 2774|   177k|        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|   177k|    int align_h = (f->bh + 31) & ~31;
 2779|   177k|    memcpy(&f->lf.tx_lpf_right_edge[0][align_h * tile_col + t->by],
 2780|   177k|           &t->l.tx_lpf_y[t->by & 16], sb_step);
 2781|   177k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2782|   177k|    align_h >>= ss_ver;
 2783|   177k|    memcpy(&f->lf.tx_lpf_right_edge[1][align_h * tile_col + (t->by >> ss_ver)],
 2784|   177k|           &t->l.tx_lpf_uv[(t->by & 16) >> ss_ver], sb_step >> ss_ver);
 2785|       |
 2786|       |    // error out on symbol decoder overread
 2787|   177k|    if (ts->msac.cnt <= -15) return 1;
  ------------------
  |  Branch (2787:9): [True: 15.7k, False: 161k]
  ------------------
 2788|       |
 2789|   161k|    return c->strict_std_compliance &&
  ------------------
  |  Branch (2789:12): [True: 0, False: 161k]
  ------------------
 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|   177k|}
dav1d_decode_frame_init:
 2794|  45.2k|int dav1d_decode_frame_init(Dav1dFrameContext *const f) {
 2795|  45.2k|    const Dav1dContext *const c = f->c;
 2796|  45.2k|    int retval = DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|  45.2k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 2797|       |
 2798|  45.2k|    if (f->sbh > f->lf.start_of_tile_row_sz) {
  ------------------
  |  Branch (2798:9): [True: 9.69k, False: 35.5k]
  ------------------
 2799|  9.69k|        dav1d_free(f->lf.start_of_tile_row);
  ------------------
  |  |  135|  9.69k|#define dav1d_free(ptr) free(ptr)
  ------------------
 2800|  9.69k|        f->lf.start_of_tile_row = dav1d_malloc(ALLOC_TILE, f->sbh * sizeof(uint8_t));
  ------------------
  |  |  132|  9.69k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 2801|  9.69k|        if (!f->lf.start_of_tile_row) {
  ------------------
  |  Branch (2801:13): [True: 0, False: 9.69k]
  ------------------
 2802|      0|            f->lf.start_of_tile_row_sz = 0;
 2803|      0|            goto error;
 2804|      0|        }
 2805|  9.69k|        f->lf.start_of_tile_row_sz = f->sbh;
 2806|  9.69k|    }
 2807|  45.2k|    int sby = 0;
 2808|  94.3k|    for (int tile_row = 0; tile_row < f->frame_hdr->tiling.rows; tile_row++) {
  ------------------
  |  Branch (2808:28): [True: 49.1k, False: 45.2k]
  ------------------
 2809|  49.1k|        f->lf.start_of_tile_row[sby++] = tile_row;
 2810|   633k|        while (sby < f->frame_hdr->tiling.row_start_sb[tile_row + 1])
  ------------------
  |  Branch (2810:16): [True: 584k, False: 49.1k]
  ------------------
 2811|   584k|            f->lf.start_of_tile_row[sby++] = 0;
 2812|  49.1k|    }
 2813|       |
 2814|  45.2k|    const int n_ts = f->frame_hdr->tiling.cols * f->frame_hdr->tiling.rows;
 2815|  45.2k|    if (n_ts != f->n_ts) {
  ------------------
  |  Branch (2815:9): [True: 9.88k, False: 35.3k]
  ------------------
 2816|  9.88k|        if (c->n_fc > 1) {
  ------------------
  |  Branch (2816:13): [True: 0, False: 9.88k]
  ------------------
 2817|      0|            dav1d_free(f->frame_thread.tile_start_off);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
 2818|      0|            f->frame_thread.tile_start_off =
 2819|      0|                dav1d_malloc(ALLOC_TILE, sizeof(*f->frame_thread.tile_start_off) * n_ts);
  ------------------
  |  |  132|      0|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 2820|      0|            if (!f->frame_thread.tile_start_off) {
  ------------------
  |  Branch (2820:17): [True: 0, False: 0]
  ------------------
 2821|      0|                f->n_ts = 0;
 2822|      0|                goto error;
 2823|      0|            }
 2824|      0|        }
 2825|  9.88k|        dav1d_free_aligned(f->ts);
  ------------------
  |  |  136|  9.88k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2826|  9.88k|        f->ts = dav1d_alloc_aligned(ALLOC_TILE, sizeof(*f->ts) * n_ts, 32);
  ------------------
  |  |  134|  9.88k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2827|  9.88k|        if (!f->ts) {
  ------------------
  |  Branch (2827:13): [True: 0, False: 9.88k]
  ------------------
 2828|      0|            f->n_ts = 0;
 2829|      0|            goto error;
 2830|      0|        }
 2831|  9.88k|        f->n_ts = n_ts;
 2832|  9.88k|    }
 2833|       |
 2834|  45.2k|    const int a_sz = f->sb128w * f->frame_hdr->tiling.rows * (1 + (c->n_fc > 1 && c->n_tc > 1));
  ------------------
  |  Branch (2834:68): [True: 0, False: 45.2k]
  |  Branch (2834:83): [True: 0, False: 0]
  ------------------
 2835|  45.2k|    if (a_sz != f->a_sz) {
  ------------------
  |  Branch (2835:9): [True: 10.8k, False: 34.3k]
  ------------------
 2836|  10.8k|        dav1d_free_aligned(f->a);
  ------------------
  |  |  136|  10.8k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2837|  10.8k|        f->a = dav1d_alloc_aligned(ALLOC_TILE, sizeof(*f->a) * a_sz, 16);
  ------------------
  |  |  134|  10.8k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2838|  10.8k|        if (!f->a) {
  ------------------
  |  Branch (2838:13): [True: 0, False: 10.8k]
  ------------------
 2839|      0|            f->a_sz = 0;
 2840|      0|            goto error;
 2841|      0|        }
 2842|  10.8k|        f->a_sz = a_sz;
 2843|  10.8k|    }
 2844|       |
 2845|  45.2k|    const int num_sb128 = f->sb128w * f->sb128h;
 2846|  45.2k|    const uint8_t *const size_mul = ss_size_mul[f->cur.p.layout];
 2847|  45.2k|    const int hbd = !!f->seq_hdr->hbd;
 2848|  45.2k|    if (c->n_fc > 1) {
  ------------------
  |  Branch (2848:9): [True: 0, False: 45.2k]
  ------------------
 2849|      0|        const unsigned sb_step4 = f->sb_step * 4;
 2850|      0|        int tile_idx = 0;
 2851|      0|        for (int tile_row = 0; tile_row < f->frame_hdr->tiling.rows; tile_row++) {
  ------------------
  |  Branch (2851:32): [True: 0, False: 0]
  ------------------
 2852|      0|            const unsigned row_off = f->frame_hdr->tiling.row_start_sb[tile_row] *
 2853|      0|                                     sb_step4 * f->sb128w * 128;
 2854|      0|            const unsigned b_diff = (f->frame_hdr->tiling.row_start_sb[tile_row + 1] -
 2855|      0|                                     f->frame_hdr->tiling.row_start_sb[tile_row]) * sb_step4;
 2856|      0|            for (int tile_col = 0; tile_col < f->frame_hdr->tiling.cols; tile_col++) {
  ------------------
  |  Branch (2856:36): [True: 0, False: 0]
  ------------------
 2857|      0|                f->frame_thread.tile_start_off[tile_idx++] = row_off + b_diff *
 2858|      0|                    f->frame_hdr->tiling.col_start_sb[tile_col] * sb_step4;
 2859|      0|            }
 2860|      0|        }
 2861|       |
 2862|      0|        const int lowest_pixel_mem_sz = f->frame_hdr->tiling.cols * f->sbh;
 2863|      0|        if (lowest_pixel_mem_sz != f->tile_thread.lowest_pixel_mem_sz) {
  ------------------
  |  Branch (2863:13): [True: 0, False: 0]
  ------------------
 2864|      0|            dav1d_free(f->tile_thread.lowest_pixel_mem);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
 2865|      0|            f->tile_thread.lowest_pixel_mem =
 2866|      0|                dav1d_malloc(ALLOC_TILE, lowest_pixel_mem_sz *
  ------------------
  |  |  132|      0|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 2867|      0|                             sizeof(*f->tile_thread.lowest_pixel_mem));
 2868|      0|            if (!f->tile_thread.lowest_pixel_mem) {
  ------------------
  |  Branch (2868:17): [True: 0, False: 0]
  ------------------
 2869|      0|                f->tile_thread.lowest_pixel_mem_sz = 0;
 2870|      0|                goto error;
 2871|      0|            }
 2872|      0|            f->tile_thread.lowest_pixel_mem_sz = lowest_pixel_mem_sz;
 2873|      0|        }
 2874|      0|        int (*lowest_pixel_ptr)[7][2] = f->tile_thread.lowest_pixel_mem;
 2875|      0|        for (int tile_row = 0, tile_row_base = 0; tile_row < f->frame_hdr->tiling.rows;
  ------------------
  |  Branch (2875:51): [True: 0, False: 0]
  ------------------
 2876|      0|             tile_row++, tile_row_base += f->frame_hdr->tiling.cols)
 2877|      0|        {
 2878|      0|            const int tile_row_sb_h = f->frame_hdr->tiling.row_start_sb[tile_row + 1] -
 2879|      0|                                      f->frame_hdr->tiling.row_start_sb[tile_row];
 2880|      0|            for (int tile_col = 0; tile_col < f->frame_hdr->tiling.cols; tile_col++) {
  ------------------
  |  Branch (2880:36): [True: 0, False: 0]
  ------------------
 2881|      0|                f->ts[tile_row_base + tile_col].lowest_pixel = lowest_pixel_ptr;
 2882|      0|                lowest_pixel_ptr += tile_row_sb_h;
 2883|      0|            }
 2884|      0|        }
 2885|       |
 2886|      0|        const int cbi_sz = num_sb128 * size_mul[0];
 2887|      0|        if (cbi_sz != f->frame_thread.cbi_sz) {
  ------------------
  |  Branch (2887:13): [True: 0, False: 0]
  ------------------
 2888|      0|            dav1d_free_aligned(f->frame_thread.cbi);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2889|      0|            f->frame_thread.cbi =
 2890|      0|                dav1d_alloc_aligned(ALLOC_BLOCK, sizeof(*f->frame_thread.cbi) *
  ------------------
  |  |  134|      0|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2891|      0|                                    cbi_sz * 32 * 32 / 4, 64);
 2892|      0|            if (!f->frame_thread.cbi) {
  ------------------
  |  Branch (2892:17): [True: 0, False: 0]
  ------------------
 2893|      0|                f->frame_thread.cbi_sz = 0;
 2894|      0|                goto error;
 2895|      0|            }
 2896|      0|            f->frame_thread.cbi_sz = cbi_sz;
 2897|      0|        }
 2898|       |
 2899|      0|        const int cf_sz = (num_sb128 * size_mul[0]) << hbd;
 2900|      0|        if (cf_sz != f->frame_thread.cf_sz) {
  ------------------
  |  Branch (2900:13): [True: 0, False: 0]
  ------------------
 2901|      0|            dav1d_free_aligned(f->frame_thread.cf);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2902|      0|            f->frame_thread.cf =
 2903|      0|                dav1d_alloc_aligned(ALLOC_COEF, (size_t)cf_sz * 128 * 128 / 2, 64);
  ------------------
  |  |  134|      0|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2904|      0|            if (!f->frame_thread.cf) {
  ------------------
  |  Branch (2904:17): [True: 0, False: 0]
  ------------------
 2905|      0|                f->frame_thread.cf_sz = 0;
 2906|      0|                goto error;
 2907|      0|            }
 2908|      0|            memset(f->frame_thread.cf, 0, (size_t)cf_sz * 128 * 128 / 2);
 2909|      0|            f->frame_thread.cf_sz = cf_sz;
 2910|      0|        }
 2911|       |
 2912|      0|        if (f->frame_hdr->allow_screen_content_tools) {
  ------------------
  |  Branch (2912:13): [True: 0, False: 0]
  ------------------
 2913|      0|            const int pal_sz = num_sb128 << hbd;
 2914|      0|            if (pal_sz != f->frame_thread.pal_sz) {
  ------------------
  |  Branch (2914:17): [True: 0, False: 0]
  ------------------
 2915|      0|                dav1d_free_aligned(f->frame_thread.pal);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2916|      0|                f->frame_thread.pal =
 2917|      0|                    dav1d_alloc_aligned(ALLOC_PAL, sizeof(*f->frame_thread.pal) *
  ------------------
  |  |  134|      0|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2918|      0|                                        pal_sz * 16 * 16, 64);
 2919|      0|                if (!f->frame_thread.pal) {
  ------------------
  |  Branch (2919:21): [True: 0, False: 0]
  ------------------
 2920|      0|                    f->frame_thread.pal_sz = 0;
 2921|      0|                    goto error;
 2922|      0|                }
 2923|      0|                f->frame_thread.pal_sz = pal_sz;
 2924|      0|            }
 2925|       |
 2926|      0|            const int pal_idx_sz = num_sb128 * size_mul[1];
 2927|      0|            if (pal_idx_sz != f->frame_thread.pal_idx_sz) {
  ------------------
  |  Branch (2927:17): [True: 0, False: 0]
  ------------------
 2928|      0|                dav1d_free_aligned(f->frame_thread.pal_idx);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2929|      0|                f->frame_thread.pal_idx =
 2930|      0|                    dav1d_alloc_aligned(ALLOC_PAL, sizeof(*f->frame_thread.pal_idx) *
  ------------------
  |  |  134|      0|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2931|      0|                                        pal_idx_sz * 128 * 128 / 8, 64);
 2932|      0|                if (!f->frame_thread.pal_idx) {
  ------------------
  |  Branch (2932:21): [True: 0, False: 0]
  ------------------
 2933|      0|                    f->frame_thread.pal_idx_sz = 0;
 2934|      0|                    goto error;
 2935|      0|                }
 2936|      0|                f->frame_thread.pal_idx_sz = pal_idx_sz;
 2937|      0|            }
 2938|      0|        } else if (f->frame_thread.pal) {
  ------------------
  |  Branch (2938:20): [True: 0, False: 0]
  ------------------
 2939|      0|            dav1d_freep_aligned(&f->frame_thread.pal);
 2940|      0|            dav1d_freep_aligned(&f->frame_thread.pal_idx);
 2941|      0|            f->frame_thread.pal_sz = f->frame_thread.pal_idx_sz = 0;
 2942|      0|        }
 2943|      0|    }
 2944|       |
 2945|       |    // update allocation of block contexts for above
 2946|  45.2k|    ptrdiff_t y_stride = f->cur.stride[0], uv_stride = f->cur.stride[1];
 2947|  45.2k|    const int has_resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
 2948|  45.2k|    const int need_cdef_lpf_copy = c->n_tc > 1 && has_resize;
  ------------------
  |  Branch (2948:36): [True: 0, False: 45.2k]
  |  Branch (2948:51): [True: 0, False: 0]
  ------------------
 2949|  45.2k|    if (y_stride * f->sbh * 4 != f->lf.cdef_buf_plane_sz[0] ||
  ------------------
  |  Branch (2949:9): [True: 10.8k, False: 34.3k]
  ------------------
 2950|  34.3k|        uv_stride * f->sbh * 8 != f->lf.cdef_buf_plane_sz[1] ||
  ------------------
  |  Branch (2950:9): [True: 225, False: 34.1k]
  ------------------
 2951|  34.1k|        need_cdef_lpf_copy != f->lf.need_cdef_lpf_copy ||
  ------------------
  |  Branch (2951:9): [True: 0, False: 34.1k]
  ------------------
 2952|  34.1k|        f->sbh != f->lf.cdef_buf_sbh)
  ------------------
  |  Branch (2952:9): [True: 315, False: 33.8k]
  ------------------
 2953|  11.3k|    {
 2954|  11.3k|        dav1d_free_aligned(f->lf.cdef_line_buf);
  ------------------
  |  |  136|  11.3k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 2955|  11.3k|        size_t alloc_sz = 64;
 2956|  11.3k|        alloc_sz += (size_t)llabs(y_stride) * 4 * f->sbh << need_cdef_lpf_copy;
 2957|  11.3k|        alloc_sz += (size_t)llabs(uv_stride) * 8 * f->sbh << need_cdef_lpf_copy;
 2958|  11.3k|        uint8_t *ptr = f->lf.cdef_line_buf = dav1d_alloc_aligned(ALLOC_CDEF, alloc_sz, 32);
  ------------------
  |  |  134|  11.3k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 2959|  11.3k|        if (!ptr) {
  ------------------
  |  Branch (2959:13): [True: 0, False: 11.3k]
  ------------------
 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|  11.3k|        ptr += 32;
 2965|  11.3k|        if (y_stride < 0) {
  ------------------
  |  Branch (2965:13): [True: 0, False: 11.3k]
  ------------------
 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|  11.3k|        } else {
 2969|  11.3k|            f->lf.cdef_line[0][0] = ptr + y_stride * 0;
 2970|  11.3k|            f->lf.cdef_line[1][0] = ptr + y_stride * 2;
 2971|  11.3k|        }
 2972|  11.3k|        ptr += llabs(y_stride) * f->sbh * 4;
 2973|  11.3k|        if (uv_stride < 0) {
  ------------------
  |  Branch (2973:13): [True: 0, False: 11.3k]
  ------------------
 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|  11.3k|        } else {
 2979|  11.3k|            f->lf.cdef_line[0][1] = ptr + uv_stride * 0;
 2980|  11.3k|            f->lf.cdef_line[0][2] = ptr + uv_stride * 2;
 2981|  11.3k|            f->lf.cdef_line[1][1] = ptr + uv_stride * 4;
 2982|  11.3k|            f->lf.cdef_line[1][2] = ptr + uv_stride * 6;
 2983|  11.3k|        }
 2984|       |
 2985|  11.3k|        if (need_cdef_lpf_copy) {
  ------------------
  |  Branch (2985:13): [True: 0, False: 11.3k]
  ------------------
 2986|      0|            ptr += llabs(uv_stride) * f->sbh * 8;
 2987|      0|            if (y_stride < 0)
  ------------------
  |  Branch (2987:17): [True: 0, False: 0]
  ------------------
 2988|      0|                f->lf.cdef_lpf_line[0] = ptr - y_stride * (f->sbh * 4 - 1);
 2989|      0|            else
 2990|      0|                f->lf.cdef_lpf_line[0] = ptr;
 2991|      0|            ptr += llabs(y_stride) * f->sbh * 4;
 2992|      0|            if (uv_stride < 0) {
  ------------------
  |  Branch (2992:17): [True: 0, False: 0]
  ------------------
 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|      0|            } else {
 2996|      0|                f->lf.cdef_lpf_line[1] = ptr;
 2997|      0|                f->lf.cdef_lpf_line[2] = ptr + uv_stride * f->sbh * 4;
 2998|      0|            }
 2999|      0|        }
 3000|       |
 3001|  11.3k|        f->lf.cdef_buf_plane_sz[0] = (int) y_stride * f->sbh * 4;
 3002|  11.3k|        f->lf.cdef_buf_plane_sz[1] = (int) uv_stride * f->sbh * 8;
 3003|  11.3k|        f->lf.need_cdef_lpf_copy = need_cdef_lpf_copy;
 3004|  11.3k|        f->lf.cdef_buf_sbh = f->sbh;
 3005|  11.3k|    }
 3006|       |
 3007|  45.2k|    const int sb128 = f->seq_hdr->sb128;
 3008|  45.2k|    const int num_lines = c->n_tc > 1 ? f->sbh * 4 << sb128 : 12;
  ------------------
  |  Branch (3008:27): [True: 0, False: 45.2k]
  ------------------
 3009|  45.2k|    y_stride = f->sr_cur.p.stride[0], uv_stride = f->sr_cur.p.stride[1];
 3010|  45.2k|    if (y_stride * num_lines != f->lf.lr_buf_plane_sz[0] ||
  ------------------
  |  Branch (3010:9): [True: 10.6k, False: 34.5k]
  ------------------
 3011|  34.5k|        uv_stride * num_lines * 2 != f->lf.lr_buf_plane_sz[1])
  ------------------
  |  Branch (3011:9): [True: 223, False: 34.3k]
  ------------------
 3012|  10.9k|    {
 3013|  10.9k|        dav1d_free_aligned(f->lf.lr_line_buf);
  ------------------
  |  |  136|  10.9k|#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|  10.9k|        size_t alloc_sz = 128;
 3016|  10.9k|        alloc_sz += (size_t)llabs(y_stride) * num_lines;
 3017|  10.9k|        alloc_sz += (size_t)llabs(uv_stride) * num_lines * 2;
 3018|  10.9k|        uint8_t *ptr = f->lf.lr_line_buf = dav1d_alloc_aligned(ALLOC_LR, alloc_sz, 64);
  ------------------
  |  |  134|  10.9k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 3019|  10.9k|        if (!ptr) {
  ------------------
  |  Branch (3019:13): [True: 0, False: 10.9k]
  ------------------
 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|  10.9k|        ptr += 64;
 3025|  10.9k|        if (y_stride < 0)
  ------------------
  |  Branch (3025:13): [True: 0, False: 10.9k]
  ------------------
 3026|      0|            f->lf.lr_lpf_line[0] = ptr - y_stride * (num_lines - 1);
 3027|  10.9k|        else
 3028|  10.9k|            f->lf.lr_lpf_line[0] = ptr;
 3029|  10.9k|        ptr += llabs(y_stride) * num_lines;
 3030|  10.9k|        if (uv_stride < 0) {
  ------------------
  |  Branch (3030:13): [True: 0, False: 10.9k]
  ------------------
 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|  10.9k|        } else {
 3034|  10.9k|            f->lf.lr_lpf_line[1] = ptr;
 3035|  10.9k|            f->lf.lr_lpf_line[2] = ptr + uv_stride * num_lines;
 3036|  10.9k|        }
 3037|       |
 3038|  10.9k|        f->lf.lr_buf_plane_sz[0] = (int) y_stride * num_lines;
 3039|  10.9k|        f->lf.lr_buf_plane_sz[1] = (int) uv_stride * num_lines * 2;
 3040|  10.9k|    }
 3041|       |
 3042|       |    // update allocation for loopfilter masks
 3043|  45.2k|    if (num_sb128 != f->lf.mask_sz) {
  ------------------
  |  Branch (3043:9): [True: 10.8k, False: 34.4k]
  ------------------
 3044|  10.8k|        dav1d_free(f->lf.mask);
  ------------------
  |  |  135|  10.8k|#define dav1d_free(ptr) free(ptr)
  ------------------
 3045|  10.8k|        dav1d_free_aligned(f->lf.level[0]);
  ------------------
  |  |  136|  10.8k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 3046|  10.8k|        f->lf.mask = dav1d_malloc(ALLOC_LF, sizeof(*f->lf.mask) * num_sb128);
  ------------------
  |  |  132|  10.8k|#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|  10.8k|        size_t level_bytes = sizeof(*f->lf.level[0]) * num_sb128 * 32 * 32;
 3050|  10.8k|        f->lf.level[0] = dav1d_alloc_aligned(ALLOC_LF, 2 * level_bytes + 3, 64);
  ------------------
  |  |  134|  10.8k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 3051|  10.8k|        if (!f->lf.mask || !f->lf.level[0]) {
  ------------------
  |  Branch (3051:13): [True: 0, False: 10.8k]
  |  Branch (3051:28): [True: 0, False: 10.8k]
  ------------------
 3052|      0|            f->lf.mask_sz = 0;
 3053|      0|            goto error;
 3054|      0|        }
 3055|  10.8k|        f->lf.level[1] = (void*)((uint8_t*)f->lf.level[0] + level_bytes);
 3056|  10.8k|        if (c->n_fc > 1) {
  ------------------
  |  Branch (3056:13): [True: 0, False: 10.8k]
  ------------------
 3057|      0|            dav1d_free(f->frame_thread.b);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
 3058|      0|            f->frame_thread.b = dav1d_malloc(ALLOC_BLOCK, sizeof(*f->frame_thread.b) *
  ------------------
  |  |  132|      0|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3059|      0|                                             num_sb128 * 32 * 32);
 3060|      0|            if (!f->frame_thread.b) {
  ------------------
  |  Branch (3060:17): [True: 0, False: 0]
  ------------------
 3061|      0|                f->lf.mask_sz = 0;
 3062|      0|                goto error;
 3063|      0|            }
 3064|      0|        }
 3065|  10.8k|        f->lf.mask_sz = num_sb128;
 3066|  10.8k|    }
 3067|       |
 3068|  45.2k|    f->sr_sb128w = (f->sr_cur.p.p.w + 127) >> 7;
 3069|  45.2k|    const int lr_mask_sz = f->sr_sb128w * f->sb128h;
 3070|  45.2k|    if (lr_mask_sz != f->lf.lr_mask_sz) {
  ------------------
  |  Branch (3070:9): [True: 10.7k, False: 34.4k]
  ------------------
 3071|  10.7k|        dav1d_free(f->lf.lr_mask);
  ------------------
  |  |  135|  10.7k|#define dav1d_free(ptr) free(ptr)
  ------------------
 3072|  10.7k|        f->lf.lr_mask = dav1d_malloc(ALLOC_LR, sizeof(*f->lf.lr_mask) * lr_mask_sz);
  ------------------
  |  |  132|  10.7k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3073|  10.7k|        if (!f->lf.lr_mask) {
  ------------------
  |  Branch (3073:13): [True: 0, False: 10.7k]
  ------------------
 3074|      0|            f->lf.lr_mask_sz = 0;
 3075|      0|            goto error;
 3076|      0|        }
 3077|  10.7k|        f->lf.lr_mask_sz = lr_mask_sz;
 3078|  10.7k|    }
 3079|  45.2k|    int cdef_planes = 0;
 3080|  45.2k|    if (c->inloop_filters & DAV1D_INLOOPFILTER_CDEF) {
  ------------------
  |  Branch (3080:9): [True: 45.2k, False: 0]
  ------------------
 3081|  92.0k|        for (int i = 0; i < (1 << f->frame_hdr->cdef.n_bits); i++) {
  ------------------
  |  Branch (3081:25): [True: 46.8k, False: 45.2k]
  ------------------
 3082|  46.8k|            cdef_planes |= (!!f->frame_hdr->cdef.y_strength[i]) |
 3083|  46.8k|                           ((!!f->frame_hdr->cdef.uv_strength[i]) << 1);
 3084|  46.8k|        }
 3085|  45.2k|    }
 3086|  45.2k|    f->lf.cdef_planes = cdef_planes;
 3087|  45.2k|    f->lf.restore_planes =
 3088|  45.2k|        ((f->frame_hdr->restoration.type[0] != DAV1D_RESTORATION_NONE) << 0) +
 3089|  45.2k|        ((f->frame_hdr->restoration.type[1] != DAV1D_RESTORATION_NONE) << 1) +
 3090|  45.2k|        ((f->frame_hdr->restoration.type[2] != DAV1D_RESTORATION_NONE) << 2);
 3091|  45.2k|    if (f->frame_hdr->loopfilter.sharpness != f->lf.last_sharpness) {
  ------------------
  |  Branch (3091:9): [True: 15.5k, False: 29.6k]
  ------------------
 3092|  15.5k|        dav1d_calc_eih(&f->lf.lim_lut, f->frame_hdr->loopfilter.sharpness);
 3093|  15.5k|        f->lf.last_sharpness = f->frame_hdr->loopfilter.sharpness;
 3094|  15.5k|    }
 3095|  45.2k|    dav1d_calc_lf_values(f->lf.lvl, f->frame_hdr, (int8_t[4]) { 0, 0, 0, 0 });
 3096|  45.2k|    memset(f->lf.mask, 0, sizeof(*f->lf.mask) * num_sb128);
 3097|       |
 3098|  45.2k|    const int ipred_edge_sz = f->sbh * f->sb128w << hbd;
 3099|  45.2k|    if (ipred_edge_sz != f->ipred_edge_sz) {
  ------------------
  |  Branch (3099:9): [True: 10.8k, False: 34.3k]
  ------------------
 3100|  10.8k|        dav1d_free_aligned(f->ipred_edge[0]);
  ------------------
  |  |  136|  10.8k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
 3101|  10.8k|        uint8_t *ptr = f->ipred_edge[0] =
 3102|  10.8k|            dav1d_alloc_aligned(ALLOC_IPRED, ipred_edge_sz * 128 * 3, 64);
  ------------------
  |  |  134|  10.8k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
 3103|  10.8k|        if (!ptr) {
  ------------------
  |  Branch (3103:13): [True: 0, False: 10.8k]
  ------------------
 3104|      0|            f->ipred_edge_sz = 0;
 3105|      0|            goto error;
 3106|      0|        }
 3107|  10.8k|        f->ipred_edge[1] = ptr + ipred_edge_sz * 128 * 1;
 3108|  10.8k|        f->ipred_edge[2] = ptr + ipred_edge_sz * 128 * 2;
 3109|  10.8k|        f->ipred_edge_sz = ipred_edge_sz;
 3110|  10.8k|    }
 3111|       |
 3112|  45.2k|    const int re_sz = f->sb128h * f->frame_hdr->tiling.cols;
 3113|  45.2k|    if (re_sz != f->lf.re_sz) {
  ------------------
  |  Branch (3113:9): [True: 10.1k, False: 35.0k]
  ------------------
 3114|  10.1k|        dav1d_free(f->lf.tx_lpf_right_edge[0]);
  ------------------
  |  |  135|  10.1k|#define dav1d_free(ptr) free(ptr)
  ------------------
 3115|  10.1k|        f->lf.tx_lpf_right_edge[0] = dav1d_malloc(ALLOC_LF, re_sz * 32 * 2);
  ------------------
  |  |  132|  10.1k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3116|  10.1k|        if (!f->lf.tx_lpf_right_edge[0]) {
  ------------------
  |  Branch (3116:13): [True: 0, False: 10.1k]
  ------------------
 3117|      0|            f->lf.re_sz = 0;
 3118|      0|            goto error;
 3119|      0|        }
 3120|  10.1k|        f->lf.tx_lpf_right_edge[1] = f->lf.tx_lpf_right_edge[0] + re_sz * 32;
 3121|  10.1k|        f->lf.re_sz = re_sz;
 3122|  10.1k|    }
 3123|       |
 3124|       |    // init ref mvs
 3125|  45.2k|    if (IS_INTER_OR_SWITCH(f->frame_hdr) || f->frame_hdr->allow_intrabc) {
  ------------------
  |  |   36|  90.4k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 12.7k, False: 32.4k]
  |  |  ------------------
  ------------------
  |  Branch (3125:45): [True: 18.7k, False: 13.6k]
  ------------------
 3126|  31.5k|        const int ret =
 3127|  31.5k|            dav1d_refmvs_init_frame(&f->rf, f->seq_hdr, f->frame_hdr,
 3128|  31.5k|                                    f->refpoc, f->mvs, f->refrefpoc, f->ref_mvs,
 3129|  31.5k|                                    f->c->n_tc, f->c->n_fc);
 3130|  31.5k|        if (ret < 0) goto error;
  ------------------
  |  Branch (3130:13): [True: 0, False: 31.5k]
  ------------------
 3131|  31.5k|    }
 3132|       |
 3133|       |    // setup dequant tables
 3134|  45.2k|    init_quant_tables(f->seq_hdr, f->frame_hdr, f->frame_hdr->quant.yac, f->dq);
 3135|  45.2k|    if (f->frame_hdr->quant.qm)
  ------------------
  |  Branch (3135:9): [True: 7.01k, False: 38.1k]
  ------------------
 3136|   140k|        for (int i = 0; i < N_RECT_TX_SIZES; i++) {
  ------------------
  |  Branch (3136:25): [True: 133k, False: 7.01k]
  ------------------
 3137|   133k|            f->qm[i][0] = dav1d_qm_tbl[f->frame_hdr->quant.qm_y][0][i];
 3138|   133k|            f->qm[i][1] = dav1d_qm_tbl[f->frame_hdr->quant.qm_u][1][i];
 3139|   133k|            f->qm[i][2] = dav1d_qm_tbl[f->frame_hdr->quant.qm_v][1][i];
 3140|   133k|        }
 3141|  38.1k|    else
 3142|  38.1k|        memset(f->qm, 0, sizeof(f->qm));
 3143|       |
 3144|       |    // setup jnt_comp weights
 3145|  45.2k|    if (f->frame_hdr->switchable_comp_refs) {
  ------------------
  |  Branch (3145:9): [True: 9.44k, False: 35.7k]
  ------------------
 3146|  75.5k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3146:25): [True: 66.1k, False: 9.44k]
  ------------------
 3147|  66.1k|            const unsigned ref0poc = f->refp[i].p.frame_hdr->frame_offset;
 3148|       |
 3149|   264k|            for (int j = i + 1; j < 7; j++) {
  ------------------
  |  Branch (3149:33): [True: 198k, False: 66.1k]
  ------------------
 3150|   198k|                const unsigned ref1poc = f->refp[j].p.frame_hdr->frame_offset;
 3151|       |
 3152|   198k|                const unsigned d1 =
 3153|   198k|                    imin(abs(get_poc_diff(f->seq_hdr->order_hint_n_bits, ref0poc,
 3154|   198k|                                          f->cur.frame_hdr->frame_offset)), 31);
 3155|   198k|                const unsigned d0 =
 3156|   198k|                    imin(abs(get_poc_diff(f->seq_hdr->order_hint_n_bits, ref1poc,
 3157|   198k|                                          f->cur.frame_hdr->frame_offset)), 31);
 3158|   198k|                const int order = d0 <= d1;
 3159|       |
 3160|   198k|                static const uint8_t quant_dist_weight[3][2] = {
 3161|   198k|                    { 2, 3 }, { 2, 5 }, { 2, 7 }
 3162|   198k|                };
 3163|   198k|                static const uint8_t quant_dist_lookup_table[4][2] = {
 3164|   198k|                    { 9, 7 }, { 11, 5 }, { 12, 4 }, { 13, 3 }
 3165|   198k|                };
 3166|       |
 3167|   198k|                int k;
 3168|   675k|                for (k = 0; k < 3; k++) {
  ------------------
  |  Branch (3168:29): [True: 518k, False: 157k]
  ------------------
 3169|   518k|                    const int c0 = quant_dist_weight[k][order];
 3170|   518k|                    const int c1 = quant_dist_weight[k][!order];
 3171|   518k|                    const int d0_c0 = d0 * c0;
 3172|   518k|                    const int d1_c1 = d1 * c1;
 3173|   518k|                    if ((d0 > d1 && d0_c0 < d1_c1) || (d0 <= d1 && d0_c0 > d1_c1)) break;
  ------------------
  |  Branch (3173:26): [True: 88.6k, False: 429k]
  |  Branch (3173:37): [True: 6.00k, False: 82.6k]
  |  Branch (3173:56): [True: 429k, False: 82.6k]
  |  Branch (3173:68): [True: 35.3k, False: 394k]
  ------------------
 3174|   518k|                }
 3175|       |
 3176|   198k|                f->jnt_weights[i][j] = quant_dist_lookup_table[k][order];
 3177|   198k|            }
 3178|  66.1k|        }
 3179|  9.44k|    }
 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|  45.2k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400;
 3187|  45.2k|    f->lf.p[0] = f->cur.data[0];
 3188|  45.2k|    f->lf.p[1] = f->cur.data[has_chroma ? 1 : 0];
  ------------------
  |  Branch (3188:30): [True: 23.8k, False: 21.3k]
  ------------------
 3189|  45.2k|    f->lf.p[2] = f->cur.data[has_chroma ? 2 : 0];
  ------------------
  |  Branch (3189:30): [True: 23.8k, False: 21.3k]
  ------------------
 3190|  45.2k|    f->lf.sr_p[0] = f->sr_cur.p.data[0];
 3191|  45.2k|    f->lf.sr_p[1] = f->sr_cur.p.data[has_chroma ? 1 : 0];
  ------------------
  |  Branch (3191:38): [True: 23.8k, False: 21.3k]
  ------------------
 3192|  45.2k|    f->lf.sr_p[2] = f->sr_cur.p.data[has_chroma ? 2 : 0];
  ------------------
  |  Branch (3192:38): [True: 23.8k, False: 21.3k]
  ------------------
 3193|       |
 3194|  45.2k|    retval = 0;
 3195|  45.2k|error:
 3196|  45.2k|    return retval;
 3197|  45.2k|}
dav1d_decode_frame_init_cdf:
 3199|  45.2k|int dav1d_decode_frame_init_cdf(Dav1dFrameContext *const f) {
 3200|  45.2k|    const Dav1dContext *const c = f->c;
 3201|  45.2k|    int retval = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|  45.2k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3202|       |
 3203|  45.2k|    if (f->frame_hdr->refresh_context)
  ------------------
  |  Branch (3203:9): [True: 14.7k, False: 30.4k]
  ------------------
 3204|  14.7k|        dav1d_cdf_thread_copy(f->out_cdf.data.cdf, &f->in_cdf);
 3205|       |
 3206|       |    // parse individual tiles per tile group
 3207|  45.2k|    int tile_row = 0, tile_col = 0;
 3208|  89.2k|    for (int i = 0; i < f->n_tile_data; i++) {
  ------------------
  |  Branch (3208:21): [True: 45.2k, False: 43.9k]
  ------------------
 3209|  45.2k|        const uint8_t *data = f->tile[i].data.data;
 3210|  45.2k|        size_t size = f->tile[i].data.sz;
 3211|       |
 3212|  95.2k|        for (int j = f->tile[i].start; j <= f->tile[i].end; j++) {
  ------------------
  |  Branch (3212:40): [True: 51.2k, False: 44.0k]
  ------------------
 3213|  51.2k|            size_t tile_sz;
 3214|  51.2k|            if (j == f->tile[i].end) {
  ------------------
  |  Branch (3214:17): [True: 44.0k, False: 7.20k]
  ------------------
 3215|  44.0k|                tile_sz = size;
 3216|  44.0k|            } else {
 3217|  7.20k|                if (f->frame_hdr->tiling.n_bytes > size) goto error;
  ------------------
  |  Branch (3217:21): [True: 480, False: 6.72k]
  ------------------
 3218|  6.72k|                tile_sz = 0;
 3219|  14.0k|                for (unsigned k = 0; k < f->frame_hdr->tiling.n_bytes; k++)
  ------------------
  |  Branch (3219:38): [True: 7.29k, False: 6.72k]
  ------------------
 3220|  7.29k|                    tile_sz |= (unsigned)*data++ << (k * 8);
 3221|  6.72k|                tile_sz++;
 3222|  6.72k|                size -= f->frame_hdr->tiling.n_bytes;
 3223|  6.72k|                if (tile_sz > size) goto error;
  ------------------
  |  Branch (3223:21): [True: 778, False: 5.94k]
  ------------------
 3224|  6.72k|            }
 3225|       |
 3226|  49.9k|            setup_tile(&f->ts[j], f, data, tile_sz, tile_row, tile_col++,
 3227|  49.9k|                       c->n_fc > 1 ? f->frame_thread.tile_start_off[j] : 0);
  ------------------
  |  Branch (3227:24): [True: 0, False: 49.9k]
  ------------------
 3228|       |
 3229|  49.9k|            if (tile_col == f->frame_hdr->tiling.cols) {
  ------------------
  |  Branch (3229:17): [True: 45.4k, False: 4.50k]
  ------------------
 3230|  45.4k|                tile_col = 0;
 3231|  45.4k|                tile_row++;
 3232|  45.4k|            }
 3233|  49.9k|            data += tile_sz;
 3234|  49.9k|            size -= tile_sz;
 3235|  49.9k|        }
 3236|  45.2k|    }
 3237|       |
 3238|  43.9k|    if (c->n_tc > 1) {
  ------------------
  |  Branch (3238:9): [True: 0, False: 43.9k]
  ------------------
 3239|      0|        const int uses_2pass = c->n_fc > 1;
 3240|      0|        for (int n = 0; n < f->sb128w * f->frame_hdr->tiling.rows * (1 + uses_2pass); n++)
  ------------------
  |  Branch (3240:25): [True: 0, False: 0]
  ------------------
 3241|      0|            reset_context(&f->a[n], IS_KEY_OR_INTRA(f->frame_hdr),
  ------------------
  |  |   43|      0|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|      0|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  ------------------
 3242|      0|                          uses_2pass ? 1 + (n >= f->sb128w * f->frame_hdr->tiling.rows) : 0);
  ------------------
  |  Branch (3242:27): [True: 0, False: 0]
  ------------------
 3243|      0|    }
 3244|       |
 3245|  43.9k|    retval = 0;
 3246|  45.2k|error:
 3247|  45.2k|    return retval;
 3248|  43.9k|}
dav1d_decode_frame_main:
 3250|  43.9k|int dav1d_decode_frame_main(Dav1dFrameContext *const f) {
 3251|  43.9k|    const Dav1dContext *const c = f->c;
 3252|  43.9k|    int retval = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|  43.9k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3253|       |
 3254|  43.9k|    assert(f->c->n_tc == 1);
  ------------------
  |  Branch (3254:5): [True: 43.9k, False: 0]
  ------------------
 3255|       |
 3256|  43.9k|    Dav1dTaskContext *const t = &c->tc[f - c->fc];
 3257|  43.9k|    t->f = f;
 3258|  43.9k|    t->frame_thread.pass = 0;
 3259|       |
 3260|   454k|    for (int n = 0; n < f->sb128w * f->frame_hdr->tiling.rows; n++)
  ------------------
  |  Branch (3260:21): [True: 410k, False: 43.9k]
  ------------------
 3261|   410k|        reset_context(&f->a[n], IS_KEY_OR_INTRA(f->frame_hdr), 0);
  ------------------
  |  |   43|   410k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|   410k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  ------------------
 3262|       |
 3263|       |    // no threading - we explicitly interleave tile/sbrow decoding
 3264|       |    // and post-filtering, so that the full process runs in-line
 3265|  64.0k|    for (int tile_row = 0; tile_row < f->frame_hdr->tiling.rows; tile_row++) {
  ------------------
  |  Branch (3265:28): [True: 44.9k, False: 19.0k]
  ------------------
 3266|  44.9k|        const int sbh_end =
 3267|  44.9k|            imin(f->frame_hdr->tiling.row_start_sb[tile_row + 1], f->sbh);
 3268|  44.9k|        for (int sby = f->frame_hdr->tiling.row_start_sb[tile_row];
 3269|   203k|             sby < sbh_end; sby++)
  ------------------
  |  Branch (3269:14): [True: 183k, False: 20.0k]
  ------------------
 3270|   183k|        {
 3271|   183k|            t->by = sby << (4 + f->seq_hdr->sb128);
 3272|   183k|            const int by_end = (t->by + f->sb_step) >> 1;
 3273|   183k|            if (f->frame_hdr->use_ref_frame_mvs) {
  ------------------
  |  Branch (3273:17): [True: 13.7k, False: 169k]
  ------------------
 3274|  13.7k|                f->c->refmvs_dsp.load_tmvs(&f->rf, tile_row,
 3275|  13.7k|                                           0, f->bw >> 1, t->by >> 1, by_end);
 3276|  13.7k|            }
 3277|   345k|            for (int tile_col = 0; tile_col < f->frame_hdr->tiling.cols; tile_col++) {
  ------------------
  |  Branch (3277:36): [True: 186k, False: 158k]
  ------------------
 3278|   186k|                t->ts = &f->ts[tile_row * f->frame_hdr->tiling.cols + tile_col];
 3279|   186k|                if (dav1d_decode_tile_sbrow(t)) goto error;
  ------------------
  |  Branch (3279:21): [True: 24.9k, False: 161k]
  ------------------
 3280|   186k|            }
 3281|   158k|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|   158k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 46.1k, False: 112k]
  |  |  ------------------
  ------------------
 3282|  46.1k|                dav1d_refmvs_save_tmvs(&f->c->refmvs_dsp, &t->rt,
 3283|  46.1k|                                       0, f->bw >> 1, t->by >> 1, by_end);
 3284|  46.1k|            }
 3285|       |
 3286|       |            // loopfilter + cdef + restoration
 3287|   158k|            f->bd_fn.filter_sbrow(f, sby);
 3288|   158k|        }
 3289|  44.9k|    }
 3290|       |
 3291|  19.0k|    retval = 0;
 3292|  43.9k|error:
 3293|  43.9k|    return retval;
 3294|  19.0k|}
dav1d_decode_frame_exit:
 3296|  45.2k|void dav1d_decode_frame_exit(Dav1dFrameContext *const f, int retval) {
 3297|  45.2k|    const Dav1dContext *const c = f->c;
 3298|       |
 3299|  45.2k|    if (f->sr_cur.p.data[0])
  ------------------
  |  Branch (3299:9): [True: 45.2k, False: 0]
  ------------------
 3300|  45.2k|        atomic_init(&f->task_thread.error, 0);
 3301|       |
 3302|  45.2k|    if (c->n_fc > 1 && retval && f->frame_thread.cf) {
  ------------------
  |  Branch (3302:9): [True: 0, False: 45.2k]
  |  Branch (3302:24): [True: 0, False: 0]
  |  Branch (3302:34): [True: 0, False: 0]
  ------------------
 3303|      0|        memset(f->frame_thread.cf, 0,
 3304|      0|               (size_t)f->frame_thread.cf_sz * 128 * 128 / 2);
 3305|      0|    }
 3306|   361k|    for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3306:21): [True: 316k, False: 45.2k]
  ------------------
 3307|   316k|        if (f->refp[i].p.frame_hdr) {
  ------------------
  |  Branch (3307:13): [True: 89.5k, False: 226k]
  ------------------
 3308|  89.5k|            if (!retval && c->n_fc > 1 && c->strict_std_compliance &&
  ------------------
  |  Branch (3308:17): [True: 60.0k, False: 29.5k]
  |  Branch (3308:28): [True: 0, False: 60.0k]
  |  Branch (3308:43): [True: 0, False: 0]
  ------------------
 3309|  89.5k|                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|  89.5k|            dav1d_thread_picture_unref(&f->refp[i]);
 3316|  89.5k|        }
 3317|   316k|        dav1d_ref_dec(&f->ref_mvs_ref[i]);
 3318|   316k|    }
 3319|       |
 3320|  45.2k|    dav1d_picture_unref_internal(&f->cur);
 3321|  45.2k|    dav1d_thread_picture_unref(&f->sr_cur);
 3322|  45.2k|    dav1d_cdf_thread_unref(&f->in_cdf);
 3323|  45.2k|    if (f->frame_hdr && f->frame_hdr->refresh_context) {
  ------------------
  |  Branch (3323:9): [True: 45.2k, False: 0]
  |  Branch (3323:25): [True: 14.7k, False: 30.4k]
  ------------------
 3324|  14.7k|        if (f->out_cdf.progress)
  ------------------
  |  Branch (3324:13): [True: 0, False: 14.7k]
  ------------------
 3325|  14.7k|            atomic_store_explicit(f->out_cdf.progress, retval == 0 ? 1 : TILE_ERROR,
  ------------------
  |  |   36|      0|#define TILE_ERROR (INT_MAX - 1)
  ------------------
  |  Branch (3325:56): [True: 0, False: 0]
  ------------------
 3326|      0|                                  memory_order_release);
 3327|  14.7k|        dav1d_cdf_thread_unref(&f->out_cdf);
 3328|  14.7k|    }
 3329|  45.2k|    dav1d_ref_dec(&f->cur_segmap_ref);
 3330|  45.2k|    dav1d_ref_dec(&f->prev_segmap_ref);
 3331|  45.2k|    dav1d_ref_dec(&f->mvs_ref);
 3332|  45.2k|    dav1d_ref_dec(&f->seq_hdr_ref);
 3333|  45.2k|    dav1d_ref_dec(&f->frame_hdr_ref);
 3334|       |
 3335|  90.5k|    for (int i = 0; i < f->n_tile_data; i++)
  ------------------
  |  Branch (3335:21): [True: 45.2k, False: 45.2k]
  ------------------
 3336|  45.2k|        dav1d_data_unref_internal(&f->tile[i].data);
 3337|  45.2k|    f->task_thread.retval = retval;
 3338|  45.2k|}
dav1d_decode_frame:
 3340|  45.2k|int dav1d_decode_frame(Dav1dFrameContext *const f) {
 3341|  45.2k|    assert(f->c->n_fc == 1);
  ------------------
  |  Branch (3341:5): [True: 45.2k, False: 0]
  ------------------
 3342|       |    // if n_tc > 1 (but n_fc == 1), we could run init/exit in the task
 3343|       |    // threads also. Not sure it makes a measurable difference.
 3344|  45.2k|    int res = dav1d_decode_frame_init(f);
 3345|  45.2k|    if (!res) res = dav1d_decode_frame_init_cdf(f);
  ------------------
  |  Branch (3345:9): [True: 45.2k, False: 0]
  ------------------
 3346|       |    // wait until all threads have completed
 3347|  45.2k|    if (!res) {
  ------------------
  |  Branch (3347:9): [True: 43.9k, False: 1.25k]
  ------------------
 3348|  43.9k|        if (f->c->n_tc > 1) {
  ------------------
  |  Branch (3348:13): [True: 0, False: 43.9k]
  ------------------
 3349|      0|            res = dav1d_task_create_tile_sbrow(f, 0, 1);
 3350|      0|            pthread_mutex_lock(&f->task_thread.ttd->lock);
 3351|      0|            pthread_cond_signal(&f->task_thread.ttd->cond);
 3352|      0|            if (!res) {
  ------------------
  |  Branch (3352:17): [True: 0, False: 0]
  ------------------
 3353|      0|                while (!f->task_thread.done[0] ||
  ------------------
  |  Branch (3353:24): [True: 0, False: 0]
  ------------------
 3354|      0|                       f->task_thread.task_counter > 0)
  ------------------
  |  Branch (3354:24): [True: 0, False: 0]
  ------------------
 3355|      0|                {
 3356|      0|                    pthread_cond_wait(&f->task_thread.cond,
 3357|      0|                                      &f->task_thread.ttd->lock);
 3358|      0|                }
 3359|      0|            }
 3360|      0|            pthread_mutex_unlock(&f->task_thread.ttd->lock);
 3361|      0|            if (!res) res = f->task_thread.retval;
  ------------------
  |  Branch (3361:17): [True: 0, False: 0]
  ------------------
 3362|  43.9k|        } else {
 3363|  43.9k|            res = dav1d_decode_frame_main(f);
 3364|  43.9k|            if (!res && f->frame_hdr->refresh_context) {
  ------------------
  |  Branch (3364:17): [True: 19.0k, False: 24.9k]
  |  Branch (3364:25): [True: 12.4k, False: 6.60k]
  ------------------
 3365|  12.4k|                dav1d_cdf_thread_update(f->frame_hdr, f->out_cdf.data.cdf,
 3366|  12.4k|                                        &f->ts[f->frame_hdr->tiling.update].cdf);
 3367|  12.4k|            }
 3368|  43.9k|        }
 3369|  43.9k|    }
 3370|  45.2k|    dav1d_decode_frame_exit(f, res);
 3371|  45.2k|    res = f->task_thread.retval;
 3372|  45.2k|    f->n_tile_data = 0;
 3373|  45.2k|    return res;
 3374|  45.2k|}
dav1d_submit_frame:
 3382|  47.5k|int dav1d_submit_frame(Dav1dContext *const c) {
 3383|  47.5k|    Dav1dFrameContext *f;
 3384|  47.5k|    int res = -1;
 3385|       |
 3386|       |    // wait for c->out_delayed[next] and move into c->out if visible
 3387|  47.5k|    Dav1dThreadPicture *out_delayed;
 3388|  47.5k|    if (c->n_fc > 1) {
  ------------------
  |  Branch (3388:9): [True: 0, False: 47.5k]
  ------------------
 3389|      0|        pthread_mutex_lock(&c->task_thread.lock);
 3390|      0|        const unsigned next = c->frame_thread.next++;
 3391|      0|        if (c->frame_thread.next == c->n_fc)
  ------------------
  |  Branch (3391:13): [True: 0, False: 0]
  ------------------
 3392|      0|            c->frame_thread.next = 0;
 3393|       |
 3394|      0|        f = &c->fc[next];
 3395|      0|        while (f->n_tile_data > 0)
  ------------------
  |  Branch (3395:16): [True: 0, False: 0]
  ------------------
 3396|      0|            pthread_cond_wait(&f->task_thread.cond,
 3397|      0|                              &c->task_thread.lock);
 3398|      0|        out_delayed = &c->frame_thread.out_delayed[next];
 3399|      0|        if (out_delayed->p.data[0] ||
  ------------------
  |  Branch (3399:13): [True: 0, False: 0]
  ------------------
 3400|      0|            atomic_load_explicit(&f->task_thread.error, memory_order_relaxed))
  ------------------
  |  Branch (3400:13): [True: 0, False: 0]
  ------------------
 3401|      0|        {
 3402|      0|            unsigned first = atomic_load_explicit(&c->task_thread.first, memory_order_relaxed);
 3403|      0|            if (first + 1U < c->n_fc)
  ------------------
  |  Branch (3403:17): [True: 0, False: 0]
  ------------------
 3404|      0|                atomic_fetch_add_explicit(&c->task_thread.first, 1U, memory_order_relaxed);
 3405|      0|            else
 3406|      0|                atomic_store_explicit(&c->task_thread.first, 0, memory_order_relaxed);
 3407|      0|            atomic_compare_exchange_strong_explicit(&c->task_thread.reset_task_cur,
 3408|      0|                                                    &first, UINT_MAX,
 3409|      0|                                                    memory_order_relaxed,
 3410|      0|                                                    memory_order_relaxed);
 3411|      0|            if (c->task_thread.cur && c->task_thread.cur < c->n_fc)
  ------------------
  |  Branch (3411:17): [True: 0, False: 0]
  |  Branch (3411:39): [True: 0, False: 0]
  ------------------
 3412|      0|                c->task_thread.cur--;
 3413|      0|        }
 3414|      0|        const int error = f->task_thread.retval;
 3415|      0|        if (error) {
  ------------------
  |  Branch (3415:13): [True: 0, False: 0]
  ------------------
 3416|      0|            f->task_thread.retval = 0;
 3417|      0|            c->cached_error = error;
 3418|      0|            dav1d_data_props_copy(&c->cached_error_props, &out_delayed->p.m);
 3419|      0|            dav1d_thread_picture_unref(out_delayed);
 3420|      0|        } else if (out_delayed->p.data[0]) {
  ------------------
  |  Branch (3420:20): [True: 0, False: 0]
  ------------------
 3421|      0|            const unsigned progress = atomic_load_explicit(&out_delayed->progress[1],
 3422|      0|                                                           memory_order_relaxed);
 3423|      0|            if ((out_delayed->visible || c->output_invisible_frames) &&
  ------------------
  |  Branch (3423:18): [True: 0, False: 0]
  |  Branch (3423:42): [True: 0, False: 0]
  ------------------
 3424|      0|                progress != FRAME_ERROR)
  ------------------
  |  |   35|      0|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  |  Branch (3424:17): [True: 0, False: 0]
  ------------------
 3425|      0|            {
 3426|      0|                dav1d_thread_picture_ref(&c->out, out_delayed);
 3427|      0|                c->event_flags |= dav1d_picture_get_event_flags(out_delayed);
 3428|      0|            }
 3429|      0|            dav1d_thread_picture_unref(out_delayed);
 3430|      0|        }
 3431|  47.5k|    } else {
 3432|  47.5k|        f = c->fc;
 3433|  47.5k|    }
 3434|       |
 3435|  47.5k|    f->seq_hdr = c->seq_hdr;
 3436|  47.5k|    f->seq_hdr_ref = c->seq_hdr_ref;
 3437|  47.5k|    dav1d_ref_inc(f->seq_hdr_ref);
 3438|  47.5k|    f->frame_hdr = c->frame_hdr;
 3439|  47.5k|    f->frame_hdr_ref = c->frame_hdr_ref;
 3440|  47.5k|    c->frame_hdr = NULL;
 3441|  47.5k|    c->frame_hdr_ref = NULL;
 3442|  47.5k|    f->dsp = &c->dsp[f->seq_hdr->hbd];
 3443|       |
 3444|  47.5k|    const int bpc = 8 + 2 * f->seq_hdr->hbd;
 3445|       |
 3446|  47.5k|    if (!f->dsp->ipred.intra_pred[DC_PRED]) {
  ------------------
  |  Branch (3446:9): [True: 9.37k, False: 38.1k]
  ------------------
 3447|  9.37k|        Dav1dDSPContext *const dsp = &c->dsp[f->seq_hdr->hbd];
 3448|       |
 3449|  9.37k|        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|  3.82k|        case 8:
  ------------------
  |  Branch (3460:9): [True: 3.82k, False: 5.54k]
  ------------------
 3461|  3.82k|            assign_bitdepth_case(8);
  ------------------
  |  | 3451|  3.82k|            dav1d_cdef_dsp_init_##bd##bpc(&dsp->cdef); \
  |  | 3452|  3.82k|            dav1d_intra_pred_dsp_init_##bd##bpc(&dsp->ipred); \
  |  | 3453|  3.82k|            dav1d_itx_dsp_init_##bd##bpc(&dsp->itx, bpc); \
  |  | 3454|  3.82k|            dav1d_loop_filter_dsp_init_##bd##bpc(&dsp->lf); \
  |  | 3455|  3.82k|            dav1d_loop_restoration_dsp_init_##bd##bpc(&dsp->lr, bpc); \
  |  | 3456|  3.82k|            dav1d_mc_dsp_init_##bd##bpc(&dsp->mc); \
  |  | 3457|  3.82k|            dav1d_film_grain_dsp_init_##bd##bpc(&dsp->fg); \
  |  | 3458|  3.82k|            break
  ------------------
 3462|      0|#endif
 3463|      0|#if CONFIG_16BPC
 3464|  2.70k|        case 10:
  ------------------
  |  Branch (3464:9): [True: 2.70k, False: 6.66k]
  ------------------
 3465|  5.54k|        case 12:
  ------------------
  |  Branch (3465:9): [True: 2.84k, False: 6.53k]
  ------------------
 3466|  5.54k|            assign_bitdepth_case(16);
  ------------------
  |  | 3451|  5.54k|            dav1d_cdef_dsp_init_##bd##bpc(&dsp->cdef); \
  |  | 3452|  5.54k|            dav1d_intra_pred_dsp_init_##bd##bpc(&dsp->ipred); \
  |  | 3453|  5.54k|            dav1d_itx_dsp_init_##bd##bpc(&dsp->itx, bpc); \
  |  | 3454|  5.54k|            dav1d_loop_filter_dsp_init_##bd##bpc(&dsp->lf); \
  |  | 3455|  5.54k|            dav1d_loop_restoration_dsp_init_##bd##bpc(&dsp->lr, bpc); \
  |  | 3456|  5.54k|            dav1d_mc_dsp_init_##bd##bpc(&dsp->mc); \
  |  | 3457|  5.54k|            dav1d_film_grain_dsp_init_##bd##bpc(&dsp->fg); \
  |  | 3458|  5.54k|            break
  ------------------
 3467|      0|#endif
 3468|      0|#undef assign_bitdepth_case
 3469|      0|        default:
  ------------------
  |  Branch (3469:9): [True: 0, False: 9.37k]
  ------------------
 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|  9.37k|        }
 3475|  9.37k|    }
 3476|       |
 3477|  47.5k|#define assign_bitdepth_case(bd) \
 3478|  47.5k|        f->bd_fn.recon_b_inter = dav1d_recon_b_inter_##bd##bpc; \
 3479|  47.5k|        f->bd_fn.recon_b_intra = dav1d_recon_b_intra_##bd##bpc; \
 3480|  47.5k|        f->bd_fn.filter_sbrow = dav1d_filter_sbrow_##bd##bpc; \
 3481|  47.5k|        f->bd_fn.filter_sbrow_deblock_cols = dav1d_filter_sbrow_deblock_cols_##bd##bpc; \
 3482|  47.5k|        f->bd_fn.filter_sbrow_deblock_rows = dav1d_filter_sbrow_deblock_rows_##bd##bpc; \
 3483|  47.5k|        f->bd_fn.filter_sbrow_cdef = dav1d_filter_sbrow_cdef_##bd##bpc; \
 3484|  47.5k|        f->bd_fn.filter_sbrow_resize = dav1d_filter_sbrow_resize_##bd##bpc; \
 3485|  47.5k|        f->bd_fn.filter_sbrow_lr = dav1d_filter_sbrow_lr_##bd##bpc; \
 3486|  47.5k|        f->bd_fn.backup_ipred_edge = dav1d_backup_ipred_edge_##bd##bpc; \
 3487|  47.5k|        f->bd_fn.read_coef_blocks = dav1d_read_coef_blocks_##bd##bpc; \
 3488|  47.5k|        f->bd_fn.copy_pal_block_y = dav1d_copy_pal_block_y_##bd##bpc; \
 3489|  47.5k|        f->bd_fn.copy_pal_block_uv = dav1d_copy_pal_block_uv_##bd##bpc; \
 3490|  47.5k|        f->bd_fn.read_pal_plane = dav1d_read_pal_plane_##bd##bpc; \
 3491|  47.5k|        f->bd_fn.read_pal_uv = dav1d_read_pal_uv_##bd##bpc
 3492|  47.5k|    if (!f->seq_hdr->hbd) {
  ------------------
  |  Branch (3492:9): [True: 23.2k, False: 24.2k]
  ------------------
 3493|  23.2k|#if CONFIG_8BPC
 3494|  23.2k|        assign_bitdepth_case(8);
  ------------------
  |  | 3478|  23.2k|        f->bd_fn.recon_b_inter = dav1d_recon_b_inter_##bd##bpc; \
  |  | 3479|  23.2k|        f->bd_fn.recon_b_intra = dav1d_recon_b_intra_##bd##bpc; \
  |  | 3480|  23.2k|        f->bd_fn.filter_sbrow = dav1d_filter_sbrow_##bd##bpc; \
  |  | 3481|  23.2k|        f->bd_fn.filter_sbrow_deblock_cols = dav1d_filter_sbrow_deblock_cols_##bd##bpc; \
  |  | 3482|  23.2k|        f->bd_fn.filter_sbrow_deblock_rows = dav1d_filter_sbrow_deblock_rows_##bd##bpc; \
  |  | 3483|  23.2k|        f->bd_fn.filter_sbrow_cdef = dav1d_filter_sbrow_cdef_##bd##bpc; \
  |  | 3484|  23.2k|        f->bd_fn.filter_sbrow_resize = dav1d_filter_sbrow_resize_##bd##bpc; \
  |  | 3485|  23.2k|        f->bd_fn.filter_sbrow_lr = dav1d_filter_sbrow_lr_##bd##bpc; \
  |  | 3486|  23.2k|        f->bd_fn.backup_ipred_edge = dav1d_backup_ipred_edge_##bd##bpc; \
  |  | 3487|  23.2k|        f->bd_fn.read_coef_blocks = dav1d_read_coef_blocks_##bd##bpc; \
  |  | 3488|  23.2k|        f->bd_fn.copy_pal_block_y = dav1d_copy_pal_block_y_##bd##bpc; \
  |  | 3489|  23.2k|        f->bd_fn.copy_pal_block_uv = dav1d_copy_pal_block_uv_##bd##bpc; \
  |  | 3490|  23.2k|        f->bd_fn.read_pal_plane = dav1d_read_pal_plane_##bd##bpc; \
  |  | 3491|  23.2k|        f->bd_fn.read_pal_uv = dav1d_read_pal_uv_##bd##bpc
  ------------------
 3495|  23.2k|#endif
 3496|  24.2k|    } else {
 3497|  24.2k|#if CONFIG_16BPC
 3498|  24.2k|        assign_bitdepth_case(16);
  ------------------
  |  | 3478|  24.2k|        f->bd_fn.recon_b_inter = dav1d_recon_b_inter_##bd##bpc; \
  |  | 3479|  24.2k|        f->bd_fn.recon_b_intra = dav1d_recon_b_intra_##bd##bpc; \
  |  | 3480|  24.2k|        f->bd_fn.filter_sbrow = dav1d_filter_sbrow_##bd##bpc; \
  |  | 3481|  24.2k|        f->bd_fn.filter_sbrow_deblock_cols = dav1d_filter_sbrow_deblock_cols_##bd##bpc; \
  |  | 3482|  24.2k|        f->bd_fn.filter_sbrow_deblock_rows = dav1d_filter_sbrow_deblock_rows_##bd##bpc; \
  |  | 3483|  24.2k|        f->bd_fn.filter_sbrow_cdef = dav1d_filter_sbrow_cdef_##bd##bpc; \
  |  | 3484|  24.2k|        f->bd_fn.filter_sbrow_resize = dav1d_filter_sbrow_resize_##bd##bpc; \
  |  | 3485|  24.2k|        f->bd_fn.filter_sbrow_lr = dav1d_filter_sbrow_lr_##bd##bpc; \
  |  | 3486|  24.2k|        f->bd_fn.backup_ipred_edge = dav1d_backup_ipred_edge_##bd##bpc; \
  |  | 3487|  24.2k|        f->bd_fn.read_coef_blocks = dav1d_read_coef_blocks_##bd##bpc; \
  |  | 3488|  24.2k|        f->bd_fn.copy_pal_block_y = dav1d_copy_pal_block_y_##bd##bpc; \
  |  | 3489|  24.2k|        f->bd_fn.copy_pal_block_uv = dav1d_copy_pal_block_uv_##bd##bpc; \
  |  | 3490|  24.2k|        f->bd_fn.read_pal_plane = dav1d_read_pal_plane_##bd##bpc; \
  |  | 3491|  24.2k|        f->bd_fn.read_pal_uv = dav1d_read_pal_uv_##bd##bpc
  ------------------
 3499|  24.2k|#endif
 3500|  24.2k|    }
 3501|  47.5k|#undef assign_bitdepth_case
 3502|       |
 3503|  47.5k|    int ref_coded_width[7];
 3504|  47.5k|    if (IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|  47.5k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 15.1k, False: 32.4k]
  |  |  ------------------
  ------------------
 3505|  15.1k|        if (f->frame_hdr->primary_ref_frame != DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|  15.1k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (3505:13): [True: 13.7k, False: 1.35k]
  ------------------
 3506|  13.7k|            const int pri_ref = f->frame_hdr->refidx[f->frame_hdr->primary_ref_frame];
 3507|  13.7k|            if (!c->refs[pri_ref].p.p.data[0]) {
  ------------------
  |  Branch (3507:17): [True: 254, False: 13.5k]
  ------------------
 3508|    254|                res = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|    254|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3509|    254|                goto error;
 3510|    254|            }
 3511|  13.7k|        }
 3512|   108k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3512:25): [True: 96.1k, False: 12.7k]
  ------------------
 3513|  96.1k|            const int refidx = f->frame_hdr->refidx[i];
 3514|  96.1k|            if (!c->refs[refidx].p.p.data[0] ||
  ------------------
  |  Branch (3514:17): [True: 249, False: 95.8k]
  ------------------
 3515|  95.8k|                f->frame_hdr->width[0] * 2 < c->refs[refidx].p.p.p.w ||
  ------------------
  |  Branch (3515:17): [True: 713, False: 95.1k]
  ------------------
 3516|  95.1k|                f->frame_hdr->height * 2 < c->refs[refidx].p.p.p.h ||
  ------------------
  |  Branch (3516:17): [True: 460, False: 94.6k]
  ------------------
 3517|  94.6k|                f->frame_hdr->width[0] > c->refs[refidx].p.p.p.w * 16 ||
  ------------------
  |  Branch (3517:17): [True: 429, False: 94.2k]
  ------------------
 3518|  94.2k|                f->frame_hdr->height > c->refs[refidx].p.p.p.h * 16 ||
  ------------------
  |  Branch (3518:17): [True: 225, False: 94.0k]
  ------------------
 3519|  94.0k|                f->seq_hdr->layout != c->refs[refidx].p.p.p.layout ||
  ------------------
  |  Branch (3519:17): [True: 0, False: 94.0k]
  ------------------
 3520|  94.0k|                bpc != c->refs[refidx].p.p.p.bpc)
  ------------------
  |  Branch (3520:17): [True: 0, False: 94.0k]
  ------------------
 3521|  2.07k|            {
 3522|  6.51k|                for (int j = 0; j < i; j++)
  ------------------
  |  Branch (3522:33): [True: 4.43k, False: 2.07k]
  ------------------
 3523|  4.43k|                    dav1d_thread_picture_unref(&f->refp[j]);
 3524|  2.07k|                res = DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|  2.07k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3525|  2.07k|                goto error;
 3526|  2.07k|            }
 3527|  94.0k|            dav1d_thread_picture_ref(&f->refp[i], &c->refs[refidx].p);
 3528|  94.0k|            ref_coded_width[i] = c->refs[refidx].p.p.frame_hdr->width[0];
 3529|  94.0k|            if (f->frame_hdr->width[0] != c->refs[refidx].p.p.p.w ||
  ------------------
  |  Branch (3529:17): [True: 11.7k, False: 82.2k]
  ------------------
 3530|  82.2k|                f->frame_hdr->height != c->refs[refidx].p.p.p.h)
  ------------------
  |  Branch (3530:17): [True: 4.84k, False: 77.4k]
  ------------------
 3531|  16.5k|            {
 3532|  16.5k|#define scale_fac(ref_sz, this_sz) \
 3533|  16.5k|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
 3534|  16.5k|                f->svc[i][0].scale = scale_fac(c->refs[refidx].p.p.p.w,
  ------------------
  |  | 3533|  16.5k|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
  ------------------
 3535|  16.5k|                                               f->frame_hdr->width[0]);
 3536|  16.5k|                f->svc[i][1].scale = scale_fac(c->refs[refidx].p.p.p.h,
  ------------------
  |  | 3533|  16.5k|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
  ------------------
 3537|  16.5k|                                               f->frame_hdr->height);
 3538|  16.5k|                f->svc[i][0].step = (f->svc[i][0].scale + 8) >> 4;
 3539|  16.5k|                f->svc[i][1].step = (f->svc[i][1].scale + 8) >> 4;
 3540|  77.4k|            } else {
 3541|  77.4k|                f->svc[i][0].scale = f->svc[i][1].scale = 0;
 3542|  77.4k|            }
 3543|  94.0k|            f->gmv_warp_allowed[i] = f->frame_hdr->gmv[i].type > DAV1D_WM_TYPE_TRANSLATION &&
  ------------------
  |  Branch (3543:38): [True: 5.58k, False: 88.4k]
  ------------------
 3544|  5.58k|                                     !f->frame_hdr->force_integer_mv &&
  ------------------
  |  Branch (3544:38): [True: 4.80k, False: 782]
  ------------------
 3545|  4.80k|                                     !dav1d_get_shear_params(&f->frame_hdr->gmv[i]) &&
  ------------------
  |  Branch (3545:38): [True: 3.97k, False: 831]
  ------------------
 3546|  3.97k|                                     !f->svc[i][0].scale;
  ------------------
  |  Branch (3546:38): [True: 3.43k, False: 541]
  ------------------
 3547|  94.0k|        }
 3548|  14.8k|    }
 3549|       |
 3550|       |    // setup entropy
 3551|  45.2k|    if (f->frame_hdr->primary_ref_frame == DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|  45.2k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (3551:9): [True: 33.4k, False: 11.7k]
  ------------------
 3552|  33.4k|        dav1d_cdf_thread_init_static(&f->in_cdf, f->frame_hdr->quant.yac);
 3553|  33.4k|    } else {
 3554|  11.7k|        const int pri_ref = f->frame_hdr->refidx[f->frame_hdr->primary_ref_frame];
 3555|  11.7k|        dav1d_cdf_thread_ref(&f->in_cdf, &c->cdf[pri_ref]);
 3556|  11.7k|    }
 3557|  45.2k|    if (f->frame_hdr->refresh_context) {
  ------------------
  |  Branch (3557:9): [True: 14.7k, False: 30.4k]
  ------------------
 3558|  14.7k|        res = dav1d_cdf_thread_alloc(c, &f->out_cdf, c->n_fc > 1);
 3559|  14.7k|        if (res < 0) goto error;
  ------------------
  |  Branch (3559:13): [True: 0, False: 14.7k]
  ------------------
 3560|  14.7k|    }
 3561|       |
 3562|       |    // FIXME qsort so tiles are in order (for frame threading)
 3563|  45.2k|    if (f->n_tile_data_alloc < c->n_tile_data) {
  ------------------
  |  Branch (3563:9): [True: 9.30k, False: 35.9k]
  ------------------
 3564|  9.30k|        dav1d_free(f->tile);
  ------------------
  |  |  135|  9.30k|#define dav1d_free(ptr) free(ptr)
  ------------------
 3565|  9.30k|        assert(c->n_tile_data < INT_MAX / (int)sizeof(*f->tile));
  ------------------
  |  Branch (3565:9): [True: 9.30k, False: 0]
  ------------------
 3566|  9.30k|        f->tile = dav1d_malloc(ALLOC_TILE, c->n_tile_data * sizeof(*f->tile));
  ------------------
  |  |  132|  9.30k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 3567|  9.30k|        if (!f->tile) {
  ------------------
  |  Branch (3567:13): [True: 0, False: 9.30k]
  ------------------
 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|  9.30k|        f->n_tile_data_alloc = c->n_tile_data;
 3573|  9.30k|    }
 3574|  45.2k|    memcpy(f->tile, c->tile, c->n_tile_data * sizeof(*f->tile));
 3575|  45.2k|    memset(c->tile, 0, c->n_tile_data * sizeof(*c->tile));
 3576|  45.2k|    f->n_tile_data = c->n_tile_data;
 3577|  45.2k|    c->n_tile_data = 0;
 3578|       |
 3579|       |    // allocate frame
 3580|  45.2k|    res = dav1d_thread_picture_alloc(c, f, bpc);
 3581|  45.2k|    if (res < 0) goto error;
  ------------------
  |  Branch (3581:9): [True: 0, False: 45.2k]
  ------------------
 3582|       |
 3583|  45.2k|    if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (3583:9): [True: 4.79k, False: 40.4k]
  ------------------
 3584|  4.79k|        res = dav1d_picture_alloc_copy(c, &f->cur, f->frame_hdr->width[0], &f->sr_cur.p);
 3585|  4.79k|        if (res < 0) goto error;
  ------------------
  |  Branch (3585:13): [True: 0, False: 4.79k]
  ------------------
 3586|  40.4k|    } else {
 3587|  40.4k|        dav1d_picture_ref(&f->cur, &f->sr_cur.p);
 3588|  40.4k|    }
 3589|       |
 3590|  45.2k|    if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (3590:9): [True: 4.79k, False: 40.4k]
  ------------------
 3591|  4.79k|        f->resize_step[0] = scale_fac(f->cur.p.w, f->sr_cur.p.p.w);
  ------------------
  |  | 3533|  4.79k|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
  ------------------
 3592|  4.79k|        const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 3593|  4.79k|        const int in_cw = (f->cur.p.w + ss_hor) >> ss_hor;
 3594|  4.79k|        const int out_cw = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
 3595|  4.79k|        f->resize_step[1] = scale_fac(in_cw, out_cw);
  ------------------
  |  | 3533|  4.79k|    ((((ref_sz) << 14) + ((this_sz) >> 1)) / (this_sz))
  ------------------
 3596|  4.79k|#undef scale_fac
 3597|  4.79k|        f->resize_start[0] = get_upscale_x0(f->cur.p.w, f->sr_cur.p.p.w, f->resize_step[0]);
 3598|  4.79k|        f->resize_start[1] = get_upscale_x0(in_cw, out_cw, f->resize_step[1]);
 3599|  4.79k|    }
 3600|       |
 3601|       |    // move f->cur into output queue
 3602|  45.2k|    if (c->n_fc == 1) {
  ------------------
  |  Branch (3602:9): [True: 45.2k, False: 0]
  ------------------
 3603|  45.2k|        if (f->frame_hdr->show_frame || c->output_invisible_frames) {
  ------------------
  |  Branch (3603:13): [True: 40.5k, False: 4.68k]
  |  Branch (3603:41): [True: 0, False: 4.68k]
  ------------------
 3604|  40.5k|            dav1d_thread_picture_ref(&c->out, &f->sr_cur);
 3605|  40.5k|            c->event_flags |= dav1d_picture_get_event_flags(&f->sr_cur);
 3606|  40.5k|        }
 3607|  45.2k|    } else {
 3608|      0|        dav1d_thread_picture_ref(out_delayed, &f->sr_cur);
 3609|      0|    }
 3610|       |
 3611|  45.2k|    f->w4 = (f->frame_hdr->width[0] + 3) >> 2;
 3612|  45.2k|    f->h4 = (f->frame_hdr->height + 3) >> 2;
 3613|  45.2k|    f->bw = ((f->frame_hdr->width[0] + 7) >> 3) << 1;
 3614|  45.2k|    f->bh = ((f->frame_hdr->height + 7) >> 3) << 1;
 3615|  45.2k|    f->sb128w = (f->bw + 31) >> 5;
 3616|  45.2k|    f->sb128h = (f->bh + 31) >> 5;
 3617|  45.2k|    f->sb_shift = 4 + f->seq_hdr->sb128;
 3618|  45.2k|    f->sb_step = 16 << f->seq_hdr->sb128;
 3619|  45.2k|    f->sbh = (f->bh + f->sb_step - 1) >> f->sb_shift;
 3620|  45.2k|    f->b4_stride = (f->bw + 31) & ~31;
 3621|  45.2k|    f->bitdepth_max = (1 << f->cur.p.bpc) - 1;
 3622|  45.2k|    atomic_init(&f->task_thread.error, 0);
 3623|  45.2k|    const int uses_2pass = c->n_fc > 1;
 3624|  45.2k|    const int cols = f->frame_hdr->tiling.cols;
 3625|  45.2k|    const int rows = f->frame_hdr->tiling.rows;
 3626|  45.2k|    f->task_thread.task_counter = (cols * rows + f->sbh) << uses_2pass;
 3627|       |
 3628|       |    // ref_mvs
 3629|  45.2k|    if (IS_INTER_OR_SWITCH(f->frame_hdr) || f->frame_hdr->allow_intrabc) {
  ------------------
  |  |   36|  90.4k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 12.7k, False: 32.4k]
  |  |  ------------------
  ------------------
  |  Branch (3629:45): [True: 18.7k, False: 13.6k]
  ------------------
 3630|  31.5k|        f->mvs_ref = dav1d_ref_create_using_pool(c->refmvs_pool,
 3631|  31.5k|            sizeof(*f->mvs) * f->sb128h * 16 * (f->b4_stride >> 1));
 3632|  31.5k|        if (!f->mvs_ref) {
  ------------------
  |  Branch (3632:13): [True: 0, False: 31.5k]
  ------------------
 3633|      0|            res = DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 3634|      0|            goto error;
 3635|      0|        }
 3636|  31.5k|        f->mvs = f->mvs_ref->data;
 3637|  31.5k|        if (!f->frame_hdr->allow_intrabc) {
  ------------------
  |  Branch (3637:13): [True: 12.7k, False: 18.7k]
  ------------------
 3638|   102k|            for (int i = 0; i < 7; i++)
  ------------------
  |  Branch (3638:29): [True: 89.5k, False: 12.7k]
  ------------------
 3639|  89.5k|                f->refpoc[i] = f->refp[i].p.frame_hdr->frame_offset;
 3640|  18.7k|        } else {
 3641|  18.7k|            memset(f->refpoc, 0, sizeof(f->refpoc));
 3642|  18.7k|        }
 3643|  31.5k|        if (f->frame_hdr->use_ref_frame_mvs) {
  ------------------
  |  Branch (3643:13): [True: 8.64k, False: 22.9k]
  ------------------
 3644|  69.1k|            for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3644:29): [True: 60.5k, False: 8.64k]
  ------------------
 3645|  60.5k|                const int refidx = f->frame_hdr->refidx[i];
 3646|  60.5k|                const int ref_w = ((ref_coded_width[i] + 7) >> 3) << 1;
 3647|  60.5k|                const int ref_h = ((f->refp[i].p.p.h + 7) >> 3) << 1;
 3648|  60.5k|                if (c->refs[refidx].refmvs != NULL &&
  ------------------
  |  Branch (3648:21): [True: 44.4k, False: 16.1k]
  ------------------
 3649|  44.4k|                    ref_w == f->bw && ref_h == f->bh)
  ------------------
  |  Branch (3649:21): [True: 43.9k, False: 469]
  |  Branch (3649:39): [True: 43.7k, False: 240]
  ------------------
 3650|  43.7k|                {
 3651|  43.7k|                    f->ref_mvs_ref[i] = c->refs[refidx].refmvs;
 3652|  43.7k|                    dav1d_ref_inc(f->ref_mvs_ref[i]);
 3653|  43.7k|                    f->ref_mvs[i] = c->refs[refidx].refmvs->data;
 3654|  43.7k|                } else {
 3655|  16.8k|                    f->ref_mvs[i] = NULL;
 3656|  16.8k|                    f->ref_mvs_ref[i] = NULL;
 3657|  16.8k|                }
 3658|  60.5k|                memcpy(f->refrefpoc[i], c->refs[refidx].refpoc,
 3659|  60.5k|                       sizeof(*f->refrefpoc));
 3660|  60.5k|            }
 3661|  22.9k|        } else {
 3662|  22.9k|            memset(f->ref_mvs_ref, 0, sizeof(f->ref_mvs_ref));
 3663|  22.9k|        }
 3664|  31.5k|    } else {
 3665|  13.6k|        f->mvs_ref = NULL;
 3666|  13.6k|        memset(f->ref_mvs_ref, 0, sizeof(f->ref_mvs_ref));
 3667|  13.6k|    }
 3668|       |
 3669|       |    // segmap
 3670|  45.2k|    if (f->frame_hdr->segmentation.enabled) {
  ------------------
  |  Branch (3670:9): [True: 9.53k, False: 35.6k]
  ------------------
 3671|       |        // By default, the previous segmentation map is not initialised.
 3672|  9.53k|        f->prev_segmap_ref = NULL;
 3673|  9.53k|        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|  9.53k|        if (f->frame_hdr->segmentation.temporal || !f->frame_hdr->segmentation.update_map) {
  ------------------
  |  Branch (3677:13): [True: 480, False: 9.05k]
  |  Branch (3677:52): [True: 6.98k, False: 2.07k]
  ------------------
 3678|  7.46k|            const int pri_ref = f->frame_hdr->primary_ref_frame;
 3679|  7.46k|            assert(pri_ref != DAV1D_PRIMARY_REF_NONE);
  ------------------
  |  Branch (3679:13): [True: 7.46k, False: 0]
  ------------------
 3680|  7.46k|            const int ref_w = ((ref_coded_width[pri_ref] + 7) >> 3) << 1;
 3681|  7.46k|            const int ref_h = ((f->refp[pri_ref].p.p.h + 7) >> 3) << 1;
 3682|  7.46k|            if (ref_w == f->bw && ref_h == f->bh) {
  ------------------
  |  Branch (3682:17): [True: 7.00k, False: 458]
  |  Branch (3682:35): [True: 6.68k, False: 314]
  ------------------
 3683|  6.68k|                f->prev_segmap_ref = c->refs[f->frame_hdr->refidx[pri_ref]].segmap;
 3684|  6.68k|                if (f->prev_segmap_ref) {
  ------------------
  |  Branch (3684:21): [True: 6.12k, False: 563]
  ------------------
 3685|  6.12k|                    dav1d_ref_inc(f->prev_segmap_ref);
 3686|  6.12k|                    f->prev_segmap = f->prev_segmap_ref->data;
 3687|  6.12k|                }
 3688|  6.68k|            }
 3689|  7.46k|        }
 3690|       |
 3691|  9.53k|        if (f->frame_hdr->segmentation.update_map) {
  ------------------
  |  Branch (3691:13): [True: 2.55k, False: 6.98k]
  ------------------
 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|  2.55k|            f->cur_segmap_ref = dav1d_ref_create_using_pool(c->segmap_pool,
 3696|  2.55k|                sizeof(*f->cur_segmap) * f->b4_stride * 32 * f->sb128h);
 3697|  2.55k|            if (!f->cur_segmap_ref) {
  ------------------
  |  Branch (3697:17): [True: 0, False: 2.55k]
  ------------------
 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|  2.55k|            f->cur_segmap = f->cur_segmap_ref->data;
 3703|  6.98k|        } else if (f->prev_segmap_ref) {
  ------------------
  |  Branch (3703:20): [True: 5.82k, False: 1.16k]
  ------------------
 3704|       |            // We're not updating an existing map, and we have a valid
 3705|       |            // reference. Use that.
 3706|  5.82k|            f->cur_segmap_ref = f->prev_segmap_ref;
 3707|  5.82k|            dav1d_ref_inc(f->cur_segmap_ref);
 3708|  5.82k|            f->cur_segmap = f->prev_segmap_ref->data;
 3709|  5.82k|        } else {
 3710|       |            // We need to make a new map. Allocate one here and zero it out.
 3711|  1.16k|            const size_t segmap_size = sizeof(*f->cur_segmap) * f->b4_stride * 32 * f->sb128h;
 3712|  1.16k|            f->cur_segmap_ref = dav1d_ref_create_using_pool(c->segmap_pool, segmap_size);
 3713|  1.16k|            if (!f->cur_segmap_ref) {
  ------------------
  |  Branch (3713:17): [True: 0, False: 1.16k]
  ------------------
 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.16k|            f->cur_segmap = f->cur_segmap_ref->data;
 3718|  1.16k|            memset(f->cur_segmap, 0, segmap_size);
 3719|  1.16k|        }
 3720|  35.6k|    } else {
 3721|  35.6k|        f->cur_segmap = NULL;
 3722|  35.6k|        f->cur_segmap_ref = NULL;
 3723|  35.6k|        f->prev_segmap_ref = NULL;
 3724|  35.6k|    }
 3725|       |
 3726|       |    // update references etc.
 3727|  45.2k|    const unsigned refresh_frame_flags = f->frame_hdr->refresh_frame_flags;
 3728|   406k|    for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (3728:21): [True: 361k, False: 45.2k]
  ------------------
 3729|   361k|        if (refresh_frame_flags & (1 << i)) {
  ------------------
  |  Branch (3729:13): [True: 299k, False: 62.4k]
  ------------------
 3730|   299k|            if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (3730:17): [True: 89.5k, False: 209k]
  ------------------
 3731|  89.5k|                dav1d_thread_picture_unref(&c->refs[i].p);
 3732|   299k|            dav1d_thread_picture_ref(&c->refs[i].p, &f->sr_cur);
 3733|       |
 3734|   299k|            dav1d_cdf_thread_unref(&c->cdf[i]);
 3735|   299k|            if (f->frame_hdr->refresh_context) {
  ------------------
  |  Branch (3735:17): [True: 73.4k, False: 225k]
  ------------------
 3736|  73.4k|                dav1d_cdf_thread_ref(&c->cdf[i], &f->out_cdf);
 3737|   225k|            } else {
 3738|   225k|                dav1d_cdf_thread_ref(&c->cdf[i], &f->in_cdf);
 3739|   225k|            }
 3740|       |
 3741|   299k|            dav1d_ref_dec(&c->refs[i].segmap);
 3742|   299k|            c->refs[i].segmap = f->cur_segmap_ref;
 3743|   299k|            if (f->cur_segmap_ref)
  ------------------
  |  Branch (3743:17): [True: 50.5k, False: 248k]
  ------------------
 3744|  50.5k|                dav1d_ref_inc(f->cur_segmap_ref);
 3745|   299k|            dav1d_ref_dec(&c->refs[i].refmvs);
 3746|   299k|            if (!f->frame_hdr->allow_intrabc) {
  ------------------
  |  Branch (3746:17): [True: 149k, False: 149k]
  ------------------
 3747|   149k|                c->refs[i].refmvs = f->mvs_ref;
 3748|   149k|                if (f->mvs_ref)
  ------------------
  |  Branch (3748:21): [True: 45.8k, False: 103k]
  ------------------
 3749|  45.8k|                    dav1d_ref_inc(f->mvs_ref);
 3750|   149k|            }
 3751|   299k|            memcpy(c->refs[i].refpoc, f->refpoc, sizeof(f->refpoc));
 3752|   299k|        }
 3753|   361k|    }
 3754|       |
 3755|  45.2k|    if (c->n_fc == 1) {
  ------------------
  |  Branch (3755:9): [True: 45.2k, False: 0]
  ------------------
 3756|  45.2k|        if ((res = dav1d_decode_frame(f)) < 0) {
  ------------------
  |  Branch (3756:13): [True: 26.1k, False: 19.0k]
  ------------------
 3757|  26.1k|            dav1d_thread_picture_unref(&c->out);
 3758|   235k|            for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (3758:29): [True: 209k, False: 26.1k]
  ------------------
 3759|   209k|                if (refresh_frame_flags & (1 << i)) {
  ------------------
  |  Branch (3759:21): [True: 182k, False: 27.0k]
  ------------------
 3760|   182k|                    if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (3760:25): [True: 182k, False: 0]
  ------------------
 3761|   182k|                        dav1d_thread_picture_unref(&c->refs[i].p);
 3762|   182k|                    dav1d_cdf_thread_unref(&c->cdf[i]);
 3763|   182k|                    dav1d_ref_dec(&c->refs[i].segmap);
 3764|   182k|                    dav1d_ref_dec(&c->refs[i].refmvs);
 3765|   182k|                }
 3766|   209k|            }
 3767|  26.1k|            goto error;
 3768|  26.1k|        }
 3769|  45.2k|    } else {
 3770|      0|        dav1d_task_frame_init(f);
 3771|      0|        pthread_mutex_unlock(&c->task_thread.lock);
 3772|      0|    }
 3773|       |
 3774|  19.0k|    return 0;
 3775|  28.5k|error:
 3776|  28.5k|    atomic_init(&f->task_thread.error, 1);
 3777|  28.5k|    dav1d_cdf_thread_unref(&f->in_cdf);
 3778|  28.5k|    if (f->frame_hdr->refresh_context)
  ------------------
  |  Branch (3778:9): [True: 4.47k, False: 24.0k]
  ------------------
 3779|  4.47k|        dav1d_cdf_thread_unref(&f->out_cdf);
 3780|   228k|    for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (3780:21): [True: 199k, False: 28.5k]
  ------------------
 3781|   199k|        if (f->refp[i].p.frame_hdr)
  ------------------
  |  Branch (3781:13): [True: 0, False: 199k]
  ------------------
 3782|      0|            dav1d_thread_picture_unref(&f->refp[i]);
 3783|   199k|        dav1d_ref_dec(&f->ref_mvs_ref[i]);
 3784|   199k|    }
 3785|  28.5k|    if (c->n_fc == 1)
  ------------------
  |  Branch (3785:9): [True: 28.5k, False: 0]
  ------------------
 3786|  28.5k|        dav1d_thread_picture_unref(&c->out);
 3787|      0|    else
 3788|      0|        dav1d_thread_picture_unref(out_delayed);
 3789|  28.5k|    dav1d_picture_unref_internal(&f->cur);
 3790|  28.5k|    dav1d_thread_picture_unref(&f->sr_cur);
 3791|  28.5k|    dav1d_ref_dec(&f->mvs_ref);
 3792|  28.5k|    dav1d_ref_dec(&f->seq_hdr_ref);
 3793|  28.5k|    dav1d_ref_dec(&f->frame_hdr_ref);
 3794|  28.5k|    dav1d_data_props_copy(&c->cached_error_props, &c->in.m);
 3795|       |
 3796|  28.5k|    for (int i = 0; i < f->n_tile_data; i++)
  ------------------
  |  Branch (3796:21): [True: 0, False: 28.5k]
  ------------------
 3797|      0|        dav1d_data_unref_internal(&f->tile[i].data);
 3798|  28.5k|    f->n_tile_data = 0;
 3799|       |
 3800|  28.5k|    if (c->n_fc > 1)
  ------------------
  |  Branch (3800:9): [True: 0, False: 28.5k]
  ------------------
 3801|      0|        pthread_mutex_unlock(&c->task_thread.lock);
 3802|       |
 3803|  28.5k|    return res;
 3804|  45.2k|}
decode.c:reset_context:
 2433|   597k|static void reset_context(BlockContext *const ctx, const int keyframe, const int pass) {
 2434|   597k|    memset(ctx->intra, keyframe, sizeof(ctx->intra));
 2435|   597k|    memset(ctx->uvmode, DC_PRED, sizeof(ctx->uvmode));
 2436|   597k|    if (keyframe)
  ------------------
  |  Branch (2436:9): [True: 511k, False: 85.5k]
  ------------------
 2437|   511k|        memset(ctx->mode, DC_PRED, sizeof(ctx->mode));
 2438|       |
 2439|   597k|    if (pass == 2) return;
  ------------------
  |  Branch (2439:9): [True: 0, False: 597k]
  ------------------
 2440|       |
 2441|   597k|    memset(ctx->partition, 0, sizeof(ctx->partition));
 2442|   597k|    memset(ctx->skip, 0, sizeof(ctx->skip));
 2443|   597k|    memset(ctx->skip_mode, 0, sizeof(ctx->skip_mode));
 2444|   597k|    memset(ctx->tx_lpf_y, 2, sizeof(ctx->tx_lpf_y));
 2445|   597k|    memset(ctx->tx_lpf_uv, 1, sizeof(ctx->tx_lpf_uv));
 2446|   597k|    memset(ctx->tx_intra, -1, sizeof(ctx->tx_intra));
 2447|   597k|    memset(ctx->tx, TX_64X64, sizeof(ctx->tx));
 2448|   597k|    if (!keyframe) {
  ------------------
  |  Branch (2448:9): [True: 85.5k, False: 511k]
  ------------------
 2449|  85.5k|        memset(ctx->ref, -1, sizeof(ctx->ref));
 2450|  85.5k|        memset(ctx->comp_type, 0, sizeof(ctx->comp_type));
 2451|  85.5k|        memset(ctx->mode, NEARESTMV, sizeof(ctx->mode));
 2452|  85.5k|    }
 2453|   597k|    memset(ctx->lcoef, 0x40, sizeof(ctx->lcoef));
 2454|   597k|    memset(ctx->ccoef, 0x40, sizeof(ctx->ccoef));
 2455|   597k|    memset(ctx->filter, DAV1D_N_SWITCHABLE_FILTERS, sizeof(ctx->filter));
 2456|   597k|    memset(ctx->seg_pred, 0, sizeof(ctx->seg_pred));
 2457|   597k|    memset(ctx->pal_sz, 0, sizeof(ctx->pal_sz));
 2458|   597k|}
decode.c:decode_sb:
 2162|  3.01M|{
 2163|  3.01M|    const Dav1dFrameContext *const f = t->f;
 2164|  3.01M|    Dav1dTileState *const ts = t->ts;
 2165|  3.01M|    const int hsz = 16 >> bl;
 2166|  3.01M|    const int have_h_split = f->bw > t->bx + hsz;
 2167|  3.01M|    const int have_v_split = f->bh > t->by + hsz;
 2168|       |
 2169|  3.01M|    if (!have_h_split && !have_v_split) {
  ------------------
  |  Branch (2169:9): [True: 105k, False: 2.91M]
  |  Branch (2169:26): [True: 50.0k, False: 55.3k]
  ------------------
 2170|  50.0k|        assert(bl < BL_8X8);
  ------------------
  |  Branch (2170:9): [True: 50.0k, False: 0]
  ------------------
 2171|  50.0k|        return decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 0));
  ------------------
  |  |   51|  50.0k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
 2172|  50.0k|    }
 2173|       |
 2174|  2.96M|    uint16_t *pc;
 2175|  2.96M|    enum BlockPartition bp;
 2176|  2.96M|    int ctx, bx8, by8;
 2177|  2.96M|    if (t->frame_thread.pass != 2) {
  ------------------
  |  Branch (2177:9): [True: 2.96M, False: 0]
  ------------------
 2178|  2.96M|        if (0 && bl == BL_64X64)
  ------------------
  |  Branch (2178:13): [Folded, False: 2.96M]
  |  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|  2.96M|        bx8 = (t->bx & 31) >> 1;
 2182|  2.96M|        by8 = (t->by & 31) >> 1;
 2183|  2.96M|        ctx = get_partition_ctx(t->a, &t->l, bl, by8, bx8);
 2184|  2.96M|        pc = ts->cdf.m.partition[bl][ctx];
 2185|  2.96M|    }
 2186|       |
 2187|  2.96M|    if (have_h_split && have_v_split) {
  ------------------
  |  Branch (2187:9): [True: 2.91M, False: 55.3k]
  |  Branch (2187:25): [True: 2.33M, False: 575k]
  ------------------
 2188|  2.33M|        if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (2188:13): [True: 0, False: 2.33M]
  ------------------
 2189|      0|            const Av1Block *const b = &f->frame_thread.b[t->by * f->b4_stride + t->bx];
 2190|      0|            bp = b->bl == bl ? b->bp : PARTITION_SPLIT;
  ------------------
  |  Branch (2190:18): [True: 0, False: 0]
  ------------------
 2191|  2.33M|        } else {
 2192|  2.33M|            bp = dav1d_msac_decode_symbol_adapt16(&ts->msac, pc,
  ------------------
  |  |   57|  2.33M|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 2193|  2.33M|                                                  dav1d_partition_type_count[bl]);
 2194|  2.33M|            if (f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I422 &&
  ------------------
  |  Branch (2194:17): [True: 19.9k, False: 2.31M]
  ------------------
 2195|  19.9k|                (bp == PARTITION_V || bp == PARTITION_V4 ||
  ------------------
  |  Branch (2195:18): [True: 329, False: 19.6k]
  |  Branch (2195:39): [True: 291, False: 19.3k]
  ------------------
 2196|  19.3k|                 bp == PARTITION_T_LEFT_SPLIT || bp == PARTITION_T_RIGHT_SPLIT))
  ------------------
  |  Branch (2196:18): [True: 198, False: 19.1k]
  |  Branch (2196:50): [True: 410, False: 18.7k]
  ------------------
 2197|  1.22k|            {
 2198|  1.22k|                return 1;
 2199|  1.22k|            }
 2200|  2.33M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  2.33M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 2.33M]
  |  |  ------------------
  |  |   35|  2.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|  2.33M|        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|  2.33M|        }
 2205|  2.33M|        const uint8_t *const b = dav1d_block_sizes[bl][bp];
 2206|       |
 2207|  2.33M|        switch (bp) {
 2208|   937k|        case PARTITION_NONE:
  ------------------
  |  Branch (2208:9): [True: 937k, False: 1.39M]
  ------------------
 2209|   937k|            if (decode_b(t, bl, b[0], PARTITION_NONE, node->o))
  ------------------
  |  Branch (2209:17): [True: 606, False: 937k]
  ------------------
 2210|    606|                return -1;
 2211|   937k|            break;
 2212|   937k|        case PARTITION_H:
  ------------------
  |  Branch (2212:9): [True: 254k, False: 2.08M]
  ------------------
 2213|   254k|            if (decode_b(t, bl, b[0], PARTITION_H, node->h[0]))
  ------------------
  |  Branch (2213:17): [True: 290, False: 254k]
  ------------------
 2214|    290|                return -1;
 2215|   254k|            t->by += hsz;
 2216|   254k|            if (decode_b(t, bl, b[0], PARTITION_H, node->h[1]))
  ------------------
  |  Branch (2216:17): [True: 207, False: 253k]
  ------------------
 2217|    207|                return -1;
 2218|   253k|            t->by -= hsz;
 2219|   253k|            break;
 2220|   168k|        case PARTITION_V:
  ------------------
  |  Branch (2220:9): [True: 168k, False: 2.16M]
  ------------------
 2221|   168k|            if (decode_b(t, bl, b[0], PARTITION_V, node->v[0]))
  ------------------
  |  Branch (2221:17): [True: 197, False: 168k]
  ------------------
 2222|    197|                return -1;
 2223|   168k|            t->bx += hsz;
 2224|   168k|            if (decode_b(t, bl, b[0], PARTITION_V, node->v[1]))
  ------------------
  |  Branch (2224:17): [True: 290, False: 168k]
  ------------------
 2225|    290|                return -1;
 2226|   168k|            t->bx -= hsz;
 2227|   168k|            break;
 2228|   522k|        case PARTITION_SPLIT:
  ------------------
  |  Branch (2228:9): [True: 522k, False: 1.81M]
  ------------------
 2229|   522k|            if (bl == BL_8X8) {
  ------------------
  |  Branch (2229:17): [True: 136k, False: 386k]
  ------------------
 2230|   136k|                const EdgeTip *const tip = (const EdgeTip *) node;
 2231|   136k|                assert(hsz == 1);
  ------------------
  |  Branch (2231:17): [True: 136k, False: 0]
  ------------------
 2232|   136k|                if (decode_b(t, bl, BS_4x4, PARTITION_SPLIT, EDGE_ALL_TR_AND_BL))
  ------------------
  |  Branch (2232:21): [True: 432, False: 135k]
  ------------------
 2233|    432|                    return -1;
 2234|   135k|                const enum Filter2d tl_filter = t->tl_4x4_filter;
 2235|   135k|                t->bx++;
 2236|   135k|                if (decode_b(t, bl, BS_4x4, PARTITION_SPLIT, tip->split[0]))
  ------------------
  |  Branch (2236:21): [True: 195, False: 135k]
  ------------------
 2237|    195|                    return -1;
 2238|   135k|                t->bx--;
 2239|   135k|                t->by++;
 2240|   135k|                if (decode_b(t, bl, BS_4x4, PARTITION_SPLIT, tip->split[1]))
  ------------------
  |  Branch (2240:21): [True: 206, False: 135k]
  ------------------
 2241|    206|                    return -1;
 2242|   135k|                t->bx++;
 2243|   135k|                t->tl_4x4_filter = tl_filter;
 2244|   135k|                if (decode_b(t, bl, BS_4x4, PARTITION_SPLIT, tip->split[2]))
  ------------------
  |  Branch (2244:21): [True: 215, False: 135k]
  ------------------
 2245|    215|                    return -1;
 2246|   135k|                t->bx--;
 2247|   135k|                t->by--;
 2248|   135k|#if ARCH_X86_64
 2249|   135k|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (2249:21): [True: 0, False: 135k]
  ------------------
 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|      0|                    const int p = t->frame_thread.pass & 1;
 2254|      0|                    ts->frame_thread[p].cf =
 2255|      0|                        (void*)(((uintptr_t)ts->frame_thread[p].cf + 63) & ~63);
 2256|      0|                }
 2257|   135k|#endif
 2258|   386k|            } else {
 2259|   386k|                if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 0)))
  ------------------
  |  |   51|   386k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2259:21): [True: 1.17k, False: 384k]
  ------------------
 2260|  1.17k|                    return 1;
 2261|   384k|                t->bx += hsz;
 2262|   384k|                if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 1)))
  ------------------
  |  |   51|   384k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2262:21): [True: 998, False: 383k]
  ------------------
 2263|    998|                    return 1;
 2264|   383k|                t->bx -= hsz;
 2265|   383k|                t->by += hsz;
 2266|   383k|                if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 2)))
  ------------------
  |  |   51|   383k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2266:21): [True: 984, False: 382k]
  ------------------
 2267|    984|                    return 1;
 2268|   382k|                t->bx += hsz;
 2269|   382k|                if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 3)))
  ------------------
  |  |   51|   382k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2269:21): [True: 1.39k, False: 381k]
  ------------------
 2270|  1.39k|                    return 1;
 2271|   381k|                t->bx -= hsz;
 2272|   381k|                t->by -= hsz;
 2273|   381k|            }
 2274|   516k|            break;
 2275|   516k|        case PARTITION_T_TOP_SPLIT: {
  ------------------
  |  Branch (2275:9): [True: 38.3k, False: 2.29M]
  ------------------
 2276|  38.3k|            if (decode_b(t, bl, b[0], PARTITION_T_TOP_SPLIT, EDGE_ALL_TR_AND_BL))
  ------------------
  |  Branch (2276:17): [True: 194, False: 38.1k]
  ------------------
 2277|    194|                return -1;
 2278|  38.1k|            t->bx += hsz;
 2279|  38.1k|            if (decode_b(t, bl, b[0], PARTITION_T_TOP_SPLIT, node->v[1]))
  ------------------
  |  Branch (2279:17): [True: 196, False: 37.9k]
  ------------------
 2280|    196|                return -1;
 2281|  37.9k|            t->bx -= hsz;
 2282|  37.9k|            t->by += hsz;
 2283|  37.9k|            if (decode_b(t, bl, b[1], PARTITION_T_TOP_SPLIT, node->h[1]))
  ------------------
  |  Branch (2283:17): [True: 207, False: 37.7k]
  ------------------
 2284|    207|                return -1;
 2285|  37.7k|            t->by -= hsz;
 2286|  37.7k|            break;
 2287|  37.9k|        }
 2288|  42.7k|        case PARTITION_T_BOTTOM_SPLIT: {
  ------------------
  |  Branch (2288:9): [True: 42.7k, False: 2.29M]
  ------------------
 2289|  42.7k|            if (decode_b(t, bl, b[0], PARTITION_T_BOTTOM_SPLIT, node->h[0]))
  ------------------
  |  Branch (2289:17): [True: 259, False: 42.4k]
  ------------------
 2290|    259|                return -1;
 2291|  42.4k|            t->by += hsz;
 2292|  42.4k|            if (decode_b(t, bl, b[1], PARTITION_T_BOTTOM_SPLIT, node->v[0]))
  ------------------
  |  Branch (2292:17): [True: 197, False: 42.2k]
  ------------------
 2293|    197|                return -1;
 2294|  42.2k|            t->bx += hsz;
 2295|  42.2k|            if (decode_b(t, bl, b[1], PARTITION_T_BOTTOM_SPLIT, 0))
  ------------------
  |  Branch (2295:17): [True: 195, False: 42.0k]
  ------------------
 2296|    195|                return -1;
 2297|  42.0k|            t->bx -= hsz;
 2298|  42.0k|            t->by -= hsz;
 2299|  42.0k|            break;
 2300|  42.2k|        }
 2301|  27.8k|        case PARTITION_T_LEFT_SPLIT: {
  ------------------
  |  Branch (2301:9): [True: 27.8k, False: 2.30M]
  ------------------
 2302|  27.8k|            if (decode_b(t, bl, b[0], PARTITION_T_LEFT_SPLIT, EDGE_ALL_TR_AND_BL))
  ------------------
  |  Branch (2302:17): [True: 274, False: 27.5k]
  ------------------
 2303|    274|                return -1;
 2304|  27.5k|            t->by += hsz;
 2305|  27.5k|            if (decode_b(t, bl, b[0], PARTITION_T_LEFT_SPLIT, node->h[1]))
  ------------------
  |  Branch (2305:17): [True: 197, False: 27.3k]
  ------------------
 2306|    197|                return -1;
 2307|  27.3k|            t->by -= hsz;
 2308|  27.3k|            t->bx += hsz;
 2309|  27.3k|            if (decode_b(t, bl, b[1], PARTITION_T_LEFT_SPLIT, node->v[1]))
  ------------------
  |  Branch (2309:17): [True: 196, False: 27.1k]
  ------------------
 2310|    196|                return -1;
 2311|  27.1k|            t->bx -= hsz;
 2312|  27.1k|            break;
 2313|  27.3k|        }
 2314|  45.2k|        case PARTITION_T_RIGHT_SPLIT: {
  ------------------
  |  Branch (2314:9): [True: 45.2k, False: 2.29M]
  ------------------
 2315|  45.2k|            if (decode_b(t, bl, b[0], PARTITION_T_RIGHT_SPLIT, node->v[0]))
  ------------------
  |  Branch (2315:17): [True: 230, False: 45.0k]
  ------------------
 2316|    230|                return -1;
 2317|  45.0k|            t->bx += hsz;
 2318|  45.0k|            if (decode_b(t, bl, b[1], PARTITION_T_RIGHT_SPLIT, node->h[0]))
  ------------------
  |  Branch (2318:17): [True: 196, False: 44.8k]
  ------------------
 2319|    196|                return -1;
 2320|  44.8k|            t->by += hsz;
 2321|  44.8k|            if (decode_b(t, bl, b[1], PARTITION_T_RIGHT_SPLIT, 0))
  ------------------
  |  Branch (2321:17): [True: 212, False: 44.6k]
  ------------------
 2322|    212|                return -1;
 2323|  44.6k|            t->by -= hsz;
 2324|  44.6k|            t->bx -= hsz;
 2325|  44.6k|            break;
 2326|  44.8k|        }
 2327|   102k|        case PARTITION_H4: {
  ------------------
  |  Branch (2327:9): [True: 102k, False: 2.23M]
  ------------------
 2328|   102k|            const EdgeBranch *const branch = (const EdgeBranch *) node;
 2329|   102k|            if (decode_b(t, bl, b[0], PARTITION_H4, node->h[0]))
  ------------------
  |  Branch (2329:17): [True: 200, False: 102k]
  ------------------
 2330|    200|                return -1;
 2331|   102k|            t->by += hsz >> 1;
 2332|   102k|            if (decode_b(t, bl, b[0], PARTITION_H4, branch->h4))
  ------------------
  |  Branch (2332:17): [True: 206, False: 102k]
  ------------------
 2333|    206|                return -1;
 2334|   102k|            t->by += hsz >> 1;
 2335|   102k|            if (decode_b(t, bl, b[0], PARTITION_H4, EDGE_ALL_LEFT_HAS_BOTTOM))
  ------------------
  |  Branch (2335:17): [True: 197, False: 102k]
  ------------------
 2336|    197|                return -1;
 2337|   102k|            t->by += hsz >> 1;
 2338|   102k|            if (t->by < f->bh)
  ------------------
  |  Branch (2338:17): [True: 97.8k, False: 4.24k]
  ------------------
 2339|  97.8k|                if (decode_b(t, bl, b[0], PARTITION_H4, node->h[1]))
  ------------------
  |  Branch (2339:21): [True: 212, False: 97.6k]
  ------------------
 2340|    212|                    return -1;
 2341|   101k|            t->by -= hsz * 3 >> 1;
 2342|   101k|            break;
 2343|   102k|        }
 2344|   197k|        case PARTITION_V4: {
  ------------------
  |  Branch (2344:9): [True: 197k, False: 2.13M]
  ------------------
 2345|   197k|            const EdgeBranch *const branch = (const EdgeBranch *) node;
 2346|   197k|            if (decode_b(t, bl, b[0], PARTITION_V4, node->v[0]))
  ------------------
  |  Branch (2346:17): [True: 268, False: 197k]
  ------------------
 2347|    268|                return -1;
 2348|   197k|            t->bx += hsz >> 1;
 2349|   197k|            if (decode_b(t, bl, b[0], PARTITION_V4, branch->v4))
  ------------------
  |  Branch (2349:17): [True: 274, False: 197k]
  ------------------
 2350|    274|                return -1;
 2351|   197k|            t->bx += hsz >> 1;
 2352|   197k|            if (decode_b(t, bl, b[0], PARTITION_V4, EDGE_ALL_TOP_HAS_RIGHT))
  ------------------
  |  Branch (2352:17): [True: 197, False: 196k]
  ------------------
 2353|    197|                return -1;
 2354|   196k|            t->bx += hsz >> 1;
 2355|   196k|            if (t->bx < f->bw)
  ------------------
  |  Branch (2355:17): [True: 192k, False: 4.13k]
  ------------------
 2356|   192k|                if (decode_b(t, bl, b[0], PARTITION_V4, node->v[1]))
  ------------------
  |  Branch (2356:21): [True: 196, False: 192k]
  ------------------
 2357|    196|                    return -1;
 2358|   196k|            t->bx -= hsz * 3 >> 1;
 2359|   196k|            break;
 2360|   196k|        }
 2361|      0|        default: assert(0);
  ------------------
  |  Branch (2361:9): [True: 0, False: 2.33M]
  |  Branch (2361:18): [Folded, False: 0]
  ------------------
 2362|  2.33M|        }
 2363|  2.33M|    } else if (have_h_split) {
  ------------------
  |  Branch (2363:16): [True: 575k, False: 55.3k]
  ------------------
 2364|   575k|        unsigned is_split;
 2365|   575k|        if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (2365:13): [True: 0, False: 575k]
  ------------------
 2366|      0|            const Av1Block *const b = &f->frame_thread.b[t->by * f->b4_stride + t->bx];
 2367|      0|            is_split = b->bl != bl;
 2368|   575k|        } else {
 2369|   575k|            is_split = dav1d_msac_decode_bool(&ts->msac,
  ------------------
  |  |   54|   575k|#define dav1d_msac_decode_bool           dav1d_msac_decode_bool_sse2
  ------------------
 2370|   575k|                           gather_top_partition_prob(pc, bl));
 2371|   575k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   575k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 575k]
  |  |  ------------------
  |  |   35|   575k|        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|   575k|        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|   575k|        }
 2376|       |
 2377|   575k|        assert(bl < BL_8X8);
  ------------------
  |  Branch (2377:9): [True: 575k, False: 0]
  ------------------
 2378|   575k|        if (is_split) {
  ------------------
  |  Branch (2378:13): [True: 377k, False: 198k]
  ------------------
 2379|   377k|            bp = PARTITION_SPLIT;
 2380|   377k|            if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 0))) return 1;
  ------------------
  |  |   51|   377k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2380:17): [True: 5.08k, False: 372k]
  ------------------
 2381|   372k|            t->bx += hsz;
 2382|   372k|            if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 1))) return 1;
  ------------------
  |  |   51|   372k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2382:17): [True: 2.15k, False: 369k]
  ------------------
 2383|   369k|            t->bx -= hsz;
 2384|   369k|        } else {
 2385|   198k|            bp = PARTITION_H;
 2386|   198k|            if (decode_b(t, bl, dav1d_block_sizes[bl][PARTITION_H][0],
  ------------------
  |  Branch (2386:17): [True: 282, False: 197k]
  ------------------
 2387|   198k|                         PARTITION_H, node->h[0]))
 2388|    282|                return -1;
 2389|   198k|        }
 2390|   575k|    } else {
 2391|  55.3k|        assert(have_v_split);
  ------------------
  |  Branch (2391:9): [True: 55.3k, False: 0]
  ------------------
 2392|  55.3k|        unsigned is_split;
 2393|  55.3k|        if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (2393:13): [True: 0, False: 55.3k]
  ------------------
 2394|      0|            const Av1Block *const b = &f->frame_thread.b[t->by * f->b4_stride + t->bx];
 2395|      0|            is_split = b->bl != bl;
 2396|  55.3k|        } else {
 2397|  55.3k|            is_split = dav1d_msac_decode_bool(&ts->msac,
  ------------------
  |  |   54|  55.3k|#define dav1d_msac_decode_bool           dav1d_msac_decode_bool_sse2
  ------------------
 2398|  55.3k|                           gather_left_partition_prob(pc, bl));
 2399|  55.3k|            if (f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I422 && !is_split)
  ------------------
  |  Branch (2399:17): [True: 2.14k, False: 53.1k]
  |  Branch (2399:63): [True: 327, False: 1.81k]
  ------------------
 2400|    327|                return 1;
 2401|  54.9k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  54.9k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 54.9k]
  |  |  ------------------
  |  |   35|  54.9k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  54.9k|        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|  54.9k|        }
 2406|       |
 2407|  55.3k|        assert(bl < BL_8X8);
  ------------------
  |  Branch (2407:9): [True: 54.9k, False: 0]
  ------------------
 2408|  54.9k|        if (is_split) {
  ------------------
  |  Branch (2408:13): [True: 33.3k, False: 21.5k]
  ------------------
 2409|  33.3k|            bp = PARTITION_SPLIT;
 2410|  33.3k|            if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 0))) return 1;
  ------------------
  |  |   51|  33.3k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2410:17): [True: 3.42k, False: 29.9k]
  ------------------
 2411|  29.9k|            t->by += hsz;
 2412|  29.9k|            if (decode_sb(t, bl + 1, INTRA_EDGE_SPLIT(node, 2))) return 1;
  ------------------
  |  |   51|  29.9k|    ((const EdgeNode*)((uintptr_t)(n) + ((const EdgeBranch*)(n))->split_offset[i]))
  ------------------
  |  Branch (2412:17): [True: 1.92k, False: 28.0k]
  ------------------
 2413|  28.0k|            t->by -= hsz;
 2414|  28.0k|        } else {
 2415|  21.5k|            bp = PARTITION_V;
 2416|  21.5k|            if (decode_b(t, bl, dav1d_block_sizes[bl][PARTITION_V][0],
  ------------------
  |  Branch (2416:17): [True: 361, False: 21.2k]
  ------------------
 2417|  21.5k|                         PARTITION_V, node->v[0]))
 2418|    361|                return -1;
 2419|  21.5k|        }
 2420|  54.9k|    }
 2421|       |
 2422|  2.94M|    if (t->frame_thread.pass != 2 && (bp != PARTITION_SPLIT || bl == BL_8X8)) {
  ------------------
  |  Branch (2422:9): [True: 2.94M, False: 0]
  |  Branch (2422:39): [True: 2.02M, False: 914k]
  |  Branch (2422:64): [True: 135k, False: 779k]
  ------------------
 2423|  2.16M|#define set_ctx(rep_macro) \
 2424|  2.16M|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
 2425|  2.16M|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
 2426|  2.16M|        case_set_upto16(ulog2(hsz));
  ------------------
  |  |   80|  2.16M|    switch (var) { \
  |  |   81|   592k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 2424|   592k|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|   592k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   592k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2425|   592k|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|   592k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   592k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:5): [True: 592k, False: 1.57M]
  |  |  ------------------
  |  |   82|   722k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 2424|   722k|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|   722k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   722k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2425|   722k|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|   722k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   722k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (82:5): [True: 722k, False: 1.44M]
  |  |  ------------------
  |  |   83|   394k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 2424|   394k|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|   394k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   394k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2425|   394k|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|   394k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   394k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (83:5): [True: 394k, False: 1.76M]
  |  |  ------------------
  |  |   84|   301k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 2424|   301k|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|   301k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   301k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2425|   301k|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|   301k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   301k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (84:5): [True: 301k, False: 1.86M]
  |  |  ------------------
  |  |   85|   151k|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 2424|   151k|        rep_macro(t->a->partition, bx8, dav1d_al_part_ctx[0][bl][bp]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|   151k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   151k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   151k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   151k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 151k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2425|   151k|        rep_macro(t->l.partition, by8, dav1d_al_part_ctx[1][bl][bp])
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|   151k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   151k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   151k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   151k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 151k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (85:5): [True: 151k, False: 2.01M]
  |  |  ------------------
  |  |   86|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (86:5): [True: 0, False: 2.16M]
  |  |  ------------------
  |  |   87|  2.16M|    }
  ------------------
  |  Branch (2426:9): [Folded, False: 0]
  ------------------
 2427|  2.16M|#undef set_ctx
 2428|  2.16M|    }
 2429|       |
 2430|  2.94M|    return 0;
 2431|  2.94M|}
decode.c:decode_b:
  724|  4.19M|                    const enum EdgeFlags intra_edge_flags) {
  725|  4.19M|    Dav1dTileState *const ts = t->ts;
  726|  4.19M|    const Dav1dFrameContext *const f = t->f;
  727|  4.19M|    Av1Block b_mem, *const b = t->frame_thread.pass ?
  ------------------
  |  Branch (727:32): [True: 0, False: 4.19M]
  ------------------
  728|  4.19M|        &f->frame_thread.b[t->by * f->b4_stride + t->bx] : &b_mem;
  729|  4.19M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  730|  4.19M|    const int bx4 = t->bx & 31, by4 = t->by & 31;
  731|  4.19M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  732|  4.19M|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  733|  4.19M|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
  734|  4.19M|    const int bw4 = b_dim[0], bh4 = b_dim[1];
  735|  4.19M|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
  736|  4.19M|    const int cbw4 = (bw4 + ss_hor) >> ss_hor, cbh4 = (bh4 + ss_ver) >> ss_ver;
  737|  4.19M|    const int have_left = t->bx > ts->tiling.col_start;
  738|  4.19M|    const int have_top = t->by > ts->tiling.row_start;
  739|  4.19M|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (739:28): [True: 2.58M, False: 1.60M]
  ------------------
  740|  2.58M|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (740:29): [True: 2.34M, False: 239k]
  |  Branch (740:45): [True: 119k, False: 119k]
  ------------------
  741|  2.46M|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (741:29): [True: 2.37M, False: 95.2k]
  |  Branch (741:45): [True: 47.6k, False: 47.6k]
  ------------------
  742|       |
  743|  4.19M|    if (t->frame_thread.pass == 2) {
  ------------------
  |  Branch (743:9): [True: 0, False: 4.19M]
  ------------------
  744|      0|        if (b->intra) {
  ------------------
  |  Branch (744:13): [True: 0, False: 0]
  ------------------
  745|      0|            f->bd_fn.recon_b_intra(t, bs, intra_edge_flags, b);
  746|       |
  747|      0|            const enum IntraPredMode y_mode_nofilt =
  748|      0|                b->y_mode == FILTER_PRED ? DC_PRED : b->y_mode;
  ------------------
  |  Branch (748:17): [True: 0, False: 0]
  ------------------
  749|      0|#define set_ctx(rep_macro) \
  750|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  751|      0|            rep_macro(edge->intra, off, 1)
  752|      0|            BlockContext *edge = t->a;
  753|      0|            for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (753:40): [True: 0, False: 0]
  ------------------
  754|      0|                case_set(b_dim[2 + i]);
  ------------------
  |  |   70|      0|    switch (var) { \
  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  |  750|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  751|      0|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  |  750|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  751|      0|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  |  750|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  751|      0|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  |  750|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  751|      0|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  |  750|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  751|      0|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  |  750|      0|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  751|      0|            rep_macro(edge->intra, off, 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   78|      0|    }
  ------------------
  |  Branch (754:17): [Folded, False: 0]
  ------------------
  755|      0|            }
  756|      0|#undef set_ctx
  757|      0|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|      0|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  758|      0|                refmvs_block *const r = &t->rt.r[(t->by & 31) + 5 + bh4 - 1][t->bx];
  759|      0|                for (int x = 0; x < bw4; x++) {
  ------------------
  |  Branch (759:33): [True: 0, False: 0]
  ------------------
  760|      0|                    r[x].ref.ref[0] = 0;
  761|      0|                    r[x].bs = bs;
  762|      0|                }
  763|      0|                refmvs_block *const *rr = &t->rt.r[(t->by & 31) + 5];
  764|      0|                const int bx = t->bx + bw4 - 1;
  765|      0|                for (int y = 0; y < bh4 - 1; y++) {
  ------------------
  |  Branch (765:33): [True: 0, False: 0]
  ------------------
  766|      0|                    refmvs_block *d = &rr[y][bx];
  767|      0|                    d->ref.ref[0] = 0;
  768|      0|                    d->bs = bs;
  769|      0|                }
  770|      0|            }
  771|       |
  772|      0|            if (has_chroma) {
  ------------------
  |  Branch (772:17): [True: 0, False: 0]
  ------------------
  773|      0|                uint8_t uv_mode = b->uv_mode;
  774|      0|                dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], uv_mode);
  775|      0|                dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], uv_mode);
  776|      0|            }
  777|      0|        } else {
  778|      0|            if (IS_INTER_OR_SWITCH(f->frame_hdr) /* not intrabc */ &&
  ------------------
  |  |   36|      0|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  779|      0|                b->comp_type == COMP_INTER_NONE && b->motion_mode == MM_WARP)
  ------------------
  |  Branch (779:17): [True: 0, False: 0]
  |  Branch (779:52): [True: 0, False: 0]
  ------------------
  780|      0|            {
  781|      0|                if (b->matrix[0] == INT16_MIN) {
  ------------------
  |  Branch (781:21): [True: 0, False: 0]
  ------------------
  782|      0|                    t->warpmv.type = DAV1D_WM_TYPE_IDENTITY;
  783|      0|                } else {
  784|      0|                    t->warpmv.type = DAV1D_WM_TYPE_AFFINE;
  785|      0|                    t->warpmv.matrix[2] = b->matrix[0] + 0x10000;
  786|      0|                    t->warpmv.matrix[3] = b->matrix[1];
  787|      0|                    t->warpmv.matrix[4] = b->matrix[2];
  788|      0|                    t->warpmv.matrix[5] = b->matrix[3] + 0x10000;
  789|      0|                    dav1d_set_affine_mv2d(bw4, bh4, b->mv2d, &t->warpmv,
  790|      0|                                          t->bx, t->by);
  791|      0|                    dav1d_get_shear_params(&t->warpmv);
  792|      0|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
  793|      0|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|      0|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 0]
  |  |  ------------------
  |  |   35|      0|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|      0|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  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|      0|#undef signabs
  808|      0|                }
  809|      0|            }
  810|      0|            if (f->bd_fn.recon_b_inter(t, bs, b)) return -1;
  ------------------
  |  Branch (810:17): [True: 0, False: 0]
  ------------------
  811|       |
  812|      0|            const uint8_t *const filter = dav1d_filter_dir[b->filter2d];
  813|      0|            BlockContext *edge = t->a;
  814|      0|            for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (814:40): [True: 0, False: 0]
  ------------------
  815|      0|#define set_ctx(rep_macro) \
  816|      0|                rep_macro(edge->filter[0], off, filter[0]); \
  817|      0|                rep_macro(edge->filter[1], off, filter[1]); \
  818|      0|                rep_macro(edge->intra, off, 0)
  819|      0|                case_set(b_dim[2 + i]);
  ------------------
  |  |   70|      0|    switch (var) { \
  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  |  816|      0|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  817|      0|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  818|      0|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|      0|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  |  816|      0|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  817|      0|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  818|      0|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  |  816|      0|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  817|      0|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  818|      0|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|      0|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  |  816|      0|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  817|      0|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  818|      0|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|      0|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|      0|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  |  816|      0|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  817|      0|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  818|      0|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|      0|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|      0|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|      0|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  |  816|      0|                rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  817|      0|                rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  818|      0|                rep_macro(edge->intra, off, 0)
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|      0|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|      0|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|      0|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 0]
  |  |  ------------------
  |  |   78|      0|    }
  ------------------
  |  Branch (819:17): [Folded, False: 0]
  ------------------
  820|      0|#undef set_ctx
  821|      0|            }
  822|       |
  823|      0|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|      0|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  824|      0|                refmvs_block *const r = &t->rt.r[(t->by & 31) + 5 + bh4 - 1][t->bx];
  825|      0|                const int ref1 = b->ref[0] + 1;
  826|      0|                const union mv mv1 = b->mv[0];
  827|      0|                for (int x = 0; x < bw4; x++) {
  ------------------
  |  Branch (827:33): [True: 0, False: 0]
  ------------------
  828|      0|                    r[x].ref.ref[0] = ref1;
  829|      0|                    r[x].mv.mv[0] = mv1;
  830|      0|                    r[x].bs = bs;
  831|      0|                }
  832|      0|                refmvs_block *const *rr = &t->rt.r[(t->by & 31) + 5];
  833|      0|                const int bx = t->bx + bw4 - 1;
  834|      0|                for (int y = 0; y < bh4 - 1; y++) {
  ------------------
  |  Branch (834:33): [True: 0, False: 0]
  ------------------
  835|      0|                    refmvs_block* d = &rr[y][bx];
  836|      0|                    d->ref.ref[0] = ref1;
  837|      0|                    d->mv.mv[0] = mv1;
  838|      0|                    d->bs = bs;
  839|      0|                }
  840|      0|            }
  841|       |
  842|      0|            if (has_chroma) {
  ------------------
  |  Branch (842:17): [True: 0, False: 0]
  ------------------
  843|      0|                dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], DC_PRED);
  844|      0|                dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], DC_PRED);
  845|      0|            }
  846|      0|        }
  847|      0|        return 0;
  848|      0|    }
  849|       |
  850|  4.19M|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
  851|       |
  852|  4.19M|    b->bl = bl;
  853|  4.19M|    b->bp = bp;
  854|  4.19M|    b->bs = bs;
  855|       |
  856|  4.19M|    const Dav1dSegmentationData *seg = NULL;
  857|       |
  858|       |    // segment_id (if seg_feature for skip/ref/gmv is enabled)
  859|  4.19M|    int seg_pred = 0;
  860|  4.19M|    if (f->frame_hdr->segmentation.enabled) {
  ------------------
  |  Branch (860:9): [True: 1.21M, False: 2.97M]
  ------------------
  861|  1.21M|        if (!f->frame_hdr->segmentation.update_map) {
  ------------------
  |  Branch (861:13): [True: 281k, False: 937k]
  ------------------
  862|   281k|            if (f->prev_segmap) {
  ------------------
  |  Branch (862:17): [True: 189k, False: 92.6k]
  ------------------
  863|   189k|                unsigned seg_id = get_prev_frame_segid(f, t->by, t->bx, w4, h4,
  864|   189k|                                                       f->prev_segmap,
  865|   189k|                                                       f->b4_stride);
  866|   189k|                if (seg_id >= 8) return -1;
  ------------------
  |  Branch (866:21): [True: 0, False: 189k]
  ------------------
  867|   189k|                b->seg_id = seg_id;
  868|   189k|            } else {
  869|  92.6k|                b->seg_id = 0;
  870|  92.6k|            }
  871|   281k|            seg = &f->frame_hdr->segmentation.seg_data.d[b->seg_id];
  872|   937k|        } else if (f->frame_hdr->segmentation.seg_data.preskip) {
  ------------------
  |  Branch (872:20): [True: 469k, False: 468k]
  ------------------
  873|   469k|            if (f->frame_hdr->segmentation.temporal &&
  ------------------
  |  Branch (873:17): [True: 57.9k, False: 411k]
  ------------------
  874|  57.9k|                (seg_pred = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  57.9k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (874:17): [True: 28.8k, False: 29.0k]
  ------------------
  875|  57.9k|                                ts->cdf.m.seg_pred[t->a->seg_pred[bx4] +
  876|  57.9k|                                t->l.seg_pred[by4]])))
  877|  28.8k|            {
  878|       |                // temporal predicted seg_id
  879|  28.8k|                if (f->prev_segmap) {
  ------------------
  |  Branch (879:21): [True: 19.7k, False: 9.13k]
  ------------------
  880|  19.7k|                    unsigned seg_id = get_prev_frame_segid(f, t->by, t->bx,
  881|  19.7k|                                                           w4, h4,
  882|  19.7k|                                                           f->prev_segmap,
  883|  19.7k|                                                           f->b4_stride);
  884|  19.7k|                    if (seg_id >= 8) return -1;
  ------------------
  |  Branch (884:25): [True: 0, False: 19.7k]
  ------------------
  885|  19.7k|                    b->seg_id = seg_id;
  886|  19.7k|                } else {
  887|  9.13k|                    b->seg_id = 0;
  888|  9.13k|                }
  889|   440k|            } else {
  890|   440k|                int seg_ctx;
  891|   440k|                const unsigned pred_seg_id =
  892|   440k|                    get_cur_frame_segid(t->by, t->bx, have_top, have_left,
  893|   440k|                                        &seg_ctx, f->cur_segmap, f->b4_stride);
  894|   440k|                const unsigned diff = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|   440k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  895|   440k|                                          ts->cdf.m.seg_id[seg_ctx],
  896|   440k|                                          DAV1D_MAX_SEGMENTS - 1);
  ------------------
  |  |   43|   440k|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  897|   440k|                const unsigned last_active_seg_id =
  898|   440k|                    f->frame_hdr->segmentation.seg_data.last_active_segid;
  899|   440k|                b->seg_id = neg_deinterleave(diff, pred_seg_id,
  900|   440k|                                             last_active_seg_id + 1);
  901|   440k|                if (b->seg_id > last_active_seg_id) b->seg_id = 0; // error?
  ------------------
  |  Branch (901:21): [True: 16.6k, False: 423k]
  ------------------
  902|   440k|                if (b->seg_id >= DAV1D_MAX_SEGMENTS) b->seg_id = 0; // error?
  ------------------
  |  |   43|   440k|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (902:21): [True: 0, False: 440k]
  ------------------
  903|   440k|            }
  904|       |
  905|   469k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   469k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 469k]
  |  |  ------------------
  |  |   35|   469k|        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|   469k|        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|   469k|            seg = &f->frame_hdr->segmentation.seg_data.d[b->seg_id];
  910|   469k|        }
  911|  2.97M|    } else {
  912|  2.97M|        b->seg_id = 0;
  913|  2.97M|    }
  914|       |
  915|       |    // skip_mode
  916|  4.19M|    if ((!seg || (!seg->globalmv && seg->ref == -1 && !seg->skip)) &&
  ------------------
  |  Branch (916:10): [True: 3.44M, False: 751k]
  |  Branch (916:19): [True: 504k, False: 246k]
  |  Branch (916:37): [True: 198k, False: 305k]
  |  Branch (916:55): [True: 147k, False: 51.5k]
  ------------------
  917|  3.59M|        f->frame_hdr->skip_mode_enabled && imin(bw4, bh4) > 1)
  ------------------
  |  Branch (917:9): [True: 23.4k, False: 3.56M]
  |  Branch (917:44): [True: 16.4k, False: 6.98k]
  ------------------
  918|  16.4k|    {
  919|  16.4k|        const int smctx = t->a->skip_mode[bx4] + t->l.skip_mode[by4];
  920|  16.4k|        b->skip_mode = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  16.4k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  921|  16.4k|                           ts->cdf.m.skip_mode[smctx]);
  922|  16.4k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  16.4k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 16.4k]
  |  |  ------------------
  |  |   35|  16.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|  16.4k|        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|  4.17M|    } else {
  925|  4.17M|        b->skip_mode = 0;
  926|  4.17M|    }
  927|       |
  928|       |    // skip
  929|  4.19M|    if (b->skip_mode || (seg && seg->skip)) {
  ------------------
  |  Branch (929:9): [True: 8.42k, False: 4.18M]
  |  Branch (929:26): [True: 751k, False: 3.43M]
  |  Branch (929:33): [True: 539k, False: 211k]
  ------------------
  930|   547k|        b->skip = 1;
  931|  3.64M|    } else {
  932|  3.64M|        const int sctx = t->a->skip[bx4] + t->l.skip[by4];
  933|  3.64M|        b->skip = dav1d_msac_decode_bool_adapt(&ts->msac, ts->cdf.m.skip[sctx]);
  ------------------
  |  |   52|  3.64M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  934|  3.64M|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  3.64M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 3.64M]
  |  |  ------------------
  |  |   35|  3.64M|        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.64M|        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|  3.64M|    }
  937|       |
  938|       |    // segment_id
  939|  4.19M|    if (f->frame_hdr->segmentation.enabled &&
  ------------------
  |  Branch (939:9): [True: 1.21M, False: 2.97M]
  ------------------
  940|  1.21M|        f->frame_hdr->segmentation.update_map &&
  ------------------
  |  Branch (940:9): [True: 937k, False: 281k]
  ------------------
  941|   937k|        !f->frame_hdr->segmentation.seg_data.preskip)
  ------------------
  |  Branch (941:9): [True: 468k, False: 469k]
  ------------------
  942|   468k|    {
  943|   468k|        if (!b->skip && f->frame_hdr->segmentation.temporal &&
  ------------------
  |  Branch (943:13): [True: 194k, False: 273k]
  |  Branch (943:25): [True: 5.15k, False: 188k]
  ------------------
  944|  5.15k|            (seg_pred = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  5.15k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (944:13): [True: 3.01k, False: 2.14k]
  ------------------
  945|  5.15k|                            ts->cdf.m.seg_pred[t->a->seg_pred[bx4] +
  946|  5.15k|                            t->l.seg_pred[by4]])))
  947|  3.01k|        {
  948|       |            // temporal predicted seg_id
  949|  3.01k|            if (f->prev_segmap) {
  ------------------
  |  Branch (949:17): [True: 1.32k, False: 1.68k]
  ------------------
  950|  1.32k|                unsigned seg_id = get_prev_frame_segid(f, t->by, t->bx, w4, h4,
  951|  1.32k|                                                       f->prev_segmap,
  952|  1.32k|                                                       f->b4_stride);
  953|  1.32k|                if (seg_id >= 8) return -1;
  ------------------
  |  Branch (953:21): [True: 0, False: 1.32k]
  ------------------
  954|  1.32k|                b->seg_id = seg_id;
  955|  1.68k|            } else {
  956|  1.68k|                b->seg_id = 0;
  957|  1.68k|            }
  958|   465k|        } else {
  959|   465k|            int seg_ctx;
  960|   465k|            const unsigned pred_seg_id =
  961|   465k|                get_cur_frame_segid(t->by, t->bx, have_top, have_left,
  962|   465k|                                    &seg_ctx, f->cur_segmap, f->b4_stride);
  963|   465k|            if (b->skip) {
  ------------------
  |  Branch (963:17): [True: 273k, False: 191k]
  ------------------
  964|   273k|                b->seg_id = pred_seg_id;
  965|   273k|            } else {
  966|   191k|                const unsigned diff = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|   191k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  967|   191k|                                          ts->cdf.m.seg_id[seg_ctx],
  968|   191k|                                          DAV1D_MAX_SEGMENTS - 1);
  ------------------
  |  |   43|   191k|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  969|   191k|                const unsigned last_active_seg_id =
  970|   191k|                    f->frame_hdr->segmentation.seg_data.last_active_segid;
  971|   191k|                b->seg_id = neg_deinterleave(diff, pred_seg_id,
  972|   191k|                                             last_active_seg_id + 1);
  973|   191k|                if (b->seg_id > last_active_seg_id) b->seg_id = 0; // error?
  ------------------
  |  Branch (973:21): [True: 5.40k, False: 185k]
  ------------------
  974|   191k|            }
  975|   465k|            if (b->seg_id >= DAV1D_MAX_SEGMENTS) b->seg_id = 0; // error?
  ------------------
  |  |   43|   465k|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (975:17): [True: 6.45k, False: 458k]
  ------------------
  976|   465k|        }
  977|       |
  978|   468k|        seg = &f->frame_hdr->segmentation.seg_data.d[b->seg_id];
  979|       |
  980|   468k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   468k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 468k]
  |  |  ------------------
  |  |   35|   468k|        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|   468k|        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|   468k|    }
  984|       |
  985|       |    // cdef index
  986|  4.19M|    if (!b->skip) {
  ------------------
  |  Branch (986:9): [True: 2.25M, False: 1.94M]
  ------------------
  987|  2.25M|        const int idx = f->seq_hdr->sb128 ? ((t->bx & 16) >> 4) +
  ------------------
  |  Branch (987:25): [True: 917k, False: 1.33M]
  ------------------
  988|  1.33M|                                           ((t->by & 16) >> 3) : 0;
  989|  2.25M|        if (t->cur_sb_cdef_idx_ptr[idx] == -1) {
  ------------------
  |  Branch (989:13): [True: 372k, False: 1.87M]
  ------------------
  990|   372k|            const int v = dav1d_msac_decode_bools(&ts->msac,
  991|   372k|                              f->frame_hdr->cdef.n_bits);
  992|   372k|            t->cur_sb_cdef_idx_ptr[idx] = v;
  993|   372k|            if (bw4 > 16) t->cur_sb_cdef_idx_ptr[idx + 1] = v;
  ------------------
  |  Branch (993:17): [True: 35.4k, False: 337k]
  ------------------
  994|   372k|            if (bh4 > 16) t->cur_sb_cdef_idx_ptr[idx + 2] = v;
  ------------------
  |  Branch (994:17): [True: 23.4k, False: 349k]
  ------------------
  995|   372k|            if (bw4 == 32 && bh4 == 32) t->cur_sb_cdef_idx_ptr[idx + 3] = v;
  ------------------
  |  Branch (995:17): [True: 35.4k, False: 337k]
  |  Branch (995:30): [True: 20.7k, False: 14.7k]
  ------------------
  996|       |
  997|   372k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   372k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 372k]
  |  |  ------------------
  |  |   35|   372k|        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|   372k|        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|   372k|        }
 1001|  2.25M|    }
 1002|       |
 1003|       |    // delta-q/lf
 1004|  4.19M|    if (!((t->bx | t->by) & (31 >> !f->seq_hdr->sb128))) {
  ------------------
  |  Branch (1004:9): [True: 617k, False: 3.57M]
  ------------------
 1005|   617k|        const int prev_qidx = ts->last_qidx;
 1006|   617k|        const int have_delta_q = f->frame_hdr->delta.q.present &&
  ------------------
  |  Branch (1006:34): [True: 214k, False: 403k]
  ------------------
 1007|   214k|            (bs != (f->seq_hdr->sb128 ? BS_128x128 : BS_64x64) || !b->skip);
  ------------------
  |  Branch (1007:14): [True: 123k, False: 91.2k]
  |  Branch (1007:21): [True: 51.5k, False: 163k]
  |  Branch (1007:67): [True: 14.9k, False: 76.2k]
  ------------------
 1008|       |
 1009|   617k|        uint32_t prev_delta_lf = ts->last_delta_lf.u32;
 1010|       |
 1011|   617k|        if (have_delta_q) {
  ------------------
  |  Branch (1011:13): [True: 138k, False: 479k]
  ------------------
 1012|   138k|            int delta_q = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|   138k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1013|   138k|                                                          ts->cdf.m.delta_q, 3);
 1014|   138k|            if (delta_q == 3) {
  ------------------
  |  Branch (1014:17): [True: 26.7k, False: 111k]
  ------------------
 1015|  26.7k|                const int n_bits = 1 + dav1d_msac_decode_bools(&ts->msac, 3);
 1016|  26.7k|                delta_q = dav1d_msac_decode_bools(&ts->msac, n_bits) +
 1017|  26.7k|                          1 + (1 << n_bits);
 1018|  26.7k|            }
 1019|   138k|            if (delta_q) {
  ------------------
  |  Branch (1019:17): [True: 40.8k, False: 97.4k]
  ------------------
 1020|  40.8k|                const int sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  40.8k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
 1021|  40.8k|                delta_q = apply_sign_bool(delta_q, sign);
 1022|  40.8k|                delta_q *= 1 << f->frame_hdr->delta.q.res_log2;
 1023|  40.8k|            }
 1024|   138k|            ts->last_qidx = iclip(ts->last_qidx + delta_q, 1, 255);
 1025|   138k|            if (have_delta_q && DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   138k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 138k]
  |  |  ------------------
  |  |   35|   138k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   138k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1025:17): [True: 138k, False: 0]
  ------------------
 1026|      0|                printf("Post-delta_q[%d->%d]: r=%d\n",
 1027|      0|                       delta_q, ts->last_qidx, ts->msac.rng);
 1028|       |
 1029|   138k|            if (f->frame_hdr->delta.lf.present) {
  ------------------
  |  Branch (1029:17): [True: 40.6k, False: 97.7k]
  ------------------
 1030|  40.6k|                const int n_lfs = f->frame_hdr->delta.lf.multi ?
  ------------------
  |  Branch (1030:35): [True: 36.7k, False: 3.89k]
  ------------------
 1031|  36.7k|                    f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 ? 4 : 2 : 1;
  ------------------
  |  Branch (1031:21): [True: 30.9k, False: 5.82k]
  ------------------
 1032|       |
 1033|   179k|                for (int i = 0; i < n_lfs; i++) {
  ------------------
  |  Branch (1033:33): [True: 139k, False: 40.6k]
  ------------------
 1034|   139k|                    int delta_lf = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|   139k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1035|   139k|                        ts->cdf.m.delta_lf[i + f->frame_hdr->delta.lf.multi], 3);
 1036|   139k|                    if (delta_lf == 3) {
  ------------------
  |  Branch (1036:25): [True: 9.91k, False: 129k]
  ------------------
 1037|  9.91k|                        const int n_bits = 1 + dav1d_msac_decode_bools(&ts->msac, 3);
 1038|  9.91k|                        delta_lf = dav1d_msac_decode_bools(&ts->msac, n_bits) +
 1039|  9.91k|                                   1 + (1 << n_bits);
 1040|  9.91k|                    }
 1041|   139k|                    if (delta_lf) {
  ------------------
  |  Branch (1041:25): [True: 28.5k, False: 110k]
  ------------------
 1042|  28.5k|                        const int sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  28.5k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
 1043|  28.5k|                        delta_lf = apply_sign_bool(delta_lf, sign);
 1044|  28.5k|                        delta_lf *= 1 << f->frame_hdr->delta.lf.res_log2;
 1045|  28.5k|                    }
 1046|   139k|                    ts->last_delta_lf.i8[i] =
 1047|   139k|                        iclip(ts->last_delta_lf.i8[i] + delta_lf, -63, 63);
 1048|   139k|                    if (have_delta_q && DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   139k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 139k]
  |  |  ------------------
  |  |   35|   139k|        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|   139k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1048:25): [True: 139k, False: 0]
  ------------------
 1049|      0|                        printf("Post-delta_lf[%d:%d]: r=%d\n", i, delta_lf,
 1050|      0|                               ts->msac.rng);
 1051|   139k|                }
 1052|  40.6k|            }
 1053|   138k|        }
 1054|   617k|        if (ts->last_qidx == f->frame_hdr->quant.yac) {
  ------------------
  |  Branch (1054:13): [True: 519k, False: 98.1k]
  ------------------
 1055|       |            // assign frame-wide q values to this sb
 1056|   519k|            ts->dq = f->dq;
 1057|   519k|        } else if (ts->last_qidx != prev_qidx) {
  ------------------
  |  Branch (1057:20): [True: 12.5k, False: 85.5k]
  ------------------
 1058|       |            // find sb-specific quant parameters
 1059|  12.5k|            init_quant_tables(f->seq_hdr, f->frame_hdr, ts->last_qidx, ts->dqmem);
 1060|  12.5k|            ts->dq = ts->dqmem;
 1061|  12.5k|        }
 1062|   617k|        if (!ts->last_delta_lf.u32) {
  ------------------
  |  Branch (1062:13): [True: 574k, False: 43.4k]
  ------------------
 1063|       |            // assign frame-wide lf values to this sb
 1064|   574k|            ts->lflvl = f->lf.lvl;
 1065|   574k|        } else if (ts->last_delta_lf.u32 != prev_delta_lf) {
  ------------------
  |  Branch (1065:20): [True: 14.9k, False: 28.4k]
  ------------------
 1066|       |            // find sb-specific lf lvl parameters
 1067|  14.9k|            ts->lflvl = ts->lflvlmem;
 1068|  14.9k|            dav1d_calc_lf_values(ts->lflvlmem, f->frame_hdr, ts->last_delta_lf.i8);
 1069|  14.9k|        }
 1070|   617k|    }
 1071|       |
 1072|  4.19M|    if (b->skip_mode) {
  ------------------
  |  Branch (1072:9): [True: 8.42k, False: 4.18M]
  ------------------
 1073|  8.42k|        b->intra = 0;
 1074|  4.18M|    } else if (IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|  4.18M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 1.02M, False: 3.16M]
  |  |  ------------------
  ------------------
 1075|  1.02M|        if (seg && (seg->ref >= 0 || seg->globalmv)) {
  ------------------
  |  Branch (1075:13): [True: 442k, False: 579k]
  |  Branch (1075:21): [True: 292k, False: 150k]
  |  Branch (1075:38): [True: 49.1k, False: 100k]
  ------------------
 1076|   341k|            b->intra = !seg->ref;
 1077|   680k|        } else {
 1078|   680k|            const int ictx = get_intra_ctx(t->a, &t->l, by4, bx4,
 1079|   680k|                                           have_top, have_left);
 1080|   680k|            b->intra = !dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   680k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1081|   680k|                            ts->cdf.m.intra[ictx]);
 1082|   680k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   680k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 680k]
  |  |  ------------------
  |  |   35|   680k|        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|   680k|        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|   680k|        }
 1085|  3.16M|    } else if (f->frame_hdr->allow_intrabc) {
  ------------------
  |  Branch (1085:16): [True: 2.46M, False: 698k]
  ------------------
 1086|  2.46M|        b->intra = !dav1d_msac_decode_bool_adapt(&ts->msac, ts->cdf.m.intrabc);
  ------------------
  |  |   52|  2.46M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1087|  2.46M|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  2.46M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 2.46M]
  |  |  ------------------
  |  |   35|  2.46M|        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.46M|        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|  2.46M|    } else {
 1090|   698k|        b->intra = 1;
 1091|   698k|    }
 1092|       |
 1093|       |    // intra/inter-specific stuff
 1094|  4.19M|    if (b->intra) {
  ------------------
  |  Branch (1094:9): [True: 2.50M, False: 1.69M]
  ------------------
 1095|  2.50M|        uint16_t *const ymode_cdf = IS_INTER_OR_SWITCH(f->frame_hdr) ?
  ------------------
  |  |   36|  2.50M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 103k, False: 2.39M]
  |  |  ------------------
  ------------------
 1096|   103k|            ts->cdf.m.y_mode[dav1d_ymode_size_context[bs]] :
 1097|  2.50M|            ts->cdf.kfym[dav1d_intra_mode_context[t->a->mode[bx4]]]
 1098|  2.39M|                        [dav1d_intra_mode_context[t->l.mode[by4]]];
 1099|  2.50M|        b->y_mode = dav1d_msac_decode_symbol_adapt16(&ts->msac, ymode_cdf,
  ------------------
  |  |   57|  2.50M|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1100|  2.50M|                                                     N_INTRA_PRED_MODES - 1);
 1101|  2.50M|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  2.50M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 2.50M]
  |  |  ------------------
  |  |   35|  2.50M|        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.50M|        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|  2.50M|        if (b_dim[2] + b_dim[3] >= 2 && b->y_mode >= VERT_PRED &&
  ------------------
  |  Branch (1105:13): [True: 2.05M, False: 451k]
  |  Branch (1105:41): [True: 1.12M, False: 928k]
  ------------------
 1106|  1.12M|            b->y_mode <= VERT_LEFT_PRED)
  ------------------
  |  Branch (1106:13): [True: 559k, False: 563k]
  ------------------
 1107|   559k|        {
 1108|   559k|            uint16_t *const acdf = ts->cdf.m.angle_delta[b->y_mode - VERT_PRED];
 1109|   559k|            const int angle = dav1d_msac_decode_symbol_adapt8(&ts->msac, acdf, 6);
  ------------------
  |  |   48|   559k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1110|   559k|            b->y_angle = angle - 3;
 1111|  1.94M|        } else {
 1112|  1.94M|            b->y_angle = 0;
 1113|  1.94M|        }
 1114|       |
 1115|  2.50M|        if (has_chroma) {
  ------------------
  |  Branch (1115:13): [True: 1.65M, False: 852k]
  ------------------
 1116|  1.65M|            const int cfl_allowed = f->frame_hdr->segmentation.lossless[b->seg_id] ?
  ------------------
  |  Branch (1116:37): [True: 41.0k, False: 1.60M]
  ------------------
 1117|  1.60M|                cbw4 == 1 && cbh4 == 1 : !!(cfl_allowed_mask & (1 << bs));
  ------------------
  |  Branch (1117:17): [True: 20.6k, False: 20.3k]
  |  Branch (1117:30): [True: 15.7k, False: 4.91k]
  ------------------
 1118|  1.65M|            uint16_t *const uvmode_cdf = ts->cdf.m.uv_mode[cfl_allowed][b->y_mode];
 1119|  1.65M|            b->uv_mode = dav1d_msac_decode_symbol_adapt16(&ts->msac, uvmode_cdf,
  ------------------
  |  |   57|  1.65M|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1120|  1.65M|                             N_UV_INTRA_PRED_MODES - 1 - !cfl_allowed);
 1121|  1.65M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.65M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.65M]
  |  |  ------------------
  |  |   35|  1.65M|        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.65M|        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|  1.65M|            b->uv_angle = 0;
 1125|  1.65M|            if (b->uv_mode == CFL_PRED) {
  ------------------
  |  Branch (1125:17): [True: 357k, False: 1.29M]
  ------------------
 1126|   357k|                const int sign = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|   357k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1127|   357k|                                     ts->cdf.m.cfl_sign, 7) + 1;
 1128|   357k|                const int sign_u = sign * 0x56 >> 8, sign_v = sign - sign_u * 3;
 1129|   357k|                assert(sign_u == sign / 3);
  ------------------
  |  Branch (1129:17): [True: 357k, False: 0]
  ------------------
 1130|   357k|                if (sign_u) {
  ------------------
  |  Branch (1130:21): [True: 333k, False: 23.8k]
  ------------------
 1131|   333k|                    const int ctx = (sign_u == 2) * 3 + sign_v;
 1132|   333k|                    const int alpha = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|   333k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1133|   333k|                                          ts->cdf.m.cfl_alpha[ctx], 15) + 1;
 1134|   333k|                    b->cfl_alpha[0] = apply_sign_bool(alpha, sign_u & 1);
 1135|   333k|                } else {
 1136|  23.8k|                    b->cfl_alpha[0] = 0;
 1137|  23.8k|                }
 1138|   357k|                if (sign_v) {
  ------------------
  |  Branch (1138:21): [True: 241k, False: 115k]
  ------------------
 1139|   241k|                    const int ctx = (sign_v == 2) * 3 + sign_u;
 1140|   241k|                    const int alpha = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|   241k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1141|   241k|                                          ts->cdf.m.cfl_alpha[ctx], 15) + 1;
 1142|   241k|                    b->cfl_alpha[1] = apply_sign_bool(alpha, sign_v & 1);
 1143|   241k|                } else {
 1144|   115k|                    b->cfl_alpha[1] = 0;
 1145|   115k|                }
 1146|   357k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   357k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 357k]
  |  |  ------------------
  |  |   35|   357k|        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|   357k|        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|  1.29M|            } else if (b_dim[2] + b_dim[3] >= 2 && b->uv_mode >= VERT_PRED &&
  ------------------
  |  Branch (1149:24): [True: 1.09M, False: 195k]
  |  Branch (1149:52): [True: 641k, False: 456k]
  ------------------
 1150|   641k|                       b->uv_mode <= VERT_LEFT_PRED)
  ------------------
  |  Branch (1150:24): [True: 329k, False: 311k]
  ------------------
 1151|   329k|            {
 1152|   329k|                uint16_t *const acdf = ts->cdf.m.angle_delta[b->uv_mode - VERT_PRED];
 1153|   329k|                const int angle = dav1d_msac_decode_symbol_adapt8(&ts->msac, acdf, 6);
  ------------------
  |  |   48|   329k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1154|   329k|                b->uv_angle = angle - 3;
 1155|   329k|            }
 1156|  1.65M|        }
 1157|       |
 1158|  2.50M|        b->pal_sz[0] = b->pal_sz[1] = 0;
 1159|  2.50M|        if (f->frame_hdr->allow_screen_content_tools &&
  ------------------
  |  Branch (1159:13): [True: 1.86M, False: 633k]
  ------------------
 1160|  1.86M|            imax(bw4, bh4) <= 16 && bw4 + bh4 >= 4)
  ------------------
  |  Branch (1160:13): [True: 1.78M, False: 84.9k]
  |  Branch (1160:37): [True: 1.47M, False: 312k]
  ------------------
 1161|  1.47M|        {
 1162|  1.47M|            const int sz_ctx = b_dim[2] + b_dim[3] - 2;
 1163|  1.47M|            if (b->y_mode == DC_PRED) {
  ------------------
  |  Branch (1163:17): [True: 695k, False: 776k]
  ------------------
 1164|   695k|                const int pal_ctx = (t->a->pal_sz[bx4] > 0) + (t->l.pal_sz[by4] > 0);
 1165|   695k|                const int use_y_pal = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   695k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1166|   695k|                                          ts->cdf.m.pal_y[sz_ctx][pal_ctx]);
 1167|   695k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   695k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 695k]
  |  |  ------------------
  |  |   35|   695k|        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|   695k|        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|   695k|                if (use_y_pal)
  ------------------
  |  Branch (1169:21): [True: 74.0k, False: 621k]
  ------------------
 1170|  74.0k|                    f->bd_fn.read_pal_plane(t, b, 0, sz_ctx, bx4, by4);
 1171|   695k|            }
 1172|       |
 1173|  1.47M|            if (has_chroma && b->uv_mode == DC_PRED) {
  ------------------
  |  Branch (1173:17): [True: 1.11M, False: 356k]
  |  Branch (1173:31): [True: 336k, False: 779k]
  ------------------
 1174|   336k|                const int pal_ctx = b->pal_sz[0] > 0;
 1175|   336k|                const int use_uv_pal = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   336k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1176|   336k|                                           ts->cdf.m.pal_uv[pal_ctx]);
 1177|   336k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   336k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 336k]
  |  |  ------------------
  |  |   35|   336k|        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|   336k|        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|   336k|                if (use_uv_pal) // see aomedia bug 2183 for why we use luma coordinates
  ------------------
  |  Branch (1179:21): [True: 15.7k, False: 320k]
  ------------------
 1180|  15.7k|                    f->bd_fn.read_pal_uv(t, b, sz_ctx, bx4, by4);
 1181|   336k|            }
 1182|  1.47M|        }
 1183|       |
 1184|  2.50M|        if (b->y_mode == DC_PRED && !b->pal_sz[0] &&
  ------------------
  |  Branch (1184:13): [True: 1.08M, False: 1.41M]
  |  Branch (1184:37): [True: 1.01M, False: 74.0k]
  ------------------
 1185|  1.01M|            imax(b_dim[2], b_dim[3]) <= 3 && f->seq_hdr->filter_intra)
  ------------------
  |  Branch (1185:13): [True: 760k, False: 251k]
  |  Branch (1185:46): [True: 453k, False: 307k]
  ------------------
 1186|   453k|        {
 1187|   453k|            const int is_filter = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   453k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1188|   453k|                                      ts->cdf.m.use_filter_intra[bs]);
 1189|   453k|            if (is_filter) {
  ------------------
  |  Branch (1189:17): [True: 298k, False: 154k]
  ------------------
 1190|   298k|                b->y_mode = FILTER_PRED;
 1191|   298k|                b->y_angle = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|   298k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1192|   298k|                                 ts->cdf.m.filter_intra, 4);
 1193|   298k|            }
 1194|   453k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   453k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 453k]
  |  |  ------------------
  |  |   35|   453k|        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|   453k|        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|   453k|        }
 1198|       |
 1199|  2.50M|        if (b->pal_sz[0]) {
  ------------------
  |  Branch (1199:13): [True: 74.0k, False: 2.42M]
  ------------------
 1200|  74.0k|            uint8_t *pal_idx;
 1201|  74.0k|            if (t->frame_thread.pass) {
  ------------------
  |  Branch (1201:17): [True: 0, False: 74.0k]
  ------------------
 1202|      0|                const int p = t->frame_thread.pass & 1;
 1203|      0|                assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  Branch (1203:17): [True: 0, False: 0]
  ------------------
 1204|      0|                pal_idx = ts->frame_thread[p].pal_idx;
 1205|      0|                ts->frame_thread[p].pal_idx += bw4 * bh4 * 8;
 1206|      0|            } else
 1207|  74.0k|                pal_idx = t->scratch.pal_idx_y;
 1208|  74.0k|            read_pal_indices(t, pal_idx, b->pal_sz[0], 0, w4, h4, bw4, bh4);
 1209|  74.0k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  74.0k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 74.0k]
  |  |  ------------------
  |  |   35|  74.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|  74.0k|        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|  74.0k|        }
 1212|       |
 1213|  2.50M|        if (has_chroma && b->pal_sz[1]) {
  ------------------
  |  Branch (1213:13): [True: 1.65M, False: 852k]
  |  Branch (1213:27): [True: 15.7k, False: 1.63M]
  ------------------
 1214|  15.7k|            uint8_t *pal_idx;
 1215|  15.7k|            if (t->frame_thread.pass) {
  ------------------
  |  Branch (1215:17): [True: 0, False: 15.7k]
  ------------------
 1216|      0|                const int p = t->frame_thread.pass & 1;
 1217|      0|                assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  Branch (1217:17): [True: 0, False: 0]
  ------------------
 1218|      0|                pal_idx = ts->frame_thread[p].pal_idx;
 1219|      0|                ts->frame_thread[p].pal_idx += cbw4 * cbh4 * 8;
 1220|      0|            } else
 1221|  15.7k|                pal_idx = t->scratch.pal_idx_uv;
 1222|  15.7k|            read_pal_indices(t, pal_idx, b->pal_sz[1], 1, cw4, ch4, cbw4, cbh4);
 1223|  15.7k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  15.7k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 15.7k]
  |  |  ------------------
  |  |   35|  15.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|  15.7k|        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|  15.7k|        }
 1226|       |
 1227|  2.50M|        const TxfmInfo *t_dim;
 1228|  2.50M|        if (f->frame_hdr->segmentation.lossless[b->seg_id]) {
  ------------------
  |  Branch (1228:13): [True: 69.1k, False: 2.43M]
  ------------------
 1229|  69.1k|            b->tx = b->uvtx = (int) TX_4X4;
 1230|  69.1k|            t_dim = &dav1d_txfm_dimensions[TX_4X4];
 1231|  2.43M|        } else {
 1232|  2.43M|            b->tx = dav1d_max_txfm_size_for_bs[bs][0];
 1233|  2.43M|            b->uvtx = dav1d_max_txfm_size_for_bs[bs][f->cur.p.layout];
 1234|  2.43M|            t_dim = &dav1d_txfm_dimensions[b->tx];
 1235|  2.43M|            if (f->frame_hdr->txfm_mode == DAV1D_TX_SWITCHABLE && t_dim->max > TX_4X4) {
  ------------------
  |  Branch (1235:17): [True: 725k, False: 1.70M]
  |  Branch (1235:67): [True: 669k, False: 55.6k]
  ------------------
 1236|   669k|                const int tctx = get_tx_ctx(t->a, &t->l, t_dim, by4, bx4);
 1237|   669k|                uint16_t *const tx_cdf = ts->cdf.m.txsz[t_dim->max - 1][tctx];
 1238|   669k|                int depth = dav1d_msac_decode_symbol_adapt4(&ts->msac, tx_cdf,
  ------------------
  |  |   47|   669k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1239|   669k|                                imin(t_dim->max, 2));
 1240|       |
 1241|  1.36M|                while (depth--) {
  ------------------
  |  Branch (1241:24): [True: 694k, False: 669k]
  ------------------
 1242|   694k|                    b->tx = t_dim->sub;
 1243|   694k|                    t_dim = &dav1d_txfm_dimensions[b->tx];
 1244|   694k|                }
 1245|   669k|            }
 1246|  2.43M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  2.43M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 2.43M]
  |  |  ------------------
  |  |   35|  2.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|  2.43M|        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|  2.43M|        }
 1249|       |
 1250|       |        // reconstruction
 1251|  2.50M|        if (t->frame_thread.pass == 1) {
  ------------------
  |  Branch (1251:13): [True: 0, False: 2.50M]
  ------------------
 1252|      0|            f->bd_fn.read_coef_blocks(t, bs, b);
 1253|  2.50M|        } else {
 1254|  2.50M|            f->bd_fn.recon_b_intra(t, bs, intra_edge_flags, b);
 1255|  2.50M|        }
 1256|       |
 1257|  2.50M|        if (f->frame_hdr->loopfilter.level_y[0] ||
  ------------------
  |  Branch (1257:13): [True: 304k, False: 2.19M]
  ------------------
 1258|  2.19M|            f->frame_hdr->loopfilter.level_y[1])
  ------------------
  |  Branch (1258:13): [True: 115k, False: 2.08M]
  ------------------
 1259|   419k|        {
 1260|   419k|            dav1d_create_lf_mask_intra(&t->c->lf_mask_dsp, t->lf_mask, f->lf.level,
 1261|   419k|                                       f->b4_stride,
 1262|   419k|                                       (const uint8_t (*)[8][2])
 1263|   419k|                                       &ts->lflvl[b->seg_id][0][0][0],
 1264|   419k|                                       t->bx, t->by, f->w4, f->h4, bs,
 1265|   419k|                                       b->tx, b->uvtx, f->cur.p.layout,
 1266|   419k|                                       &t->a->tx_lpf_y[bx4], &t->l.tx_lpf_y[by4],
 1267|   419k|                                       has_chroma ? &t->a->tx_lpf_uv[cbx4] : NULL,
  ------------------
  |  Branch (1267:40): [True: 284k, False: 134k]
  ------------------
 1268|   419k|                                       has_chroma ? &t->l.tx_lpf_uv[cby4] : NULL);
  ------------------
  |  Branch (1268:40): [True: 284k, False: 134k]
  ------------------
 1269|   419k|        }
 1270|       |        // update contexts
 1271|  2.50M|        const enum IntraPredMode y_mode_nofilt =
 1272|  2.50M|            b->y_mode == FILTER_PRED ? DC_PRED : b->y_mode;
  ------------------
  |  Branch (1272:13): [True: 298k, False: 2.20M]
  ------------------
 1273|  2.50M|        BlockContext *edge = t->a;
 1274|  7.50M|        for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (1274:36): [True: 5.00M, False: 2.50M]
  ------------------
 1275|  5.00M|            int t_lsz = ((uint8_t *) &t_dim->lw)[i]; // lw then lh
 1276|  5.00M|#define set_ctx(rep_macro) \
 1277|  5.00M|            rep_macro(edge->tx_intra, off, t_lsz); \
 1278|  5.00M|            rep_macro(edge->tx, off, t_lsz); \
 1279|  5.00M|            rep_macro(edge->mode, off, y_mode_nofilt); \
 1280|  5.00M|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
 1281|  5.00M|            rep_macro(edge->seg_pred, off, seg_pred); \
 1282|  5.00M|            rep_macro(edge->skip_mode, off, 0); \
 1283|  5.00M|            rep_macro(edge->intra, off, 1); \
 1284|  5.00M|            rep_macro(edge->skip, off, b->skip); \
 1285|       |            /* see aomedia bug 2183 for why we use luma coordinates here */ \
 1286|  5.00M|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
 1287|  5.00M|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
 1288|  5.00M|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
 1289|  5.00M|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
 1290|  5.00M|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
 1291|  5.00M|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
 1292|  5.00M|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
 1293|  5.00M|            }
 1294|  5.00M|            case_set(b_dim[2 + i]);
  ------------------
  |  |   70|  5.00M|    switch (var) { \
  |  |   71|  1.00M|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 1277|  1.00M|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  1.00M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  1.00M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1278|  1.00M|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  1.00M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  1.00M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1279|  1.00M|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  1.00M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  1.00M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1280|  1.00M|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  1.00M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  1.00M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1281|  1.00M|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  1.00M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  1.00M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1282|  1.00M|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  1.00M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  1.00M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1283|  1.00M|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  1.00M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  1.00M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1284|  1.00M|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  1.00M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  1.00M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1285|  1.00M|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1286|  1.00M|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  1.00M|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  2.01M|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (56:43): [True: 608k, False: 400k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1287|  1.00M|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  1.00M|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 59.9k, False: 948k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1288|  59.9k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  59.9k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  59.9k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1289|  59.9k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  59.9k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  59.9k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1290|  59.9k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  59.9k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  59.9k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1291|  59.9k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  59.9k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  59.9k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1292|  59.9k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|  59.9k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  59.9k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1293|  59.9k|            }
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 1.00M, False: 3.99M]
  |  |  ------------------
  |  |   72|  1.37M|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 1277|  1.37M|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.37M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.37M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1278|  1.37M|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.37M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.37M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1279|  1.37M|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.37M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.37M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1280|  1.37M|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.37M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.37M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1281|  1.37M|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.37M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.37M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1282|  1.37M|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.37M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.37M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1283|  1.37M|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.37M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.37M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1284|  1.37M|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.37M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.37M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1285|  1.37M|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1286|  1.37M|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  1.37M|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  2.75M|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (58:45): [True: 973k, False: 401k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1287|  1.37M|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  1.37M|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 73.4k, False: 1.30M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1288|  73.4k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  73.4k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  73.4k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1289|  73.4k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  73.4k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  73.4k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1290|  73.4k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  73.4k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  73.4k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1291|  73.4k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  73.4k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  73.4k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1292|  73.4k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|  73.4k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  73.4k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1293|  73.4k|            }
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 1.37M, False: 3.62M]
  |  |  ------------------
  |  |   73|  1.32M|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 1277|  1.32M|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.32M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.32M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1278|  1.32M|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.32M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.32M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1279|  1.32M|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.32M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.32M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1280|  1.32M|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.32M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.32M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1281|  1.32M|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.32M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.32M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1282|  1.32M|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.32M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.32M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1283|  1.32M|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.32M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.32M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1284|  1.32M|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.32M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  1.32M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1285|  1.32M|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1286|  1.32M|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  1.32M|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  2.64M|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:45): [True: 920k, False: 400k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1287|  1.32M|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  1.32M|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 46.1k, False: 1.27M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1288|  46.1k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  46.1k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  46.1k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1289|  46.1k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  46.1k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  46.1k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1290|  46.1k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  46.1k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  46.1k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1291|  46.1k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  46.1k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  46.1k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1292|  46.1k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|  46.1k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  46.1k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1293|  46.1k|            }
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 1.32M, False: 3.68M]
  |  |  ------------------
  |  |   74|   680k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 1277|   680k|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   680k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   680k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1278|   680k|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   680k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   680k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1279|   680k|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   680k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   680k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1280|   680k|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   680k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   680k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1281|   680k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   680k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   680k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1282|   680k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   680k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   680k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1283|   680k|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   680k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   680k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1284|   680k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   680k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   680k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1285|   680k|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1286|   680k|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   680k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  1.36M|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (62:45): [True: 457k, False: 223k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1287|   680k|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   680k|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 14.7k, False: 666k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1288|  14.7k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  14.7k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  14.7k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1289|  14.7k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  14.7k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  14.7k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1290|  14.7k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  14.7k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  14.7k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1291|  14.7k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  14.7k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  14.7k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1292|  14.7k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  14.7k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  14.7k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1293|  14.7k|            }
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 680k, False: 4.32M]
  |  |  ------------------
  |  |   75|   428k|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 1277|   428k|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   428k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   428k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   428k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   428k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 428k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1278|   428k|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   428k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   428k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   428k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   428k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 428k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1279|   428k|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   428k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   428k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   428k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   428k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 428k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1280|   428k|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   428k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   428k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   428k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   428k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 428k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1281|   428k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   428k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   428k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   428k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   428k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 428k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1282|   428k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   428k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   428k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   428k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   428k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 428k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1283|   428k|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   428k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   428k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   428k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   428k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 428k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1284|   428k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   428k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   428k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   428k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   428k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 428k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1285|   428k|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1286|   428k|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   428k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   428k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   857k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (64:29): [True: 216k, False: 212k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   65|   428k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 428k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1287|   428k|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   428k|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 4.65k, False: 424k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1288|  4.65k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  4.65k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  4.65k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  4.65k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  4.65k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 4.65k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1289|  4.65k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  4.65k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  4.65k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  4.65k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  4.65k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 4.65k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1290|  4.65k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  4.65k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  4.65k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  4.65k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  4.65k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 4.65k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1291|  4.65k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  4.65k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  4.65k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  4.65k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  4.65k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 4.65k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1292|  4.65k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  4.65k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  4.65k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  4.65k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  4.65k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 4.65k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1293|  4.65k|            }
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 428k, False: 4.57M]
  |  |  ------------------
  |  |   76|   190k|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  | 1277|   190k|            rep_macro(edge->tx_intra, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   190k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   190k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   190k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   190k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 190k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1278|   190k|            rep_macro(edge->tx, off, t_lsz); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   190k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   190k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   190k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   190k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 190k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1279|   190k|            rep_macro(edge->mode, off, y_mode_nofilt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   190k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   190k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   190k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   190k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 190k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1280|   190k|            rep_macro(edge->pal_sz, off, b->pal_sz[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   190k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   190k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   190k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   190k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 190k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1281|   190k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   190k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   190k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   190k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   190k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 190k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1282|   190k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   190k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   190k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   190k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   190k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 190k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1283|   190k|            rep_macro(edge->intra, off, 1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   190k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   190k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   190k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   190k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 190k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1284|   190k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   190k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   190k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   190k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|   190k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 190k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1285|   190k|            /* see aomedia bug 2183 for why we use luma coordinates here */ \
  |  |  |  | 1286|   190k|            rep_macro(t->pal_sz_uv[i], off, (has_chroma ? b->pal_sz[1] : 0)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|   190k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|   190k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|   380k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (67:29): [True: 123k, False: 66.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   68|   190k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 190k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1287|   190k|            if (IS_INTER_OR_SWITCH(f->frame_hdr)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|   190k|    ((frame_header)->frame_type & 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (36:5): [True: 7.13k, False: 183k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1288|  7.13k|                rep_macro(edge->comp_type, off, COMP_INTER_NONE); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  7.13k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  7.13k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  7.13k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  7.13k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 7.13k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1289|  7.13k|                rep_macro(edge->ref[0], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  7.13k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  7.13k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  7.13k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  7.13k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 7.13k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1290|  7.13k|                rep_macro(edge->ref[1], off, ((uint8_t) -1)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  7.13k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  7.13k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  7.13k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  7.13k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 7.13k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1291|  7.13k|                rep_macro(edge->filter[0], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  7.13k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  7.13k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  7.13k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  7.13k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 7.13k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1292|  7.13k|                rep_macro(edge->filter[1], off, DAV1D_N_SWITCHABLE_FILTERS); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  7.13k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  7.13k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  7.13k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  7.13k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 7.13k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1293|  7.13k|            }
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 190k, False: 4.81M]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 5.00M]
  |  |  ------------------
  |  |   78|  5.00M|    }
  ------------------
  |  Branch (1294:13): [Folded, False: 0]
  ------------------
 1295|  5.00M|#undef set_ctx
 1296|  5.00M|        }
 1297|  2.50M|        if (b->pal_sz[0])
  ------------------
  |  Branch (1297:13): [True: 74.0k, False: 2.42M]
  ------------------
 1298|  74.0k|            f->bd_fn.copy_pal_block_y(t, bx4, by4, bw4, bh4);
 1299|  2.50M|        if (has_chroma) {
  ------------------
  |  Branch (1299:13): [True: 1.65M, False: 852k]
  ------------------
 1300|  1.65M|            uint8_t uv_mode = b->uv_mode;
 1301|  1.65M|            dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], uv_mode);
 1302|  1.65M|            dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], uv_mode);
 1303|  1.65M|            if (b->pal_sz[1])
  ------------------
  |  Branch (1303:17): [True: 15.7k, False: 1.63M]
  ------------------
 1304|  15.7k|                f->bd_fn.copy_pal_block_uv(t, bx4, by4, bw4, bh4);
 1305|  1.65M|        }
 1306|  2.50M|        if (IS_INTER_OR_SWITCH(f->frame_hdr) || f->frame_hdr->allow_intrabc)
  ------------------
  |  |   36|  5.00M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 103k, False: 2.39M]
  |  |  ------------------
  ------------------
  |  Branch (1306:49): [True: 1.70M, False: 698k]
  ------------------
 1307|  1.80M|            splat_intraref(f->c, t, bs, bw4, bh4);
 1308|  2.50M|    } else if (IS_KEY_OR_INTRA(f->frame_hdr)) {
  ------------------
  |  |   43|  1.69M|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  1.69M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 765k, False: 927k]
  |  |  ------------------
  ------------------
 1309|       |        // intra block copy
 1310|   765k|        refmvs_candidate mvstack[8];
 1311|   765k|        int n_mvs, ctx;
 1312|   765k|        dav1d_refmvs_find(&t->rt, mvstack, &n_mvs, &ctx,
 1313|   765k|                          (union refmvs_refpair) { .ref = { 0, -1 }},
 1314|   765k|                          bs, intra_edge_flags, t->by, t->bx);
 1315|       |
 1316|   765k|        if (mvstack[0].mv.mv[0].n)
  ------------------
  |  Branch (1316:13): [True: 693k, False: 71.5k]
  ------------------
 1317|   693k|            b->mv[0] = mvstack[0].mv.mv[0];
 1318|  71.5k|        else if (mvstack[1].mv.mv[0].n)
  ------------------
  |  Branch (1318:18): [True: 0, False: 71.5k]
  ------------------
 1319|      0|            b->mv[0] = mvstack[1].mv.mv[0];
 1320|  71.5k|        else {
 1321|  71.5k|            if (t->by - (16 << f->seq_hdr->sb128) < ts->tiling.row_start) {
  ------------------
  |  Branch (1321:17): [True: 70.3k, False: 1.28k]
  ------------------
 1322|  70.3k|                b->mv[0].y = 0;
 1323|  70.3k|                b->mv[0].x = -(512 << f->seq_hdr->sb128) - 2048;
 1324|  70.3k|            } else {
 1325|  1.28k|                b->mv[0].y = -(512 << f->seq_hdr->sb128);
 1326|  1.28k|                b->mv[0].x = 0;
 1327|  1.28k|            }
 1328|  71.5k|        }
 1329|       |
 1330|   765k|        const union mv ref = b->mv[0];
 1331|   765k|        read_mv_residual(ts, &b->mv[0], -1);
 1332|       |
 1333|       |        // clip intrabc motion vector to decoded parts of current tile
 1334|   765k|        int border_left = ts->tiling.col_start * 4;
 1335|   765k|        int border_top  = ts->tiling.row_start * 4;
 1336|   765k|        if (has_chroma) {
  ------------------
  |  Branch (1336:13): [True: 363k, False: 402k]
  ------------------
 1337|   363k|            if (bw4 < 2 &&  ss_hor)
  ------------------
  |  Branch (1337:17): [True: 167k, False: 196k]
  |  Branch (1337:29): [True: 56.2k, False: 110k]
  ------------------
 1338|  56.2k|                border_left += 4;
 1339|   363k|            if (bh4 < 2 &&  ss_ver)
  ------------------
  |  Branch (1339:17): [True: 60.3k, False: 302k]
  |  Branch (1339:29): [True: 3.74k, False: 56.6k]
  ------------------
 1340|  3.74k|                border_top  += 4;
 1341|   363k|        }
 1342|   765k|        int src_left   = t->bx * 4 + (b->mv[0].x >> 3);
 1343|   765k|        int src_top    = t->by * 4 + (b->mv[0].y >> 3);
 1344|   765k|        int src_right  = src_left + bw4 * 4;
 1345|   765k|        int src_bottom = src_top  + bh4 * 4;
 1346|   765k|        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|   765k|        if (src_left < border_left) {
  ------------------
  |  Branch (1349:13): [True: 250k, False: 514k]
  ------------------
 1350|   250k|            src_right += border_left - src_left;
 1351|   250k|            src_left  += border_left - src_left;
 1352|   514k|        } else if (src_right > border_right) {
  ------------------
  |  Branch (1352:20): [True: 228k, False: 286k]
  ------------------
 1353|   228k|            src_left  -= src_right - border_right;
 1354|   228k|            src_right -= src_right - border_right;
 1355|   228k|        }
 1356|       |        // check against top tile boundary and adjust if necessary
 1357|   765k|        if (src_top < border_top) {
  ------------------
  |  Branch (1357:13): [True: 642k, False: 122k]
  ------------------
 1358|   642k|            src_bottom += border_top - src_top;
 1359|   642k|            src_top    += border_top - src_top;
 1360|   642k|        }
 1361|       |
 1362|   765k|        const int sbx = (t->bx >> (4 + f->seq_hdr->sb128)) << (6 + f->seq_hdr->sb128);
 1363|   765k|        const int sby = (t->by >> (4 + f->seq_hdr->sb128)) << (6 + f->seq_hdr->sb128);
 1364|   765k|        const int sb_size = 1 << (6 + f->seq_hdr->sb128);
 1365|       |        // check for overlap with current superblock
 1366|   765k|        if (src_bottom > sby && src_right > sbx) {
  ------------------
  |  Branch (1366:13): [True: 744k, False: 20.1k]
  |  Branch (1366:33): [True: 237k, False: 507k]
  ------------------
 1367|   237k|            if (src_top - border_top >= src_bottom - sby) {
  ------------------
  |  Branch (1367:17): [True: 2.54k, False: 235k]
  ------------------
 1368|       |                // if possible move src up into the previous suberblock row
 1369|  2.54k|                src_top    -= src_bottom - sby;
 1370|  2.54k|                src_bottom -= src_bottom - sby;
 1371|   235k|            } else if (src_left - border_left >= src_right - sbx) {
  ------------------
  |  Branch (1371:24): [True: 227k, False: 7.58k]
  ------------------
 1372|       |                // if possible move src left into the previous suberblock
 1373|   227k|                src_left  -= src_right - sbx;
 1374|   227k|                src_right -= src_right - sbx;
 1375|   227k|            }
 1376|   237k|        }
 1377|       |        // move src up if it is below current superblock row
 1378|   765k|        if (src_bottom > sby + sb_size) {
  ------------------
  |  Branch (1378:13): [True: 6.01k, False: 759k]
  ------------------
 1379|  6.01k|            src_top    -= src_bottom - (sby + sb_size);
 1380|  6.01k|            src_bottom -= src_bottom - (sby + sb_size);
 1381|  6.01k|        }
 1382|       |        // error out if mv still overlaps with the current superblock
 1383|   765k|        if (src_bottom > sby && src_right > sbx)
  ------------------
  |  Branch (1383:13): [True: 742k, False: 22.7k]
  |  Branch (1383:33): [True: 7.58k, False: 734k]
  ------------------
 1384|  7.58k|            return -1;
 1385|       |
 1386|   757k|        b->mv[0].x = (src_left - t->bx * 4) * 8;
 1387|   757k|        b->mv[0].y = (src_top  - t->by * 4) * 8;
 1388|       |
 1389|   757k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   757k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 757k]
  |  |  ------------------
  |  |   35|   757k|        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|   757k|        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|   757k|        read_vartx_tree(t, b, bs, bx4, by4);
 1394|       |
 1395|       |        // reconstruction
 1396|   757k|        if (t->frame_thread.pass == 1) {
  ------------------
  |  Branch (1396:13): [True: 0, False: 757k]
  ------------------
 1397|      0|            f->bd_fn.read_coef_blocks(t, bs, b);
 1398|      0|            b->filter2d = FILTER_2D_BILINEAR;
 1399|   757k|        } else {
 1400|   757k|            if (f->bd_fn.recon_b_inter(t, bs, b)) return -1;
  ------------------
  |  Branch (1400:17): [True: 0, False: 757k]
  ------------------
 1401|   757k|        }
 1402|       |
 1403|   757k|        splat_intrabc_mv(f->c, t, bs, b, bw4, bh4);
 1404|   757k|        BlockContext *edge = t->a;
 1405|  2.27M|        for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (1405:36): [True: 1.51M, False: 757k]
  ------------------
 1406|  1.51M|#define set_ctx(rep_macro) \
 1407|  1.51M|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
 1408|  1.51M|            rep_macro(edge->mode, off, DC_PRED); \
 1409|  1.51M|            rep_macro(edge->pal_sz, off, 0); \
 1410|       |            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
 1411|  1.51M|            rep_macro(t->pal_sz_uv[i], off, 0); \
 1412|  1.51M|            rep_macro(edge->seg_pred, off, seg_pred); \
 1413|  1.51M|            rep_macro(edge->skip_mode, off, 0); \
 1414|  1.51M|            rep_macro(edge->intra, off, 0); \
 1415|  1.51M|            rep_macro(edge->skip, off, b->skip)
 1416|  1.51M|            case_set(b_dim[2 + i]);
  ------------------
  |  |   70|  1.51M|    switch (var) { \
  |  |   71|   744k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 1407|   744k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   744k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   744k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1408|   744k|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   744k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   744k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1409|   744k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   744k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   744k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1410|   744k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1411|   744k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   744k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   744k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1412|   744k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   744k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   744k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1413|   744k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   744k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   744k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1414|   744k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   744k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   744k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1415|   744k|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   744k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   744k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 744k, False: 770k]
  |  |  ------------------
  |  |   72|   142k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 1407|   142k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   142k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   142k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1408|   142k|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   142k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   142k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1409|   142k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   142k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   142k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1410|   142k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1411|   142k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   142k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   142k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1412|   142k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   142k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   142k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1413|   142k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   142k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   142k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1414|   142k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   142k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   142k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1415|   142k|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   142k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   142k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 142k, False: 1.37M]
  |  |  ------------------
  |  |   73|   384k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 1407|   384k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   384k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   384k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1408|   384k|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   384k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   384k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1409|   384k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   384k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   384k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1410|   384k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1411|   384k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   384k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   384k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1412|   384k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   384k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   384k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1413|   384k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   384k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   384k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1414|   384k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   384k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   384k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1415|   384k|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   384k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   384k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 384k, False: 1.13M]
  |  |  ------------------
  |  |   74|  85.5k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 1407|  85.5k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  85.5k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  85.5k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1408|  85.5k|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  85.5k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  85.5k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1409|  85.5k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  85.5k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  85.5k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1410|  85.5k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1411|  85.5k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  85.5k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  85.5k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1412|  85.5k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  85.5k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  85.5k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1413|  85.5k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  85.5k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  85.5k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1414|  85.5k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  85.5k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  85.5k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1415|  85.5k|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|  85.5k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  85.5k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 85.5k, False: 1.42M]
  |  |  ------------------
  |  |   75|   149k|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 1407|   149k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   149k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   149k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   149k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   149k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 149k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1408|   149k|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   149k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   149k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   149k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   149k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 149k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1409|   149k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   149k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   149k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   149k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   149k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 149k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1410|   149k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1411|   149k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   149k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   149k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   149k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   149k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 149k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1412|   149k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   149k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   149k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   149k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   149k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 149k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1413|   149k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   149k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   149k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   149k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   149k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 149k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1414|   149k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   149k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   149k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   149k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   149k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 149k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1415|   149k|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   149k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   149k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   149k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   149k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 149k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 149k, False: 1.36M]
  |  |  ------------------
  |  |   76|  9.52k|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  | 1407|  9.52k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  9.52k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  9.52k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  9.52k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  9.52k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 9.52k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1408|  9.52k|            rep_macro(edge->mode, off, DC_PRED); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  9.52k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  9.52k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  9.52k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  9.52k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 9.52k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1409|  9.52k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  9.52k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  9.52k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  9.52k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  9.52k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 9.52k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1410|  9.52k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1411|  9.52k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  9.52k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  9.52k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  9.52k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  9.52k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 9.52k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1412|  9.52k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  9.52k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  9.52k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  9.52k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  9.52k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 9.52k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1413|  9.52k|            rep_macro(edge->skip_mode, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  9.52k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  9.52k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  9.52k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  9.52k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 9.52k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1414|  9.52k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  9.52k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  9.52k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  9.52k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  9.52k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 9.52k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1415|  9.52k|            rep_macro(edge->skip, off, b->skip)
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  9.52k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  9.52k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  9.52k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  9.52k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 9.52k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 9.52k, False: 1.50M]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 1.51M]
  |  |  ------------------
  |  |   78|  1.51M|    }
  ------------------
  |  Branch (1416:13): [Folded, False: 0]
  ------------------
 1417|  1.51M|#undef set_ctx
 1418|  1.51M|        }
 1419|   757k|        if (has_chroma) {
  ------------------
  |  Branch (1419:13): [True: 357k, False: 400k]
  ------------------
 1420|   357k|            dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], DC_PRED);
 1421|   357k|            dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], DC_PRED);
 1422|   357k|        }
 1423|   927k|    } else {
 1424|       |        // inter-specific mode/mv coding
 1425|   927k|        int is_comp, has_subpel_filter;
 1426|       |
 1427|   927k|        if (b->skip_mode) {
  ------------------
  |  Branch (1427:13): [True: 8.42k, False: 918k]
  ------------------
 1428|  8.42k|            is_comp = 1;
 1429|   918k|        } else if ((!seg || (seg->ref == -1 && !seg->globalmv && !seg->skip)) &&
  ------------------
  |  Branch (1429:21): [True: 495k, False: 423k]
  |  Branch (1429:30): [True: 132k, False: 290k]
  |  Branch (1429:48): [True: 83.1k, False: 49.1k]
  |  Branch (1429:66): [True: 63.5k, False: 19.6k]
  ------------------
 1430|   559k|                   f->frame_hdr->switchable_comp_refs && imin(bw4, bh4) > 1)
  ------------------
  |  Branch (1430:20): [True: 303k, False: 255k]
  |  Branch (1430:58): [True: 203k, False: 100k]
  ------------------
 1431|   203k|        {
 1432|   203k|            const int ctx = get_comp_ctx(t->a, &t->l, by4, bx4,
 1433|   203k|                                         have_top, have_left);
 1434|   203k|            is_comp = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   203k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1435|   203k|                          ts->cdf.m.comp[ctx]);
 1436|   203k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   203k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 203k]
  |  |  ------------------
  |  |   35|   203k|        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|   203k|        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|   715k|        } else {
 1439|   715k|            is_comp = 0;
 1440|   715k|        }
 1441|       |
 1442|   927k|        if (b->skip_mode) {
  ------------------
  |  Branch (1442:13): [True: 8.42k, False: 918k]
  ------------------
 1443|  8.42k|            b->ref[0] = f->frame_hdr->skip_mode_refs[0];
 1444|  8.42k|            b->ref[1] = f->frame_hdr->skip_mode_refs[1];
 1445|  8.42k|            b->comp_type = COMP_INTER_AVG;
 1446|  8.42k|            b->inter_mode = NEARESTMV_NEARESTMV;
 1447|  8.42k|            b->drl_idx = NEAREST_DRL;
 1448|  8.42k|            has_subpel_filter = 0;
 1449|       |
 1450|  8.42k|            refmvs_candidate mvstack[8];
 1451|  8.42k|            int n_mvs, ctx;
 1452|  8.42k|            dav1d_refmvs_find(&t->rt, mvstack, &n_mvs, &ctx,
 1453|  8.42k|                              (union refmvs_refpair) { .ref = {
 1454|  8.42k|                                    b->ref[0] + 1, b->ref[1] + 1 }},
 1455|  8.42k|                              bs, intra_edge_flags, t->by, t->bx);
 1456|       |
 1457|  8.42k|            b->mv[0] = mvstack[0].mv.mv[0];
 1458|  8.42k|            b->mv[1] = mvstack[0].mv.mv[1];
 1459|  8.42k|            fix_mv_precision(f->frame_hdr, &b->mv[0]);
 1460|  8.42k|            fix_mv_precision(f->frame_hdr, &b->mv[1]);
 1461|  8.42k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  8.42k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 8.42k]
  |  |  ------------------
  |  |   35|  8.42k|        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.42k|        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|   918k|        } else if (is_comp) {
  ------------------
  |  Branch (1465:20): [True: 128k, False: 790k]
  ------------------
 1466|   128k|            const int dir_ctx = get_comp_dir_ctx(t->a, &t->l, by4, bx4,
 1467|   128k|                                                 have_top, have_left);
 1468|   128k|            if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   128k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1468:17): [True: 108k, False: 20.0k]
  ------------------
 1469|   128k|                    ts->cdf.m.comp_dir[dir_ctx]))
 1470|   108k|            {
 1471|       |                // bidir - first reference (fw)
 1472|   108k|                const int ctx1 = av1_get_fwd_ref_ctx(t->a, &t->l, by4, bx4,
 1473|   108k|                                                     have_top, have_left);
 1474|   108k|                if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   108k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1474:21): [True: 45.1k, False: 62.8k]
  ------------------
 1475|   108k|                        ts->cdf.m.comp_fwd_ref[0][ctx1]))
 1476|  45.1k|                {
 1477|  45.1k|                    const int ctx2 = av1_get_fwd_ref_2_ctx(t->a, &t->l, by4, bx4,
 1478|  45.1k|                                                           have_top, have_left);
 1479|  45.1k|                    b->ref[0] = 2 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  45.1k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1480|  45.1k|                                        ts->cdf.m.comp_fwd_ref[2][ctx2]);
 1481|  62.8k|                } else {
 1482|  62.8k|                    const int ctx2 = av1_get_fwd_ref_1_ctx(t->a, &t->l, by4, bx4,
 1483|  62.8k|                                                           have_top, have_left);
 1484|  62.8k|                    b->ref[0] = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  62.8k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1485|  62.8k|                                    ts->cdf.m.comp_fwd_ref[1][ctx2]);
 1486|  62.8k|                }
 1487|       |
 1488|       |                // second reference (bw)
 1489|   108k|                const int ctx3 = av1_get_bwd_ref_ctx(t->a, &t->l, by4, bx4,
 1490|   108k|                                                     have_top, have_left);
 1491|   108k|                if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   108k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1491:21): [True: 57.7k, False: 50.2k]
  ------------------
 1492|   108k|                        ts->cdf.m.comp_bwd_ref[0][ctx3]))
 1493|  57.7k|                {
 1494|  57.7k|                    b->ref[1] = 6;
 1495|  57.7k|                } else {
 1496|  50.2k|                    const int ctx4 = av1_get_bwd_ref_1_ctx(t->a, &t->l, by4, bx4,
 1497|  50.2k|                                                           have_top, have_left);
 1498|  50.2k|                    b->ref[1] = 4 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  50.2k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1499|  50.2k|                                        ts->cdf.m.comp_bwd_ref[1][ctx4]);
 1500|  50.2k|                }
 1501|   108k|            } else {
 1502|       |                // unidir
 1503|  20.0k|                const int uctx_p = av1_get_uni_p_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  280|  20.0k|#define av1_get_uni_p_ctx av1_get_ref_ctx
  ------------------
 1504|  20.0k|                                                     have_top, have_left);
 1505|  20.0k|                if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  20.0k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1505:21): [True: 3.88k, False: 16.1k]
  ------------------
 1506|  20.0k|                        ts->cdf.m.comp_uni_ref[0][uctx_p]))
 1507|  3.88k|                {
 1508|  3.88k|                    b->ref[0] = 4;
 1509|  3.88k|                    b->ref[1] = 6;
 1510|  16.1k|                } else {
 1511|  16.1k|                    const int uctx_p1 = av1_get_uni_p1_ctx(t->a, &t->l, by4, bx4,
 1512|  16.1k|                                                           have_top, have_left);
 1513|  16.1k|                    b->ref[0] = 0;
 1514|  16.1k|                    b->ref[1] = 1 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  16.1k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1515|  16.1k|                                        ts->cdf.m.comp_uni_ref[1][uctx_p1]);
 1516|  16.1k|                    if (b->ref[1] == 2) {
  ------------------
  |  Branch (1516:25): [True: 10.0k, False: 6.15k]
  ------------------
 1517|  10.0k|                        const int uctx_p2 = av1_get_uni_p2_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  281|  10.0k|#define av1_get_uni_p2_ctx av1_get_fwd_ref_2_ctx
  ------------------
 1518|  10.0k|                                                               have_top, have_left);
 1519|  10.0k|                        b->ref[1] += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  10.0k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1520|  10.0k|                                         ts->cdf.m.comp_uni_ref[2][uctx_p2]);
 1521|  10.0k|                    }
 1522|  16.1k|                }
 1523|  20.0k|            }
 1524|   128k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   128k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 128k]
  |  |  ------------------
  |  |   35|   128k|        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|   128k|        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|   128k|            refmvs_candidate mvstack[8];
 1529|   128k|            int n_mvs, ctx;
 1530|   128k|            dav1d_refmvs_find(&t->rt, mvstack, &n_mvs, &ctx,
 1531|   128k|                              (union refmvs_refpair) { .ref = {
 1532|   128k|                                    b->ref[0] + 1, b->ref[1] + 1 }},
 1533|   128k|                              bs, intra_edge_flags, t->by, t->bx);
 1534|       |
 1535|   128k|            b->inter_mode = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|   128k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 1536|   128k|                                ts->cdf.m.comp_inter_mode[ctx],
 1537|   128k|                                N_COMP_INTER_PRED_MODES - 1);
 1538|   128k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   128k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 128k]
  |  |  ------------------
  |  |   35|   128k|        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|   128k|        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|   128k|            const uint8_t *const im = dav1d_comp_inter_pred_modes[b->inter_mode];
 1543|   128k|            b->drl_idx = NEAREST_DRL;
 1544|   128k|            if (b->inter_mode == NEWMV_NEWMV) {
  ------------------
  |  Branch (1544:17): [True: 30.4k, False: 97.6k]
  ------------------
 1545|  30.4k|                if (n_mvs > 1) { // NEARER, NEAR or NEARISH
  ------------------
  |  Branch (1545:21): [True: 30.4k, False: 0]
  ------------------
 1546|  30.4k|                    const int drl_ctx_v1 = get_drl_context(mvstack, 0);
 1547|  30.4k|                    b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  30.4k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1548|  30.4k|                                      ts->cdf.m.drl_bit[drl_ctx_v1]);
 1549|  30.4k|                    if (b->drl_idx == NEARER_DRL && n_mvs > 2) {
  ------------------
  |  Branch (1549:25): [True: 21.7k, False: 8.71k]
  |  Branch (1549:53): [True: 7.56k, False: 14.1k]
  ------------------
 1550|  7.56k|                        const int drl_ctx_v2 = get_drl_context(mvstack, 1);
 1551|  7.56k|                        b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  7.56k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1552|  7.56k|                                          ts->cdf.m.drl_bit[drl_ctx_v2]);
 1553|  7.56k|                    }
 1554|  30.4k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  30.4k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 30.4k]
  |  |  ------------------
  |  |   35|  30.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|  30.4k|        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|  30.4k|                }
 1558|  97.6k|            } else if (im[0] == NEARMV || im[1] == NEARMV) {
  ------------------
  |  Branch (1558:24): [True: 26.5k, False: 71.1k]
  |  Branch (1558:43): [True: 3.64k, False: 67.5k]
  ------------------
 1559|  30.1k|                b->drl_idx = NEARER_DRL;
 1560|  30.1k|                if (n_mvs > 2) { // NEAR or NEARISH
  ------------------
  |  Branch (1560:21): [True: 4.81k, False: 25.3k]
  ------------------
 1561|  4.81k|                    const int drl_ctx_v2 = get_drl_context(mvstack, 1);
 1562|  4.81k|                    b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  4.81k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1563|  4.81k|                                      ts->cdf.m.drl_bit[drl_ctx_v2]);
 1564|  4.81k|                    if (b->drl_idx == NEAR_DRL && n_mvs > 3) {
  ------------------
  |  Branch (1564:25): [True: 2.51k, False: 2.29k]
  |  Branch (1564:51): [True: 1.28k, False: 1.23k]
  ------------------
 1565|  1.28k|                        const int drl_ctx_v3 = get_drl_context(mvstack, 2);
 1566|  1.28k|                        b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  1.28k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1567|  1.28k|                                          ts->cdf.m.drl_bit[drl_ctx_v3]);
 1568|  1.28k|                    }
 1569|  4.81k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  4.81k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 4.81k]
  |  |  ------------------
  |  |   35|  4.81k|        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.81k|        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|  4.81k|                }
 1573|  30.1k|            }
 1574|   128k|            assert(b->drl_idx >= NEAREST_DRL && b->drl_idx <= NEARISH_DRL);
  ------------------
  |  Branch (1574:13): [True: 128k, False: 0]
  |  Branch (1574:13): [True: 128k, False: 0]
  ------------------
 1575|       |
 1576|   128k|#define assign_comp_mv(idx) \
 1577|   128k|            switch (im[idx]) { \
 1578|   128k|            case NEARMV: \
 1579|   128k|            case NEARESTMV: \
 1580|   128k|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
 1581|   128k|                fix_mv_precision(f->frame_hdr, &b->mv[idx]); \
 1582|   128k|                break; \
 1583|   128k|            case GLOBALMV: \
 1584|   128k|                has_subpel_filter |= \
 1585|   128k|                    f->frame_hdr->gmv[b->ref[idx]].type == DAV1D_WM_TYPE_TRANSLATION; \
 1586|   128k|                b->mv[idx] = get_gmv_2d(&f->frame_hdr->gmv[b->ref[idx]], \
 1587|   128k|                                        t->bx, t->by, bw4, bh4, f->frame_hdr); \
 1588|   128k|                break; \
 1589|   128k|            case NEWMV: \
 1590|   128k|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
 1591|   128k|                const int mv_prec = f->frame_hdr->hp - f->frame_hdr->force_integer_mv; \
 1592|   128k|                read_mv_residual(ts, &b->mv[idx], mv_prec); \
 1593|   128k|                break; \
 1594|   128k|            }
 1595|   128k|            has_subpel_filter = imin(bw4, bh4) == 1 ||
  ------------------
  |  Branch (1595:33): [True: 0, False: 128k]
  ------------------
 1596|   128k|                                b->inter_mode != GLOBALMV_GLOBALMV;
  ------------------
  |  Branch (1596:33): [True: 116k, False: 11.5k]
  ------------------
 1597|   128k|            assign_comp_mv(0);
  ------------------
  |  | 1577|   128k|            switch (im[idx]) { \
  |  |  ------------------
  |  |  |  Branch (1577:21): [True: 128k, False: 0]
  |  |  ------------------
  |  | 1578|  26.5k|            case NEARMV: \
  |  |  ------------------
  |  |  |  Branch (1578:13): [True: 26.5k, False: 101k]
  |  |  ------------------
  |  | 1579|  75.4k|            case NEARESTMV: \
  |  |  ------------------
  |  |  |  Branch (1579:13): [True: 48.9k, False: 79.1k]
  |  |  ------------------
  |  | 1580|  75.4k|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
  |  | 1581|  75.4k|                fix_mv_precision(f->frame_hdr, &b->mv[idx]); \
  |  | 1582|  75.4k|                break; \
  |  | 1583|  26.5k|            case GLOBALMV: \
  |  |  ------------------
  |  |  |  Branch (1583:13): [True: 11.5k, False: 116k]
  |  |  ------------------
  |  | 1584|  11.5k|                has_subpel_filter |= \
  |  | 1585|  11.5k|                    f->frame_hdr->gmv[b->ref[idx]].type == DAV1D_WM_TYPE_TRANSLATION; \
  |  | 1586|  11.5k|                b->mv[idx] = get_gmv_2d(&f->frame_hdr->gmv[b->ref[idx]], \
  |  | 1587|  11.5k|                                        t->bx, t->by, bw4, bh4, f->frame_hdr); \
  |  | 1588|  11.5k|                break; \
  |  | 1589|  41.1k|            case NEWMV: \
  |  |  ------------------
  |  |  |  Branch (1589:13): [True: 41.1k, False: 86.9k]
  |  |  ------------------
  |  | 1590|  41.1k|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
  |  | 1591|  41.1k|                const int mv_prec = f->frame_hdr->hp - f->frame_hdr->force_integer_mv; \
  |  | 1592|  41.1k|                read_mv_residual(ts, &b->mv[idx], mv_prec); \
  |  | 1593|  41.1k|                break; \
  |  | 1594|   128k|            }
  ------------------
 1598|   128k|            assign_comp_mv(1);
  ------------------
  |  | 1577|   128k|            switch (im[idx]) { \
  |  |  ------------------
  |  |  |  Branch (1577:21): [True: 128k, False: 0]
  |  |  ------------------
  |  | 1578|  26.1k|            case NEARMV: \
  |  |  ------------------
  |  |  |  Branch (1578:13): [True: 26.1k, False: 101k]
  |  |  ------------------
  |  | 1579|  75.0k|            case NEARESTMV: \
  |  |  ------------------
  |  |  |  Branch (1579:13): [True: 48.8k, False: 79.2k]
  |  |  ------------------
  |  | 1580|  75.0k|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
  |  | 1581|  75.0k|                fix_mv_precision(f->frame_hdr, &b->mv[idx]); \
  |  | 1582|  75.0k|                break; \
  |  | 1583|  26.1k|            case GLOBALMV: \
  |  |  ------------------
  |  |  |  Branch (1583:13): [True: 11.5k, False: 116k]
  |  |  ------------------
  |  | 1584|  11.5k|                has_subpel_filter |= \
  |  | 1585|  11.5k|                    f->frame_hdr->gmv[b->ref[idx]].type == DAV1D_WM_TYPE_TRANSLATION; \
  |  | 1586|  11.5k|                b->mv[idx] = get_gmv_2d(&f->frame_hdr->gmv[b->ref[idx]], \
  |  | 1587|  11.5k|                                        t->bx, t->by, bw4, bh4, f->frame_hdr); \
  |  | 1588|  11.5k|                break; \
  |  | 1589|  41.4k|            case NEWMV: \
  |  |  ------------------
  |  |  |  Branch (1589:13): [True: 41.4k, False: 86.6k]
  |  |  ------------------
  |  | 1590|  41.4k|                b->mv[idx] = mvstack[b->drl_idx].mv.mv[idx]; \
  |  | 1591|  41.4k|                const int mv_prec = f->frame_hdr->hp - f->frame_hdr->force_integer_mv; \
  |  | 1592|  41.4k|                read_mv_residual(ts, &b->mv[idx], mv_prec); \
  |  | 1593|  41.4k|                break; \
  |  | 1594|   128k|            }
  ------------------
 1599|   128k|#undef assign_comp_mv
 1600|   128k|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   128k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 128k]
  |  |  ------------------
  |  |   35|   128k|        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|   128k|        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|   128k|            int is_segwedge = 0;
 1607|   128k|            if (f->seq_hdr->masked_compound) {
  ------------------
  |  Branch (1607:17): [True: 114k, False: 13.6k]
  ------------------
 1608|   114k|                const int mask_ctx = get_mask_comp_ctx(t->a, &t->l, by4, bx4);
 1609|       |
 1610|   114k|                is_segwedge = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   114k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1611|   114k|                                  ts->cdf.m.mask_comp[mask_ctx]);
 1612|   114k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   114k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 114k]
  |  |  ------------------
  |  |   35|   114k|        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|   114k|        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|   114k|            }
 1616|       |
 1617|   128k|            if (!is_segwedge) {
  ------------------
  |  Branch (1617:17): [True: 90.1k, False: 37.8k]
  ------------------
 1618|  90.1k|                if (f->seq_hdr->jnt_comp) {
  ------------------
  |  Branch (1618:21): [True: 55.4k, False: 34.7k]
  ------------------
 1619|  55.4k|                    const int jnt_ctx =
 1620|  55.4k|                        get_jnt_comp_ctx(f->seq_hdr->order_hint_n_bits,
 1621|  55.4k|                                         f->cur.frame_hdr->frame_offset,
 1622|  55.4k|                                         f->refp[b->ref[0]].p.frame_hdr->frame_offset,
 1623|  55.4k|                                         f->refp[b->ref[1]].p.frame_hdr->frame_offset,
 1624|  55.4k|                                         t->a, &t->l, by4, bx4);
 1625|  55.4k|                    b->comp_type = COMP_INTER_WEIGHTED_AVG +
 1626|  55.4k|                                   dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  55.4k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1627|  55.4k|                                       ts->cdf.m.jnt_comp[jnt_ctx]);
 1628|  55.4k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  55.4k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 55.4k]
  |  |  ------------------
  |  |   35|  55.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|  55.4k|        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|  55.4k|                } else {
 1635|  34.7k|                    b->comp_type = COMP_INTER_AVG;
 1636|  34.7k|                }
 1637|  90.1k|            } else {
 1638|  37.8k|                if (wedge_allowed_mask & (1 << bs)) {
  ------------------
  |  Branch (1638:21): [True: 29.7k, False: 8.12k]
  ------------------
 1639|  29.7k|                    const int ctx = dav1d_wedge_ctx_lut[bs];
 1640|  29.7k|                    b->comp_type = COMP_INTER_WEDGE -
 1641|  29.7k|                                   dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  29.7k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1642|  29.7k|                                       ts->cdf.m.wedge_comp[ctx]);
 1643|  29.7k|                    if (b->comp_type == COMP_INTER_WEDGE)
  ------------------
  |  Branch (1643:25): [True: 10.8k, False: 18.9k]
  ------------------
 1644|  10.8k|                        b->wedge_idx = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|  10.8k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1645|  29.7k|                                           ts->cdf.m.wedge_idx[ctx], 15);
 1646|  29.7k|                } else {
 1647|  8.12k|                    b->comp_type = COMP_INTER_SEG;
 1648|  8.12k|                }
 1649|  37.8k|                b->mask_sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  37.8k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
 1650|  37.8k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  37.8k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 37.8k]
  |  |  ------------------
  |  |   35|  37.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|  37.8k|        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|  37.8k|            }
 1655|   790k|        } else {
 1656|   790k|            b->comp_type = COMP_INTER_NONE;
 1657|       |
 1658|       |            // ref
 1659|   790k|            if (seg && seg->ref > 0) {
  ------------------
  |  Branch (1659:17): [True: 408k, False: 382k]
  |  Branch (1659:24): [True: 290k, False: 117k]
  ------------------
 1660|   290k|                b->ref[0] = seg->ref - 1;
 1661|   499k|            } else if (seg && (seg->globalmv || seg->skip)) {
  ------------------
  |  Branch (1661:24): [True: 117k, False: 382k]
  |  Branch (1661:32): [True: 49.1k, False: 68.3k]
  |  Branch (1661:49): [True: 19.6k, False: 48.6k]
  ------------------
 1662|  68.7k|                b->ref[0] = 0;
 1663|   431k|            } else {
 1664|   431k|                const int ctx1 = av1_get_ref_ctx(t->a, &t->l, by4, bx4,
 1665|   431k|                                                 have_top, have_left);
 1666|   431k|                if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   431k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1666:21): [True: 173k, False: 257k]
  ------------------
 1667|   431k|                                                 ts->cdf.m.ref[0][ctx1]))
 1668|   173k|                {
 1669|   173k|                    const int ctx2 = av1_get_ref_2_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  275|   173k|#define av1_get_ref_2_ctx av1_get_bwd_ref_ctx
  ------------------
 1670|   173k|                                                       have_top, have_left);
 1671|   173k|                    if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   173k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1671:25): [True: 124k, False: 49.5k]
  ------------------
 1672|   173k|                                                     ts->cdf.m.ref[1][ctx2]))
 1673|   124k|                    {
 1674|   124k|                        b->ref[0] = 6;
 1675|   124k|                    } else {
 1676|  49.5k|                        const int ctx3 = av1_get_ref_6_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  279|  49.5k|#define av1_get_ref_6_ctx av1_get_bwd_ref_1_ctx
  ------------------
 1677|  49.5k|                                                           have_top, have_left);
 1678|  49.5k|                        b->ref[0] = 4 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  49.5k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1679|  49.5k|                                            ts->cdf.m.ref[5][ctx3]);
 1680|  49.5k|                    }
 1681|   257k|                } else {
 1682|   257k|                    const int ctx2 = av1_get_ref_3_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  276|   257k|#define av1_get_ref_3_ctx av1_get_fwd_ref_ctx
  ------------------
 1683|   257k|                                                       have_top, have_left);
 1684|   257k|                    if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   257k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1684:25): [True: 51.1k, False: 206k]
  ------------------
 1685|   257k|                                                     ts->cdf.m.ref[2][ctx2]))
 1686|  51.1k|                    {
 1687|  51.1k|                        const int ctx3 = av1_get_ref_5_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  278|  51.1k|#define av1_get_ref_5_ctx av1_get_fwd_ref_2_ctx
  ------------------
 1688|  51.1k|                                                           have_top, have_left);
 1689|  51.1k|                        b->ref[0] = 2 + dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  51.1k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1690|  51.1k|                                            ts->cdf.m.ref[4][ctx3]);
 1691|   206k|                    } else {
 1692|   206k|                        const int ctx3 = av1_get_ref_4_ctx(t->a, &t->l, by4, bx4,
  ------------------
  |  |  277|   206k|#define av1_get_ref_4_ctx av1_get_fwd_ref_1_ctx
  ------------------
 1693|   206k|                                                           have_top, have_left);
 1694|   206k|                        b->ref[0] = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   206k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1695|   206k|                                        ts->cdf.m.ref[3][ctx3]);
 1696|   206k|                    }
 1697|   257k|                }
 1698|   431k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   431k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 431k]
  |  |  ------------------
  |  |   35|   431k|        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|   431k|        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|   431k|            }
 1701|   790k|            b->ref[1] = -1;
 1702|       |
 1703|   790k|            refmvs_candidate mvstack[8];
 1704|   790k|            int n_mvs, ctx;
 1705|   790k|            dav1d_refmvs_find(&t->rt, mvstack, &n_mvs, &ctx,
 1706|   790k|                              (union refmvs_refpair) { .ref = { b->ref[0] + 1, -1 }},
 1707|   790k|                              bs, intra_edge_flags, t->by, t->bx);
 1708|       |
 1709|       |            // mode parsing and mv derivation from ref_mvs
 1710|   790k|            if ((seg && (seg->skip || seg->globalmv)) ||
  ------------------
  |  Branch (1710:18): [True: 408k, False: 382k]
  |  Branch (1710:26): [True: 329k, False: 78.6k]
  |  Branch (1710:39): [True: 16.2k, False: 62.3k]
  ------------------
 1711|   444k|                dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   444k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1711:17): [True: 316k, False: 128k]
  ------------------
 1712|   444k|                                             ts->cdf.m.newmv_mode[ctx & 7]))
 1713|   662k|            {
 1714|   662k|                if ((seg && (seg->skip || seg->globalmv)) ||
  ------------------
  |  Branch (1714:22): [True: 389k, False: 272k]
  |  Branch (1714:30): [True: 329k, False: 60.3k]
  |  Branch (1714:43): [True: 16.2k, False: 44.0k]
  ------------------
 1715|   316k|                    !dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   316k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1715:21): [True: 17.6k, False: 298k]
  ------------------
 1716|   316k|                         ts->cdf.m.globalmv_mode[(ctx >> 3) & 1]))
 1717|   363k|                {
 1718|   363k|                    b->inter_mode = GLOBALMV;
 1719|   363k|                    b->mv[0] = get_gmv_2d(&f->frame_hdr->gmv[b->ref[0]],
 1720|   363k|                                          t->bx, t->by, bw4, bh4, f->frame_hdr);
 1721|   363k|                    has_subpel_filter = imin(bw4, bh4) == 1 ||
  ------------------
  |  Branch (1721:41): [True: 109k, False: 253k]
  ------------------
 1722|   253k|                        f->frame_hdr->gmv[b->ref[0]].type == DAV1D_WM_TYPE_TRANSLATION;
  ------------------
  |  Branch (1722:25): [True: 74.4k, False: 179k]
  ------------------
 1723|   363k|                } else {
 1724|   298k|                    has_subpel_filter = 1;
 1725|   298k|                    if (dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   298k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1725:25): [True: 133k, False: 165k]
  ------------------
 1726|   298k|                            ts->cdf.m.refmv_mode[(ctx >> 4) & 15]))
 1727|   133k|                    { // NEAREST, NEARER, NEAR or NEARISH
 1728|   133k|                        b->inter_mode = NEARMV;
 1729|   133k|                        b->drl_idx = NEARER_DRL;
 1730|   133k|                        if (n_mvs > 2) { // NEARER, NEAR or NEARISH
  ------------------
  |  Branch (1730:29): [True: 52.8k, False: 80.6k]
  ------------------
 1731|  52.8k|                            const int drl_ctx_v2 = get_drl_context(mvstack, 1);
 1732|  52.8k|                            b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  52.8k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1733|  52.8k|                                              ts->cdf.m.drl_bit[drl_ctx_v2]);
 1734|  52.8k|                            if (b->drl_idx == NEAR_DRL && n_mvs > 3) { // NEAR or NEARISH
  ------------------
  |  Branch (1734:33): [True: 29.2k, False: 23.6k]
  |  Branch (1734:59): [True: 15.2k, False: 13.9k]
  ------------------
 1735|  15.2k|                                const int drl_ctx_v3 =
 1736|  15.2k|                                    get_drl_context(mvstack, 2);
 1737|  15.2k|                                b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  15.2k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1738|  15.2k|                                                  ts->cdf.m.drl_bit[drl_ctx_v3]);
 1739|  15.2k|                            }
 1740|  52.8k|                        }
 1741|   165k|                    } else {
 1742|   165k|                        b->inter_mode = NEARESTMV;
 1743|   165k|                        b->drl_idx = NEAREST_DRL;
 1744|   165k|                    }
 1745|   298k|                    assert(b->drl_idx >= NEAREST_DRL && b->drl_idx <= NEARISH_DRL);
  ------------------
  |  Branch (1745:21): [True: 298k, False: 0]
  |  Branch (1745:21): [True: 298k, False: 0]
  ------------------
 1746|   298k|                    b->mv[0] = mvstack[b->drl_idx].mv.mv[0];
 1747|   298k|                    if (b->drl_idx < NEAR_DRL)
  ------------------
  |  Branch (1747:25): [True: 269k, False: 29.2k]
  ------------------
 1748|   269k|                        fix_mv_precision(f->frame_hdr, &b->mv[0]);
 1749|   298k|                }
 1750|       |
 1751|   662k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   662k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 662k]
  |  |  ------------------
  |  |   35|   662k|        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|   662k|        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|   662k|            } else {
 1756|   128k|                has_subpel_filter = 1;
 1757|   128k|                b->inter_mode = NEWMV;
 1758|   128k|                b->drl_idx = NEAREST_DRL;
 1759|   128k|                if (n_mvs > 1) { // NEARER, NEAR or NEARISH
  ------------------
  |  Branch (1759:21): [True: 95.6k, False: 32.8k]
  ------------------
 1760|  95.6k|                    const int drl_ctx_v1 = get_drl_context(mvstack, 0);
 1761|  95.6k|                    b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  95.6k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1762|  95.6k|                                      ts->cdf.m.drl_bit[drl_ctx_v1]);
 1763|  95.6k|                    if (b->drl_idx == NEARER_DRL && n_mvs > 2) { // NEAR or NEARISH
  ------------------
  |  Branch (1763:25): [True: 42.8k, False: 52.7k]
  |  Branch (1763:53): [True: 23.2k, False: 19.6k]
  ------------------
 1764|  23.2k|                        const int drl_ctx_v2 = get_drl_context(mvstack, 1);
 1765|  23.2k|                        b->drl_idx += dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  23.2k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1766|  23.2k|                                          ts->cdf.m.drl_bit[drl_ctx_v2]);
 1767|  23.2k|                    }
 1768|  95.6k|                }
 1769|   128k|                assert(b->drl_idx >= NEAREST_DRL && b->drl_idx <= NEARISH_DRL);
  ------------------
  |  Branch (1769:17): [True: 128k, False: 0]
  |  Branch (1769:17): [True: 128k, False: 0]
  ------------------
 1770|   128k|                if (n_mvs > 1) {
  ------------------
  |  Branch (1770:21): [True: 95.6k, False: 32.8k]
  ------------------
 1771|  95.6k|                    b->mv[0] = mvstack[b->drl_idx].mv.mv[0];
 1772|  95.6k|                } else {
 1773|  32.8k|                    assert(!b->drl_idx);
  ------------------
  |  Branch (1773:21): [True: 32.8k, False: 0]
  ------------------
 1774|  32.8k|                    b->mv[0] = mvstack[0].mv.mv[0];
 1775|  32.8k|                    fix_mv_precision(f->frame_hdr, &b->mv[0]);
 1776|  32.8k|                }
 1777|   128k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   128k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 128k]
  |  |  ------------------
  |  |   35|   128k|        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|   128k|        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|   128k|                const int mv_prec = f->frame_hdr->hp - f->frame_hdr->force_integer_mv;
 1781|   128k|                read_mv_residual(ts, &b->mv[0], mv_prec);
 1782|   128k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   128k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 128k]
  |  |  ------------------
  |  |   35|   128k|        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|   128k|        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|   128k|            }
 1786|       |
 1787|       |            // interintra flags
 1788|   790k|            const int ii_sz_grp = dav1d_ymode_size_context[bs];
 1789|   790k|            if (f->seq_hdr->inter_intra &&
  ------------------
  |  Branch (1789:17): [True: 625k, False: 165k]
  ------------------
 1790|   625k|                interintra_allowed_mask & (1 << bs) &&
  ------------------
  |  Branch (1790:17): [True: 286k, False: 339k]
  ------------------
 1791|   286k|                dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   286k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  |  Branch (1791:17): [True: 47.4k, False: 238k]
  ------------------
 1792|   286k|                                             ts->cdf.m.interintra[ii_sz_grp]))
 1793|  47.4k|            {
 1794|  47.4k|                b->interintra_mode = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|  47.4k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1795|  47.4k|                                         ts->cdf.m.interintra_mode[ii_sz_grp],
 1796|  47.4k|                                         N_INTER_INTRA_PRED_MODES - 1);
 1797|  47.4k|                const int wedge_ctx = dav1d_wedge_ctx_lut[bs];
 1798|  47.4k|                b->interintra_type = INTER_INTRA_BLEND +
 1799|  47.4k|                                     dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  47.4k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1800|  47.4k|                                         ts->cdf.m.interintra_wedge[wedge_ctx]);
 1801|  47.4k|                if (b->interintra_type == INTER_INTRA_WEDGE)
  ------------------
  |  Branch (1801:21): [True: 12.1k, False: 35.2k]
  ------------------
 1802|  12.1k|                    b->wedge_idx = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|  12.1k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
 1803|  47.4k|                                       ts->cdf.m.wedge_idx[wedge_ctx], 15);
 1804|   743k|            } else {
 1805|   743k|                b->interintra_type = INTER_INTRA_NONE;
 1806|   743k|            }
 1807|   790k|            if (DEBUG_BLOCK_INFO && f->seq_hdr->inter_intra &&
  ------------------
  |  |   34|   790k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 790k]
  |  |  ------------------
  |  |   35|   790k|        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|   790k|        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|   790k|            if (f->frame_hdr->switchable_motion_mode &&
  ------------------
  |  Branch (1816:17): [True: 721k, False: 68.7k]
  ------------------
 1817|   721k|                b->interintra_type == INTER_INTRA_NONE && imin(bw4, bh4) >= 2 &&
  ------------------
  |  Branch (1817:17): [True: 677k, False: 44.7k]
  |  Branch (1817:59): [True: 424k, False: 252k]
  ------------------
 1818|       |                // is not warped global motion
 1819|   424k|                !(!f->frame_hdr->force_integer_mv && b->inter_mode == GLOBALMV &&
  ------------------
  |  Branch (1819:19): [True: 329k, False: 94.3k]
  |  Branch (1819:54): [True: 173k, False: 156k]
  ------------------
 1820|   173k|                  f->frame_hdr->gmv[b->ref[0]].type > DAV1D_WM_TYPE_TRANSLATION) &&
  ------------------
  |  Branch (1820:19): [True: 34.2k, False: 139k]
  ------------------
 1821|       |                // has overlappable neighbours
 1822|   390k|                ((have_left && findoddzero(&t->l.intra[by4 + 1], h4 >> 1)) ||
  ------------------
  |  Branch (1822:19): [True: 354k, False: 36.0k]
  |  Branch (1822:32): [True: 342k, False: 11.3k]
  ------------------
 1823|  47.4k|                 (have_top && findoddzero(&t->a->intra[bx4 + 1], w4 >> 1))))
  ------------------
  |  Branch (1823:19): [True: 38.9k, False: 8.52k]
  |  Branch (1823:31): [True: 35.6k, False: 3.23k]
  ------------------
 1824|   378k|            {
 1825|       |                // reaching here means the block allows obmc - check warp by
 1826|       |                // finding matching-ref blocks in top/left edges
 1827|   378k|                uint64_t mask[2] = { 0, 0 };
 1828|   378k|                find_matching_ref(t, intra_edge_flags, bw4, bh4, w4, h4,
 1829|   378k|                                  have_left, have_top, b->ref[0], mask);
 1830|   378k|                const int allow_warp = !f->svc[b->ref[0]][0].scale &&
  ------------------
  |  Branch (1830:40): [True: 274k, False: 103k]
  ------------------
 1831|   274k|                    !f->frame_hdr->force_integer_mv &&
  ------------------
  |  Branch (1831:21): [True: 266k, False: 7.47k]
  ------------------
 1832|   266k|                    f->frame_hdr->warp_motion && (mask[0] | mask[1]);
  ------------------
  |  Branch (1832:21): [True: 200k, False: 66.3k]
  |  Branch (1832:50): [True: 189k, False: 11.2k]
  ------------------
 1833|       |
 1834|   378k|                b->motion_mode = allow_warp ?
  ------------------
  |  Branch (1834:34): [True: 189k, False: 189k]
  ------------------
 1835|   189k|                    dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|   189k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1836|   189k|                        ts->cdf.m.motion_mode[bs], 2) :
 1837|   378k|                    dav1d_msac_decode_bool_adapt(&ts->msac, ts->cdf.m.obmc[bs]);
  ------------------
  |  |   52|   189k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 1838|   378k|                if (b->motion_mode == MM_WARP) {
  ------------------
  |  Branch (1838:21): [True: 63.8k, False: 314k]
  ------------------
 1839|  63.8k|                    has_subpel_filter = 0;
 1840|  63.8k|                    derive_warpmv(t, bw4, bh4, mask, b->mv[0], &t->warpmv);
 1841|  63.8k|#define signabs(v) v < 0 ? '-' : ' ', abs(v)
 1842|  63.8k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  63.8k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 63.8k]
  |  |  ------------------
  |  |   35|  63.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|  63.8k|        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|  63.8k|#undef signabs
 1858|  63.8k|                    if (t->frame_thread.pass) {
  ------------------
  |  Branch (1858:25): [True: 0, False: 63.8k]
  ------------------
 1859|      0|                        if (t->warpmv.type == DAV1D_WM_TYPE_AFFINE) {
  ------------------
  |  Branch (1859:29): [True: 0, False: 0]
  ------------------
 1860|      0|                            b->matrix[0] = t->warpmv.matrix[2] - 0x10000;
 1861|      0|                            b->matrix[1] = t->warpmv.matrix[3];
 1862|      0|                            b->matrix[2] = t->warpmv.matrix[4];
 1863|      0|                            b->matrix[3] = t->warpmv.matrix[5] - 0x10000;
 1864|      0|                        } else {
 1865|      0|                            b->matrix[0] = INT16_MIN;
 1866|      0|                        }
 1867|      0|                    }
 1868|  63.8k|                }
 1869|       |
 1870|   378k|                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   378k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 378k]
  |  |  ------------------
  |  |   35|   378k|        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|   378k|        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|   412k|            } else {
 1875|   412k|                b->motion_mode = MM_TRANSLATION;
 1876|   412k|            }
 1877|   790k|        }
 1878|       |
 1879|       |        // subpel filter
 1880|   927k|        enum Dav1dFilterMode filter[2];
 1881|   927k|        if (f->frame_hdr->subpel_filter_mode == DAV1D_FILTER_SWITCHABLE) {
  ------------------
  |  Branch (1881:13): [True: 486k, False: 440k]
  ------------------
 1882|   486k|            if (has_subpel_filter) {
  ------------------
  |  Branch (1882:17): [True: 309k, False: 176k]
  ------------------
 1883|   309k|                const int comp = b->comp_type != COMP_INTER_NONE;
 1884|   309k|                const int ctx1 = get_filter_ctx(t->a, &t->l, comp, 0, b->ref[0],
 1885|   309k|                                                by4, bx4);
 1886|   309k|                filter[0] = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|   309k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1887|   309k|                               ts->cdf.m.filter[0][ctx1],
 1888|   309k|                               DAV1D_N_SWITCHABLE_FILTERS - 1);
 1889|   309k|                if (f->seq_hdr->dual_filter) {
  ------------------
  |  Branch (1889:21): [True: 277k, False: 31.5k]
  ------------------
 1890|   277k|                    const int ctx2 = get_filter_ctx(t->a, &t->l, comp, 1,
 1891|   277k|                                                    b->ref[0], by4, bx4);
 1892|   277k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   277k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 277k]
  |  |  ------------------
  |  |   35|   277k|        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|   277k|        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|   277k|                    filter[1] = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|   277k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 1896|   277k|                                    ts->cdf.m.filter[1][ctx2],
 1897|   277k|                                    DAV1D_N_SWITCHABLE_FILTERS - 1);
 1898|   277k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   277k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 277k]
  |  |  ------------------
  |  |   35|   277k|        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|   277k|        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|   277k|                } else {
 1902|  31.5k|                    filter[1] = filter[0];
 1903|  31.5k|                    if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  31.5k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 31.5k]
  |  |  ------------------
  |  |   35|  31.5k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|  31.5k|        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|  31.5k|                }
 1907|   309k|            } else {
 1908|   176k|                filter[0] = filter[1] = DAV1D_FILTER_8TAP_REGULAR;
 1909|   176k|            }
 1910|   486k|        } else {
 1911|   440k|            filter[0] = filter[1] = f->frame_hdr->subpel_filter_mode;
 1912|   440k|        }
 1913|   927k|        b->filter2d = dav1d_filter_2d[filter[1]][filter[0]];
 1914|       |
 1915|   927k|        read_vartx_tree(t, b, bs, bx4, by4);
 1916|       |
 1917|       |        // reconstruction
 1918|   927k|        if (t->frame_thread.pass == 1) {
  ------------------
  |  Branch (1918:13): [True: 0, False: 927k]
  ------------------
 1919|      0|            f->bd_fn.read_coef_blocks(t, bs, b);
 1920|   927k|        } else {
 1921|   927k|            if (f->bd_fn.recon_b_inter(t, bs, b)) return -1;
  ------------------
  |  Branch (1921:17): [True: 0, False: 927k]
  ------------------
 1922|   927k|        }
 1923|       |
 1924|   927k|        if (f->frame_hdr->loopfilter.level_y[0] ||
  ------------------
  |  Branch (1924:13): [True: 566k, False: 360k]
  ------------------
 1925|   360k|            f->frame_hdr->loopfilter.level_y[1])
  ------------------
  |  Branch (1925:13): [True: 67.9k, False: 292k]
  ------------------
 1926|   634k|        {
 1927|   634k|            const int is_globalmv =
 1928|   634k|                b->inter_mode == (is_comp ? GLOBALMV_GLOBALMV : GLOBALMV);
  ------------------
  |  Branch (1928:35): [True: 67.8k, False: 566k]
  ------------------
 1929|   634k|            const uint8_t (*const lf_lvls)[8][2] = (const uint8_t (*)[8][2])
 1930|   634k|                &ts->lflvl[b->seg_id][0][b->ref[0] + 1][!is_globalmv];
 1931|   634k|            const uint16_t tx_split[2] = { b->tx_split0, b->tx_split1 };
 1932|   634k|            enum RectTxfmSize ytx = b->max_ytx, uvtx = b->uvtx;
 1933|   634k|            if (f->frame_hdr->segmentation.lossless[b->seg_id]) {
  ------------------
  |  Branch (1933:17): [True: 2.29k, False: 632k]
  ------------------
 1934|  2.29k|                ytx  = (enum RectTxfmSize) TX_4X4;
 1935|  2.29k|                uvtx = (enum RectTxfmSize) TX_4X4;
 1936|  2.29k|            }
 1937|   634k|            dav1d_create_lf_mask_inter(t, f->lf.level, f->b4_stride, lf_lvls, f->w4,
 1938|   634k|                                       f->h4, b->skip, bs, ytx, tx_split, uvtx,
 1939|   634k|                                       f->cur.p.layout, &t->a->tx_lpf_y[bx4],
 1940|   634k|                                       &t->l.tx_lpf_y[by4],
 1941|   634k|                                       has_chroma ? &t->a->tx_lpf_uv[cbx4] : NULL,
  ------------------
  |  Branch (1941:40): [True: 164k, False: 470k]
  ------------------
 1942|   634k|                                       has_chroma ? &t->l.tx_lpf_uv[cby4] : NULL);
  ------------------
  |  Branch (1942:40): [True: 164k, False: 470k]
  ------------------
 1943|   634k|        }
 1944|       |
 1945|       |        // context updates
 1946|   927k|        if (is_comp)
  ------------------
  |  Branch (1946:13): [True: 136k, False: 790k]
  ------------------
 1947|   136k|            splat_tworef_mv(f->c, t, bs, b, bw4, bh4);
 1948|   790k|        else
 1949|   790k|            splat_oneref_mv(f->c, t, bs, b, bw4, bh4);
 1950|   927k|        BlockContext *edge = t->a;
 1951|  2.78M|        for (int i = 0, off = bx4; i < 2; i++, off = by4, edge = &t->l) {
  ------------------
  |  Branch (1951:36): [True: 1.85M, False: 927k]
  ------------------
 1952|  1.85M|#define set_ctx(rep_macro) \
 1953|  1.85M|            rep_macro(edge->seg_pred, off, seg_pred); \
 1954|  1.85M|            rep_macro(edge->skip_mode, off, b->skip_mode); \
 1955|  1.85M|            rep_macro(edge->intra, off, 0); \
 1956|  1.85M|            rep_macro(edge->skip, off, b->skip); \
 1957|  1.85M|            rep_macro(edge->pal_sz, off, 0); \
 1958|       |            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
 1959|  1.85M|            rep_macro(t->pal_sz_uv[i], off, 0); \
 1960|  1.85M|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
 1961|  1.85M|            rep_macro(edge->comp_type, off, b->comp_type); \
 1962|  1.85M|            rep_macro(edge->filter[0], off, filter[0]); \
 1963|  1.85M|            rep_macro(edge->filter[1], off, filter[1]); \
 1964|  1.85M|            rep_macro(edge->mode, off, b->inter_mode); \
 1965|  1.85M|            rep_macro(edge->ref[0], off, b->ref[0]); \
 1966|  1.85M|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
 1967|  1.85M|            case_set(b_dim[2 + i]);
  ------------------
  |  |   70|  1.85M|    switch (var) { \
  |  |   71|   373k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 1953|   373k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   373k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   373k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1954|   373k|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   373k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   373k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1955|   373k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   373k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   373k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1956|   373k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   373k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   373k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1957|   373k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   373k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   373k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1958|   373k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1959|   373k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   373k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   373k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1960|   373k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   373k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   373k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1961|   373k|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   373k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   373k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1962|   373k|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   373k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   373k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1963|   373k|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   373k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   373k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1964|   373k|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   373k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   373k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1965|   373k|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   373k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   373k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1966|   373k|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   373k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   373k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 373k, False: 1.48M]
  |  |  ------------------
  |  |   72|   607k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 1953|   607k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   607k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   607k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1954|   607k|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   607k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   607k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1955|   607k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   607k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   607k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1956|   607k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   607k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   607k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1957|   607k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   607k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   607k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1958|   607k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1959|   607k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   607k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   607k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1960|   607k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   607k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   607k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1961|   607k|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   607k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   607k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1962|   607k|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   607k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   607k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1963|   607k|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   607k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   607k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1964|   607k|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   607k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   607k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1965|   607k|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   607k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   607k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1966|   607k|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   607k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   607k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 607k, False: 1.24M]
  |  |  ------------------
  |  |   73|   447k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 1953|   447k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   447k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   447k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1954|   447k|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   447k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   447k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1955|   447k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   447k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   447k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1956|   447k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   447k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   447k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1957|   447k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   447k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   447k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1958|   447k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1959|   447k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   447k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   447k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1960|   447k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   447k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   447k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1961|   447k|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   447k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   447k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1962|   447k|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   447k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   447k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1963|   447k|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   447k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   447k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1964|   447k|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   447k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   447k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1965|   447k|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   447k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   447k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1966|   447k|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   447k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   447k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 447k, False: 1.40M]
  |  |  ------------------
  |  |   74|   186k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 1953|   186k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   186k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   186k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1954|   186k|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   186k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   186k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1955|   186k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   186k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   186k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1956|   186k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   186k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   186k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1957|   186k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   186k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   186k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1958|   186k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1959|   186k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   186k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   186k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1960|   186k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   186k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   186k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1961|   186k|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   186k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   186k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1962|   186k|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   186k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   186k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1963|   186k|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   186k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   186k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1964|   186k|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   186k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   186k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1965|   186k|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   186k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   186k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1966|   186k|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   186k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   186k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 186k, False: 1.66M]
  |  |  ------------------
  |  |   75|   175k|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 1953|   175k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   175k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   175k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   175k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   175k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 175k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1954|   175k|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   175k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   175k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   175k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   175k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 175k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1955|   175k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   175k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   175k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   175k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   175k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 175k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1956|   175k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   175k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   175k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   175k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   175k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 175k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1957|   175k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   175k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   175k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   175k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   175k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 175k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1958|   175k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1959|   175k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   175k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   175k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   175k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   175k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 175k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1960|   175k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   175k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   175k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   175k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   175k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 175k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1961|   175k|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   175k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   175k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   175k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   175k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 175k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1962|   175k|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   175k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   175k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   175k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   175k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 175k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1963|   175k|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   175k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   175k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   175k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   175k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 175k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1964|   175k|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   175k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   175k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   175k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   175k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 175k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1965|   175k|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   175k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   175k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   175k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   175k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 175k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1966|   175k|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|   175k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   175k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   175k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   175k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 175k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 175k, False: 1.67M]
  |  |  ------------------
  |  |   76|  64.7k|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  | 1953|  64.7k|            rep_macro(edge->seg_pred, off, seg_pred); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  64.7k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  64.7k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  64.7k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  64.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 64.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1954|  64.7k|            rep_macro(edge->skip_mode, off, b->skip_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  64.7k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  64.7k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  64.7k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  64.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 64.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1955|  64.7k|            rep_macro(edge->intra, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  64.7k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  64.7k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  64.7k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  64.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 64.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1956|  64.7k|            rep_macro(edge->skip, off, b->skip); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  64.7k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  64.7k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  64.7k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  64.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 64.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1957|  64.7k|            rep_macro(edge->pal_sz, off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  64.7k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  64.7k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  64.7k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  64.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 64.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1958|  64.7k|            /* see aomedia bug 2183 for why this is outside if (has_chroma) */ \
  |  |  |  | 1959|  64.7k|            rep_macro(t->pal_sz_uv[i], off, 0); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  64.7k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  64.7k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  64.7k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  64.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 64.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1960|  64.7k|            rep_macro(edge->tx_intra, off, b_dim[2 + i]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  64.7k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  64.7k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  64.7k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  64.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 64.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1961|  64.7k|            rep_macro(edge->comp_type, off, b->comp_type); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  64.7k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  64.7k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  64.7k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  64.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 64.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1962|  64.7k|            rep_macro(edge->filter[0], off, filter[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  64.7k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  64.7k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  64.7k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  64.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 64.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1963|  64.7k|            rep_macro(edge->filter[1], off, filter[1]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  64.7k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  64.7k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  64.7k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  64.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 64.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1964|  64.7k|            rep_macro(edge->mode, off, b->inter_mode); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  64.7k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  64.7k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  64.7k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  64.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 64.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1965|  64.7k|            rep_macro(edge->ref[0], off, b->ref[0]); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  64.7k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  64.7k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  64.7k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  64.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 64.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1966|  64.7k|            rep_macro(edge->ref[1], off, ((uint8_t) b->ref[1]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  64.7k|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  64.7k|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  64.7k|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  64.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 64.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 64.7k, False: 1.78M]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 1.85M]
  |  |  ------------------
  |  |   78|  1.85M|    }
  ------------------
  |  Branch (1967:13): [Folded, False: 0]
  ------------------
 1968|  1.85M|#undef set_ctx
 1969|  1.85M|        }
 1970|   927k|        if (has_chroma) {
  ------------------
  |  Branch (1970:13): [True: 406k, False: 520k]
  ------------------
 1971|   406k|            dav1d_memset_pow2[ulog2(cbw4)](&t->a->uvmode[cbx4], DC_PRED);
 1972|   406k|            dav1d_memset_pow2[ulog2(cbh4)](&t->l.uvmode[cby4], DC_PRED);
 1973|   406k|        }
 1974|   927k|    }
 1975|       |
 1976|       |    // update contexts
 1977|  4.18M|    if (f->frame_hdr->segmentation.enabled &&
  ------------------
  |  Branch (1977:9): [True: 1.21M, False: 2.96M]
  ------------------
 1978|  1.21M|        f->frame_hdr->segmentation.update_map)
  ------------------
  |  Branch (1978:9): [True: 937k, False: 281k]
  ------------------
 1979|   937k|    {
 1980|   937k|        uint8_t *seg_ptr = &f->cur_segmap[t->by * f->b4_stride + t->bx];
 1981|   937k|#define set_ctx(rep_macro) \
 1982|   937k|        for (int y = 0; y < bh4; y++) { \
 1983|   937k|            rep_macro(seg_ptr, 0, b->seg_id); \
 1984|   937k|            seg_ptr += f->b4_stride; \
 1985|   937k|        }
 1986|   937k|        case_set(b_dim[2]);
  ------------------
  |  |   70|   937k|    switch (var) { \
  |  |   71|   271k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  | 1982|   632k|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:25): [True: 360k, False: 271k]
  |  |  |  |  ------------------
  |  |  |  | 1983|   360k|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|   360k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   360k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1984|   360k|            seg_ptr += f->b4_stride; \
  |  |  |  | 1985|   360k|        }
  |  |  ------------------
  |  |  |  Branch (71:5): [True: 271k, False: 665k]
  |  |  ------------------
  |  |   72|   154k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  | 1982|   602k|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:25): [True: 447k, False: 154k]
  |  |  |  |  ------------------
  |  |  |  | 1983|   447k|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   72|   447k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   447k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1984|   447k|            seg_ptr += f->b4_stride; \
  |  |  |  | 1985|   447k|        }
  |  |  ------------------
  |  |  |  Branch (72:5): [True: 154k, False: 782k]
  |  |  ------------------
  |  |   73|   206k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  | 1982|   994k|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:25): [True: 788k, False: 206k]
  |  |  |  |  ------------------
  |  |  |  | 1983|   788k|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   73|   788k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   788k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1984|   788k|            seg_ptr += f->b4_stride; \
  |  |  |  | 1985|   788k|        }
  |  |  ------------------
  |  |  |  Branch (73:5): [True: 206k, False: 731k]
  |  |  ------------------
  |  |   74|  84.9k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  | 1982|   570k|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:25): [True: 485k, False: 84.9k]
  |  |  |  |  ------------------
  |  |  |  | 1983|   485k|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   74|   485k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   485k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1984|   485k|            seg_ptr += f->b4_stride; \
  |  |  |  | 1985|   485k|        }
  |  |  ------------------
  |  |  |  Branch (74:5): [True: 84.9k, False: 852k]
  |  |  ------------------
  |  |   75|   133k|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  | 1982|  2.17M|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:25): [True: 2.03M, False: 133k]
  |  |  |  |  ------------------
  |  |  |  | 1983|  2.03M|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   75|  2.03M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.03M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.03M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.03M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.03M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1984|  2.03M|            seg_ptr += f->b4_stride; \
  |  |  |  | 1985|  2.03M|        }
  |  |  ------------------
  |  |  |  Branch (75:5): [True: 133k, False: 804k]
  |  |  ------------------
  |  |   76|  86.5k|    case 5: set_ctx(set_ctx32); break; \
  |  |  ------------------
  |  |  |  | 1982|  2.82M|        for (int y = 0; y < bh4; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1982:25): [True: 2.74M, False: 86.5k]
  |  |  |  |  ------------------
  |  |  |  | 1983|  2.74M|            rep_macro(seg_ptr, 0, b->seg_id); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   76|  2.74M|    case 5: set_ctx(set_ctx32); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   66|  2.74M|#define set_ctx32(var, off, val) do { \
  |  |  |  |  |  |  |  |   67|  2.74M|        memset(&(var)[off], val, 32); \
  |  |  |  |  |  |  |  |   68|  2.74M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (68:14): [Folded, False: 2.74M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 1984|  2.74M|            seg_ptr += f->b4_stride; \
  |  |  |  | 1985|  2.74M|        }
  |  |  ------------------
  |  |  |  Branch (76:5): [True: 86.5k, False: 850k]
  |  |  ------------------
  |  |   77|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (77:5): [True: 0, False: 937k]
  |  |  ------------------
  |  |   78|   937k|    }
  ------------------
  |  Branch (1986:9): [Folded, False: 0]
  ------------------
 1987|   937k|#undef set_ctx
 1988|   937k|    }
 1989|  4.18M|    if (!b->skip) {
  ------------------
  |  Branch (1989:9): [True: 2.24M, False: 1.94M]
  ------------------
 1990|  2.24M|        uint16_t (*noskip_mask)[2] = &t->lf_mask->noskip_mask[by4 >> 1];
 1991|  2.24M|        const unsigned mask = (~0U >> (32 - bw4)) << (bx4 & 15);
 1992|  2.24M|        const int bx_idx = (bx4 & 16) >> 4;
 1993|  6.98M|        for (int y = 0; y < bh4; y += 2, noskip_mask++) {
  ------------------
  |  Branch (1993:25): [True: 4.73M, False: 2.24M]
  ------------------
 1994|  4.73M|            (*noskip_mask)[bx_idx] |= mask;
 1995|  4.73M|            if (bw4 == 32) // this should be mask >> 16, but it's 0xffffffff anyway
  ------------------
  |  Branch (1995:17): [True: 449k, False: 4.29M]
  ------------------
 1996|   449k|                (*noskip_mask)[1] |= mask;
 1997|  4.73M|        }
 1998|  2.24M|    }
 1999|       |
 2000|  4.18M|    if (t->frame_thread.pass == 1 && !b->intra && IS_INTER_OR_SWITCH(f->frame_hdr)) {
  ------------------
  |  |   36|      0|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2000:9): [True: 0, False: 4.18M]
  |  Branch (2000:38): [True: 0, False: 0]
  ------------------
 2001|      0|        const int sby = (t->by - ts->tiling.row_start) >> f->sb_shift;
 2002|      0|        int (*const lowest_px)[2] = ts->lowest_pixel[sby];
 2003|       |
 2004|       |        // keep track of motion vectors for each reference
 2005|      0|        if (b->comp_type == COMP_INTER_NONE) {
  ------------------
  |  Branch (2005:13): [True: 0, False: 0]
  ------------------
 2006|       |            // y
 2007|      0|            if (imin(bw4, bh4) > 1 &&
  ------------------
  |  Branch (2007:17): [True: 0, False: 0]
  ------------------
 2008|      0|                ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (2008:19): [True: 0, False: 0]
  |  Branch (2008:48): [True: 0, False: 0]
  ------------------
 2009|      0|                 (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (2009:19): [True: 0, False: 0]
  |  Branch (2009:48): [True: 0, False: 0]
  ------------------
 2010|      0|            {
 2011|      0|                affine_lowest_px_luma(t, &lowest_px[b->ref[0]][0], b_dim,
 2012|      0|                                      b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (2012:39): [True: 0, False: 0]
  ------------------
 2013|      0|                                      &f->frame_hdr->gmv[b->ref[0]]);
 2014|      0|            } else {
 2015|      0|                mc_lowest_px(&lowest_px[b->ref[0]][0], t->by, bh4, b->mv[0].y,
 2016|      0|                             0, &f->svc[b->ref[0]][1]);
 2017|      0|                if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (2017:21): [True: 0, False: 0]
  ------------------
 2018|      0|                    obmc_lowest_px(t, lowest_px, 0, b_dim, bx4, by4, w4, h4);
 2019|      0|                }
 2020|      0|            }
 2021|       |
 2022|       |            // uv
 2023|      0|            if (has_chroma) {
  ------------------
  |  Branch (2023:17): [True: 0, False: 0]
  ------------------
 2024|       |                // sub8x8 derivation
 2025|      0|                int is_sub8x8 = bw4 == ss_hor || bh4 == ss_ver;
  ------------------
  |  Branch (2025:33): [True: 0, False: 0]
  |  Branch (2025:50): [True: 0, False: 0]
  ------------------
 2026|      0|                refmvs_block *const *r;
 2027|      0|                if (is_sub8x8) {
  ------------------
  |  Branch (2027:21): [True: 0, False: 0]
  ------------------
 2028|      0|                    assert(ss_hor == 1);
  ------------------
  |  Branch (2028:21): [True: 0, False: 0]
  ------------------
 2029|      0|                    r = &t->rt.r[(t->by & 31) + 5];
 2030|      0|                    if (bw4 == 1) is_sub8x8 &= r[0][t->bx - 1].ref.ref[0] > 0;
  ------------------
  |  Branch (2030:25): [True: 0, False: 0]
  ------------------
 2031|      0|                    if (bh4 == ss_ver) is_sub8x8 &= r[-1][t->bx].ref.ref[0] > 0;
  ------------------
  |  Branch (2031:25): [True: 0, False: 0]
  ------------------
 2032|      0|                    if (bw4 == 1 && bh4 == ss_ver)
  ------------------
  |  Branch (2032:25): [True: 0, False: 0]
  |  Branch (2032:37): [True: 0, False: 0]
  ------------------
 2033|      0|                        is_sub8x8 &= r[-1][t->bx - 1].ref.ref[0] > 0;
 2034|      0|                }
 2035|       |
 2036|       |                // chroma prediction
 2037|      0|                if (is_sub8x8) {
  ------------------
  |  Branch (2037:21): [True: 0, False: 0]
  ------------------
 2038|      0|                    assert(ss_hor == 1);
  ------------------
  |  Branch (2038:21): [True: 0, False: 0]
  ------------------
 2039|      0|                    if (bw4 == 1 && bh4 == ss_ver) {
  ------------------
  |  Branch (2039:25): [True: 0, False: 0]
  |  Branch (2039:37): [True: 0, False: 0]
  ------------------
 2040|      0|                        const refmvs_block *const rr = &r[-1][t->bx - 1];
 2041|      0|                        mc_lowest_px(&lowest_px[rr->ref.ref[0] - 1][1],
 2042|      0|                                     t->by - 1, bh4, rr->mv.mv[0].y, ss_ver,
 2043|      0|                                     &f->svc[rr->ref.ref[0] - 1][1]);
 2044|      0|                    }
 2045|      0|                    if (bw4 == 1) {
  ------------------
  |  Branch (2045:25): [True: 0, False: 0]
  ------------------
 2046|      0|                        const refmvs_block *const rr = &r[0][t->bx - 1];
 2047|      0|                        mc_lowest_px(&lowest_px[rr->ref.ref[0] - 1][1],
 2048|      0|                                     t->by, bh4, rr->mv.mv[0].y, ss_ver,
 2049|      0|                                     &f->svc[rr->ref.ref[0] - 1][1]);
 2050|      0|                    }
 2051|      0|                    if (bh4 == ss_ver) {
  ------------------
  |  Branch (2051:25): [True: 0, False: 0]
  ------------------
 2052|      0|                        const refmvs_block *const rr = &r[-1][t->bx];
 2053|      0|                        mc_lowest_px(&lowest_px[rr->ref.ref[0] - 1][1],
 2054|      0|                                     t->by - 1, bh4, rr->mv.mv[0].y, ss_ver,
 2055|      0|                                     &f->svc[rr->ref.ref[0] - 1][1]);
 2056|      0|                    }
 2057|      0|                    mc_lowest_px(&lowest_px[b->ref[0]][1], t->by, bh4,
 2058|      0|                                 b->mv[0].y, ss_ver, &f->svc[b->ref[0]][1]);
 2059|      0|                } else {
 2060|      0|                    if (imin(cbw4, cbh4) > 1 &&
  ------------------
  |  Branch (2060:25): [True: 0, False: 0]
  ------------------
 2061|      0|                        ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (2061:27): [True: 0, False: 0]
  |  Branch (2061:56): [True: 0, False: 0]
  ------------------
 2062|      0|                         (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (2062:27): [True: 0, False: 0]
  |  Branch (2062:56): [True: 0, False: 0]
  ------------------
 2063|      0|                    {
 2064|      0|                        affine_lowest_px_chroma(t, &lowest_px[b->ref[0]][1], b_dim,
 2065|      0|                                                b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (2065:49): [True: 0, False: 0]
  ------------------
 2066|      0|                                                &f->frame_hdr->gmv[b->ref[0]]);
 2067|      0|                    } else {
 2068|      0|                        mc_lowest_px(&lowest_px[b->ref[0]][1],
 2069|      0|                                     t->by & ~ss_ver, bh4 << (bh4 == ss_ver),
 2070|      0|                                     b->mv[0].y, ss_ver, &f->svc[b->ref[0]][1]);
 2071|      0|                        if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (2071:29): [True: 0, False: 0]
  ------------------
 2072|      0|                            obmc_lowest_px(t, lowest_px, 1, b_dim, bx4, by4, w4, h4);
 2073|      0|                        }
 2074|      0|                    }
 2075|      0|                }
 2076|      0|            }
 2077|      0|        } else {
 2078|       |            // y
 2079|      0|            for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (2079:29): [True: 0, False: 0]
  ------------------
 2080|      0|                if (b->inter_mode == GLOBALMV_GLOBALMV && f->gmv_warp_allowed[b->ref[i]]) {
  ------------------
  |  Branch (2080:21): [True: 0, False: 0]
  |  Branch (2080:59): [True: 0, False: 0]
  ------------------
 2081|      0|                    affine_lowest_px_luma(t, &lowest_px[b->ref[i]][0], b_dim,
 2082|      0|                                          &f->frame_hdr->gmv[b->ref[i]]);
 2083|      0|                } else {
 2084|      0|                    mc_lowest_px(&lowest_px[b->ref[i]][0], t->by, bh4,
 2085|      0|                                 b->mv[i].y, 0, &f->svc[b->ref[i]][1]);
 2086|      0|                }
 2087|      0|            }
 2088|       |
 2089|       |            // uv
 2090|      0|            if (has_chroma) for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (2090:17): [True: 0, False: 0]
  |  Branch (2090:45): [True: 0, False: 0]
  ------------------
 2091|      0|                if (b->inter_mode == GLOBALMV_GLOBALMV &&
  ------------------
  |  Branch (2091:21): [True: 0, False: 0]
  ------------------
 2092|      0|                    imin(cbw4, cbh4) > 1 && f->gmv_warp_allowed[b->ref[i]])
  ------------------
  |  Branch (2092:21): [True: 0, False: 0]
  |  Branch (2092:45): [True: 0, False: 0]
  ------------------
 2093|      0|                {
 2094|      0|                    affine_lowest_px_chroma(t, &lowest_px[b->ref[i]][1], b_dim,
 2095|      0|                                            &f->frame_hdr->gmv[b->ref[i]]);
 2096|      0|                } else {
 2097|      0|                    mc_lowest_px(&lowest_px[b->ref[i]][1], t->by, bh4,
 2098|      0|                                 b->mv[i].y, ss_ver, &f->svc[b->ref[i]][1]);
 2099|      0|                }
 2100|      0|            }
 2101|      0|        }
 2102|      0|    }
 2103|       |
 2104|  4.18M|    return 0;
 2105|  4.18M|}
decode.c:get_prev_frame_segid:
  536|   210k|{
  537|   210k|    assert(f->frame_hdr->primary_ref_frame != DAV1D_PRIMARY_REF_NONE);
  ------------------
  |  Branch (537:5): [True: 210k, False: 0]
  ------------------
  538|       |
  539|   210k|    unsigned seg_id = 8;
  540|   210k|    ref_seg_map += by * stride + bx;
  541|   219k|    do {
  542|  1.34M|        for (int x = 0; x < w4; x++)
  ------------------
  |  Branch (542:25): [True: 1.12M, False: 219k]
  ------------------
  543|  1.12M|            seg_id = imin(seg_id, ref_seg_map[x]);
  544|   219k|        ref_seg_map += stride;
  545|   219k|    } while (--h4 > 0 && seg_id);
  ------------------
  |  Branch (545:14): [True: 172k, False: 47.3k]
  |  Branch (545:26): [True: 9.63k, False: 162k]
  ------------------
  546|   210k|    assert(seg_id < 8);
  ------------------
  |  Branch (546:5): [True: 210k, False: 0]
  ------------------
  547|       |
  548|   210k|    return seg_id;
  549|   210k|}
decode.c:neg_deinterleave:
  168|   631k|static int neg_deinterleave(int diff, int ref, int max) {
  169|   631k|    if (!ref) return diff;
  ------------------
  |  Branch (169:9): [True: 334k, False: 297k]
  ------------------
  170|   297k|    if (ref >= (max - 1)) return max - diff - 1;
  ------------------
  |  Branch (170:9): [True: 63.2k, False: 233k]
  ------------------
  171|   233k|    if (2 * ref < max) {
  ------------------
  |  Branch (171:9): [True: 151k, False: 82.4k]
  ------------------
  172|   151k|        if (diff <= 2 * ref) {
  ------------------
  |  Branch (172:13): [True: 121k, False: 29.7k]
  ------------------
  173|   121k|            if (diff & 1)
  ------------------
  |  Branch (173:17): [True: 14.2k, False: 107k]
  ------------------
  174|  14.2k|                return ref + ((diff + 1) >> 1);
  175|   107k|            else
  176|   107k|                return ref - (diff >> 1);
  177|   121k|        }
  178|  29.7k|        return diff;
  179|   151k|    } else {
  180|  82.4k|        if (diff <= 2 * (max - ref - 1)) {
  ------------------
  |  Branch (180:13): [True: 69.2k, False: 13.2k]
  ------------------
  181|  69.2k|            if (diff & 1)
  ------------------
  |  Branch (181:17): [True: 11.2k, False: 58.0k]
  ------------------
  182|  11.2k|                return ref + ((diff + 1) >> 1);
  183|  58.0k|            else
  184|  58.0k|                return ref - (diff >> 1);
  185|  69.2k|        }
  186|  13.2k|        return max - (diff + 1);
  187|  82.4k|    }
  188|   233k|}
decode.c:read_pal_indices:
  381|  89.8k|{
  382|  89.8k|    Dav1dTileState *const ts = t->ts;
  383|  89.8k|    const ptrdiff_t stride = bw4 * 4;
  384|  89.8k|    assert(pal_idx);
  ------------------
  |  Branch (384:5): [True: 89.8k, False: 0]
  ------------------
  385|  89.8k|    uint8_t *const pal_tmp = t->scratch.pal_idx_uv;
  386|  89.8k|    pal_tmp[0] = dav1d_msac_decode_uniform(&ts->msac, pal_sz);
  387|  89.8k|    uint16_t (*const color_map_cdf)[8] =
  388|  89.8k|        ts->cdf.m.color_map[pl][pal_sz - 2];
  389|       |
  390|  89.8k|    if (pal_sz == 2) {
  ------------------
  |  Branch (390:9): [True: 20.1k, False: 69.6k]
  ------------------
  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|   569k|        for (int i = 1; i < 4 * (w4 + h4) - 1; i++) {
  ------------------
  |  Branch (395:25): [True: 549k, False: 20.1k]
  ------------------
  396|   549k|            const int first = imin(i, w4 * 4 - 1);
  397|   549k|            const int last = imax(0, i - h4 * 4 + 1);
  398|   549k|            int have_top = i > first;
  399|   549k|            const uint8_t *pal_row = pal_tmp + first + (i - first) * stride;
  400|  4.94M|            for (int j = first; j >= last; have_top = 1, j--, pal_row += stride - 1) {
  ------------------
  |  Branch (400:33): [True: 4.39M, False: 549k]
  ------------------
  401|  4.39M|                const int have_left = j > 0;
  402|  4.39M|                int ctx, p0;
  403|  4.39M|                if (!have_left) {
  ------------------
  |  Branch (403:21): [True: 201k, False: 4.19M]
  ------------------
  404|   201k|                    ctx = 0;
  405|   201k|                    p0 = pal_row[-stride];
  406|  4.19M|                } else if (!have_top) {
  ------------------
  |  Branch (406:28): [True: 347k, False: 3.84M]
  ------------------
  407|   347k|                    ctx = 0;
  408|   347k|                    p0 = pal_row[-1];
  409|  3.84M|                } else {
  410|  3.84M|                    const int l = pal_row[-1], tp = pal_row[-stride];
  411|  3.84M|                    const int tl = pal_row[-(stride + 1)];
  412|  3.84M|                    const int same_t_l = tp == l;
  413|  3.84M|                    const int same_t_tl = tp == tl;
  414|  3.84M|                    ctx = 2 + same_t_l + (same_t_l & same_t_tl);
  415|  3.84M|                    p0 = same_t_l ? tp : tl;
  ------------------
  |  Branch (415:26): [True: 3.14M, False: 699k]
  ------------------
  416|  3.84M|                }
  417|  4.39M|                const int bit = dav1d_msac_decode_bool_adapt(
  ------------------
  |  |   52|  4.39M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  418|  4.39M|                    &ts->msac, color_map_cdf[ctx]);
  419|  4.39M|                pal_tmp[(i - j) * stride + j] = bit ^ p0;
  420|  4.39M|            }
  421|   549k|        }
  422|  20.1k|        t->c->pal_dsp.pal_idx_finish(pal_idx, pal_tmp, bw4 * 4, bh4 * 4,
  423|  20.1k|                                     w4 * 4, h4 * 4);
  424|  20.1k|        return;
  425|  20.1k|    }
  426|       |
  427|  69.6k|    unsigned (*const symbol_adapt)(MsacContext *, uint16_t *, size_t) =
  428|  69.6k|        pal_sz <= 4 ? dav1d_msac_decode_symbol_adapt4 : dav1d_msac_decode_symbol_adapt8;
  ------------------
  |  |   47|  31.2k|#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|  38.3k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  |  Branch (428:9): [True: 31.2k, False: 38.3k]
  ------------------
  429|       |
  430|  1.80M|    for (int i = 1; i < 4 * (w4 + h4) - 1; i++) {
  ------------------
  |  Branch (430:21): [True: 1.73M, False: 69.6k]
  ------------------
  431|       |        // top/left-to-bottom/right diagonals ("wave-front")
  432|  1.73M|        const int first = imin(i, w4 * 4 - 1);
  433|  1.73M|        const int last = imax(0, i - h4 * 4 + 1);
  434|  1.73M|        int have_top = i > first;
  435|  1.73M|        const uint8_t *pal_row = pal_tmp + first + (i - first) * stride;
  436|  14.2M|        for (int j = first; j >= last; have_top = 1, j--, pal_row += stride - 1) {
  ------------------
  |  Branch (436:29): [True: 12.5M, False: 1.73M]
  ------------------
  437|  12.5M|            const int have_left = j > 0;
  438|  12.5M|            uint8_t p[3];
  439|  12.5M|            unsigned mask;
  440|  12.5M|            int ctx, prio_count;
  441|  12.5M|            if (!have_left) {
  ------------------
  |  Branch (441:17): [True: 664k, False: 11.8M]
  ------------------
  442|   664k|                ctx = 0; prio_count = 1;
  443|   664k|                p[0] = pal_row[-stride];
  444|   664k|                mask = 1u << p[0];
  445|  11.8M|            } else if (!have_top) {
  ------------------
  |  Branch (445:24): [True: 1.07M, False: 10.8M]
  ------------------
  446|  1.07M|                ctx = 0; prio_count = 1;
  447|  1.07M|                p[0] = pal_row[-1];
  448|  1.07M|                mask = 1u << p[0];
  449|  10.8M|            } else {
  450|  10.8M|                const int l = pal_row[-1], tp = pal_row[-stride];
  451|  10.8M|                const int tl = pal_row[-(stride + 1)];
  452|  10.8M|                const int same_t_l = tp == l;
  453|  10.8M|                const int same_t_tl = tp == tl;
  454|  10.8M|                const int same_l_tl = l == tl;
  455|  10.8M|                if (same_t_l & same_t_tl) {
  ------------------
  |  Branch (455:21): [True: 4.86M, False: 5.94M]
  ------------------
  456|  4.86M|                    ctx = 4; prio_count = 1;
  457|  4.86M|                    p[0] = tp; mask = 1u << tp;
  458|  5.94M|                } else if (same_t_l) {
  ------------------
  |  Branch (458:28): [True: 374k, False: 5.56M]
  ------------------
  459|   374k|                    ctx = 3; prio_count = 2;
  460|   374k|                    p[0] = tp; p[1] = tl;
  461|   374k|                    mask = (1u << tp) | (1u << tl);
  462|  5.56M|                } else if (same_t_tl | same_l_tl) {
  ------------------
  |  Branch (462:28): [True: 4.41M, False: 1.15M]
  ------------------
  463|  4.41M|                    ctx = 2; prio_count = 2;
  464|  4.41M|                    p[0] = tl; p[1] = same_t_tl ? l : tp;
  ------------------
  |  Branch (464:39): [True: 2.24M, False: 2.16M]
  ------------------
  465|  4.41M|                    mask = (1u << tl) | (1u << p[1]);
  466|  4.41M|                } else {
  467|  1.15M|                    ctx = 1; prio_count = 3;
  468|  1.15M|                    p[0] = imin(tp, l); p[1] = imax(tp, l); p[2] = tl;
  469|  1.15M|                    mask = (1u << tp) | (1u << l) | (1u << tl);
  470|  1.15M|                }
  471|  10.8M|            }
  472|  12.5M|            const int color_idx = symbol_adapt(&ts->msac, color_map_cdf[ctx], pal_sz - 1);
  473|  12.5M|            pal_tmp[(i - j) * stride + j] =
  474|  12.5M|                resolve_pal_color(color_idx, p, prio_count, mask);
  475|  12.5M|        }
  476|  1.73M|    }
  477|       |
  478|  69.6k|    t->c->pal_dsp.pal_idx_finish(pal_idx, pal_tmp, bw4 * 4, bh4 * 4,
  479|  69.6k|                                 w4 * 4, h4 * 4);
  480|  69.6k|}
decode.c:resolve_pal_color:
  351|  12.5M|{
  352|  12.5M|    if (color_idx < prio_count)
  ------------------
  |  Branch (352:9): [True: 10.4M, False: 2.06M]
  ------------------
  353|  10.4M|        return p[color_idx];
  354|  2.06M|    unsigned rank = color_idx - prio_count + (mask & 1);
  355|  2.06M|    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|  2.06M|    static const uint8_t free_offsets2[] = {
  360|  2.06M|        0x00, 0x00, 0x50, 0x15, 0x40, 0x15, 0xa0, 0x0a, 0x00, 0x15, 0x90, 0x0a,
  361|  2.06M|        0x80, 0x0a, 0xf0, 0x03, 0x00, 0x14, 0x50, 0x0a, 0x40, 0x0a, 0xe0, 0x03,
  362|  2.06M|        0x00, 0x0a, 0xd0, 0x03, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x10, 0x50, 0x09,
  363|  2.06M|        0x40, 0x09, 0xa0, 0x03, 0x00, 0x09, 0x90, 0x03, 0x80, 0x03, 0x00, 0x00,
  364|  2.06M|        0x00, 0x08, 0x50, 0x03, 0x40, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
  365|  2.06M|        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x05, 0x40, 0x05, 0xa0, 0x02,
  366|  2.06M|        0x00, 0x05, 0x90, 0x02, 0x80, 0x02, 0x00, 0x00, 0x00, 0x04, 0x50, 0x02,
  367|  2.06M|        0x40, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  368|  2.06M|        0x00, 0x00, 0x50, 0x01, 0x40, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
  369|  2.06M|        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  370|  2.06M|    };
  371|  2.06M|    const unsigned byte_idx = 2 * (mask >> 2) + (rank >> 2);
  372|  2.06M|    assert(byte_idx < sizeof(free_offsets2));
  ------------------
  |  Branch (372:5): [True: 2.06M, False: 0]
  ------------------
  373|  2.06M|    return rank + ((free_offsets2[byte_idx] >> (2 * (rank & 3))) & 3);
  374|  2.06M|}
decode.c:splat_intraref:
  603|  1.80M|{
  604|  1.80M|    const refmvs_block ALIGN(tmpl, 16) = (refmvs_block) {
  605|  1.80M|        .ref.ref = { 0, -1 },
  606|  1.80M|        .mv.mv[0].n = INVALID_MV,
  ------------------
  |  |   40|  1.80M|#define INVALID_MV 0x80008000
  ------------------
  607|  1.80M|        .bs = bs,
  608|  1.80M|        .mf = 0,
  609|  1.80M|    };
  610|  1.80M|    c->refmvs_dsp.splat_mv(&t->rt.r[(t->by & 31) + 5], &tmpl, t->bx, bw4, bh4);
  611|  1.80M|}
decode.c:read_mv_residual:
  108|   976k|{
  109|   976k|    MsacContext *const msac = &ts->msac;
  110|   976k|    const enum MVJoint mv_joint =
  111|   976k|        dav1d_msac_decode_symbol_adapt4(msac, ts->cdf.mv.joint, N_MV_JOINTS - 1);
  ------------------
  |  |   47|   976k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
  112|   976k|    if (mv_joint & MV_JOINT_V)
  ------------------
  |  Branch (112:9): [True: 863k, False: 112k]
  ------------------
  113|   863k|        ref_mv->y += read_mv_component_diff(msac, &ts->cdf.mv.comp[0], mv_prec);
  114|   976k|    if (mv_joint & MV_JOINT_H)
  ------------------
  |  Branch (114:9): [True: 864k, False: 111k]
  ------------------
  115|   864k|        ref_mv->x += read_mv_component_diff(msac, &ts->cdf.mv.comp[1], mv_prec);
  116|   976k|}
decode.c:read_mv_component_diff:
   79|  1.72M|{
   80|  1.72M|    const int sign = dav1d_msac_decode_bool_adapt(msac, mv_comp->sign);
  ------------------
  |  |   52|  1.72M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   81|  1.72M|    const int cl = dav1d_msac_decode_symbol_adapt16(msac, mv_comp->classes, 10);
  ------------------
  |  |   57|  1.72M|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
   82|  1.72M|    int up, fp = 3, hp = 1;
   83|       |
   84|  1.72M|    if (!cl) {
  ------------------
  |  Branch (84:9): [True: 333k, False: 1.39M]
  ------------------
   85|   333k|        up = dav1d_msac_decode_bool_adapt(msac, mv_comp->class0);
  ------------------
  |  |   52|   333k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   86|   333k|        if (mv_prec >= 0) {  // !force_integer_mv
  ------------------
  |  Branch (86:13): [True: 130k, False: 202k]
  ------------------
   87|   130k|            fp = dav1d_msac_decode_symbol_adapt4(msac, mv_comp->class0_fp[up], 3);
  ------------------
  |  |   47|   130k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
   88|   130k|            if (mv_prec > 0) // allow_high_precision_mv
  ------------------
  |  Branch (88:17): [True: 100k, False: 30.4k]
  ------------------
   89|   100k|                hp = dav1d_msac_decode_bool_adapt(msac, mv_comp->class0_hp);
  ------------------
  |  |   52|   100k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   90|   130k|        }
   91|  1.39M|    } else {
   92|  1.39M|        up = 1 << cl;
   93|  14.9M|        for (int n = 0; n < cl; n++)
  ------------------
  |  Branch (93:25): [True: 13.5M, False: 1.39M]
  ------------------
   94|  13.5M|            up |= dav1d_msac_decode_bool_adapt(msac, mv_comp->classN[n]) << n;
  ------------------
  |  |   52|  13.5M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   95|  1.39M|        if (mv_prec >= 0) {  // !force_integer_mv
  ------------------
  |  Branch (95:13): [True: 59.4k, False: 1.33M]
  ------------------
   96|  59.4k|            fp = dav1d_msac_decode_symbol_adapt4(msac, mv_comp->classN_fp, 3);
  ------------------
  |  |   47|  59.4k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
   97|  59.4k|            if (mv_prec > 0) // allow_high_precision_mv
  ------------------
  |  Branch (97:17): [True: 48.9k, False: 10.4k]
  ------------------
   98|  48.9k|                hp = dav1d_msac_decode_bool_adapt(msac, mv_comp->classN_hp);
  ------------------
  |  |   52|  48.9k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
   99|  59.4k|        }
  100|  1.39M|    }
  101|       |
  102|  1.72M|    const int diff = ((up << 3) | (fp << 1) | hp) + 1;
  103|  1.72M|    return apply_sign_bool(diff, sign);
  104|  1.72M|}
decode.c:read_vartx_tree:
  485|  1.68M|{
  486|  1.68M|    const Dav1dFrameContext *const f = t->f;
  487|  1.68M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  488|  1.68M|    const int bw4 = b_dim[0], bh4 = b_dim[1];
  489|       |
  490|       |    // var-tx tree coding
  491|  1.68M|    uint16_t tx_split[2] = { 0 };
  492|  1.68M|    b->max_ytx = dav1d_max_txfm_size_for_bs[bs][0];
  493|  1.68M|    if (!b->skip && (f->frame_hdr->segmentation.lossless[b->seg_id] ||
  ------------------
  |  Branch (493:9): [True: 444k, False: 1.24M]
  |  Branch (493:22): [True: 37.0k, False: 407k]
  ------------------
  494|   407k|                     b->max_ytx == TX_4X4))
  ------------------
  |  Branch (494:22): [True: 30.8k, False: 376k]
  ------------------
  495|  67.8k|    {
  496|  67.8k|        b->max_ytx = b->uvtx = TX_4X4;
  497|  67.8k|        if (f->frame_hdr->txfm_mode == DAV1D_TX_SWITCHABLE) {
  ------------------
  |  Branch (497:13): [True: 9.20k, False: 58.6k]
  ------------------
  498|  9.20k|            dav1d_memset_pow2[b_dim[2]](&t->a->tx[bx4], TX_4X4);
  499|  9.20k|            dav1d_memset_pow2[b_dim[3]](&t->l.tx[by4], TX_4X4);
  500|  9.20k|        }
  501|  1.61M|    } else if (f->frame_hdr->txfm_mode != DAV1D_TX_SWITCHABLE || b->skip) {
  ------------------
  |  Branch (501:16): [True: 1.24M, False: 374k]
  |  Branch (501:66): [True: 241k, False: 132k]
  ------------------
  502|  1.48M|        if (f->frame_hdr->txfm_mode == DAV1D_TX_SWITCHABLE) {
  ------------------
  |  Branch (502:13): [True: 241k, False: 1.24M]
  ------------------
  503|   241k|            dav1d_memset_pow2[b_dim[2]](&t->a->tx[bx4], b_dim[2 + 0]);
  504|   241k|            dav1d_memset_pow2[b_dim[3]](&t->l.tx[by4], b_dim[2 + 1]);
  505|   241k|        }
  506|  1.48M|        b->uvtx = dav1d_max_txfm_size_for_bs[bs][f->cur.p.layout];
  507|  1.48M|    } else {
  508|   132k|        assert(bw4 <= 16 || bh4 <= 16 || b->max_ytx == TX_64X64);
  ------------------
  |  Branch (508:9): [True: 130k, False: 2.63k]
  |  Branch (508:9): [True: 577, False: 2.06k]
  |  Branch (508:9): [True: 2.06k, False: 0]
  ------------------
  509|   132k|        int y, x, y_off, x_off;
  510|   132k|        const TxfmInfo *const ytx = &dav1d_txfm_dimensions[b->max_ytx];
  511|   268k|        for (y = 0, y_off = 0; y < bh4; y += ytx->h, y_off++) {
  ------------------
  |  Branch (511:32): [True: 135k, False: 132k]
  ------------------
  512|   275k|            for (x = 0, x_off = 0; x < bw4; x += ytx->w, x_off++) {
  ------------------
  |  Branch (512:36): [True: 139k, False: 135k]
  ------------------
  513|   139k|                read_tx_tree(t, b->max_ytx, 0, tx_split, x_off, y_off);
  514|       |                // contexts are updated inside read_tx_tree()
  515|   139k|                t->bx += ytx->w;
  516|   139k|            }
  517|   135k|            t->bx -= x;
  518|   135k|            t->by += ytx->h;
  519|   135k|        }
  520|   132k|        t->by -= y;
  521|   132k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   132k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 132k]
  |  |  ------------------
  |  |   35|   132k|        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|   132k|        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|   132k|        b->uvtx = dav1d_max_txfm_size_for_bs[bs][f->cur.p.layout];
  525|   132k|    }
  526|  1.68M|    assert(!(tx_split[0] & ~0x33));
  ------------------
  |  Branch (526:5): [True: 1.68M, False: 0]
  ------------------
  527|  1.68M|    b->tx_split0 = (uint8_t)tx_split[0];
  528|  1.68M|    b->tx_split1 = tx_split[1];
  529|  1.68M|}
decode.c:read_tx_tree:
  122|   276k|{
  123|   276k|    const Dav1dFrameContext *const f = t->f;
  124|   276k|    const int bx4 = t->bx & 31, by4 = t->by & 31;
  125|   276k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[from];
  126|   276k|    const int txw = t_dim->lw, txh = t_dim->lh;
  127|   276k|    int is_split;
  128|       |
  129|   276k|    if (depth < 2 && from > (int) TX_4X4) {
  ------------------
  |  Branch (129:9): [True: 234k, False: 42.2k]
  |  Branch (129:22): [True: 234k, False: 0]
  ------------------
  130|   234k|        const int cat = 2 * (TX_64X64 - t_dim->max) - depth;
  131|   234k|        const int a = t->a->tx[bx4] < txw;
  132|   234k|        const int l = t->l.tx[by4] < txh;
  133|       |
  134|   234k|        is_split = dav1d_msac_decode_bool_adapt(&t->ts->msac,
  ------------------
  |  |   52|   234k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  135|   234k|                       t->ts->cdf.m.txpart[cat][a + l]);
  136|   234k|        if (is_split)
  ------------------
  |  Branch (136:13): [True: 65.4k, False: 169k]
  ------------------
  137|  65.4k|            masks[depth] |= 1 << (y_off * 4 + x_off);
  138|   234k|    } else {
  139|  42.2k|        is_split = 0;
  140|  42.2k|    }
  141|       |
  142|   276k|    if (is_split && t_dim->max > TX_8X8) {
  ------------------
  |  Branch (142:9): [True: 65.4k, False: 211k]
  |  Branch (142:21): [True: 48.8k, False: 16.6k]
  ------------------
  143|  48.8k|        const enum RectTxfmSize sub = t_dim->sub;
  144|  48.8k|        const TxfmInfo *const sub_t_dim = &dav1d_txfm_dimensions[sub];
  145|  48.8k|        const int txsw = sub_t_dim->w, txsh = sub_t_dim->h;
  146|       |
  147|  48.8k|        read_tx_tree(t, sub, depth + 1, masks, x_off * 2 + 0, y_off * 2 + 0);
  148|  48.8k|        t->bx += txsw;
  149|  48.8k|        if (txw >= txh && t->bx < f->bw)
  ------------------
  |  Branch (149:13): [True: 38.2k, False: 10.5k]
  |  Branch (149:27): [True: 37.5k, False: 719]
  ------------------
  150|  37.5k|            read_tx_tree(t, sub, depth + 1, masks, x_off * 2 + 1, y_off * 2 + 0);
  151|  48.8k|        t->bx -= txsw;
  152|  48.8k|        t->by += txsh;
  153|  48.8k|        if (txh >= txw && t->by < f->bh) {
  ------------------
  |  Branch (153:13): [True: 32.0k, False: 16.7k]
  |  Branch (153:27): [True: 30.9k, False: 1.15k]
  ------------------
  154|  30.9k|            read_tx_tree(t, sub, depth + 1, masks, x_off * 2 + 0, y_off * 2 + 1);
  155|  30.9k|            t->bx += txsw;
  156|  30.9k|            if (txw >= txh && t->bx < f->bw)
  ------------------
  |  Branch (156:17): [True: 20.3k, False: 10.5k]
  |  Branch (156:31): [True: 19.6k, False: 703]
  ------------------
  157|  19.6k|                read_tx_tree(t, sub, depth + 1, masks,
  158|  19.6k|                             x_off * 2 + 1, y_off * 2 + 1);
  159|  30.9k|            t->bx -= txsw;
  160|  30.9k|        }
  161|  48.8k|        t->by -= txsh;
  162|   228k|    } else {
  163|   228k|        dav1d_memset_pow2[t_dim->lw](&t->a->tx[bx4], is_split ? TX_4X4 : txw);
  ------------------
  |  Branch (163:54): [True: 16.6k, False: 211k]
  ------------------
  164|   228k|        dav1d_memset_pow2[t_dim->lh](&t->l.tx[by4], is_split ? TX_4X4 : txh);
  ------------------
  |  Branch (164:53): [True: 16.6k, False: 211k]
  ------------------
  165|   228k|    }
  166|   276k|}
decode.c:splat_intrabc_mv:
  572|   757k|{
  573|   757k|    const refmvs_block ALIGN(tmpl, 16) = (refmvs_block) {
  574|   757k|        .ref.ref = { 0, -1 },
  575|   757k|        .mv.mv[0] = b->mv[0],
  576|   757k|        .bs = bs,
  577|   757k|        .mf = 0,
  578|   757k|    };
  579|   757k|    c->refmvs_dsp.splat_mv(&t->rt.r[(t->by & 31) + 5], &tmpl, t->bx, bw4, bh4);
  580|   757k|}
decode.c:findoddzero:
  338|   392k|static inline int findoddzero(const uint8_t *buf, int len) {
  339|   424k|    for (int n = 0; n < len; n++)
  ------------------
  |  Branch (339:21): [True: 409k, False: 14.6k]
  ------------------
  340|   409k|        if (!buf[n * 2]) return 1;
  ------------------
  |  Branch (340:13): [True: 378k, False: 31.3k]
  ------------------
  341|  14.6k|    return 0;
  342|   392k|}
decode.c:find_matching_ref:
  196|   378k|{
  197|   378k|    /*const*/ refmvs_block *const *r = &t->rt.r[(t->by & 31) + 5];
  198|   378k|    int count = 0;
  199|   378k|    int have_topleft = have_top && have_left;
  ------------------
  |  Branch (199:24): [True: 345k, False: 33.2k]
  |  Branch (199:36): [True: 316k, False: 28.0k]
  ------------------
  200|   378k|    int have_topright = imax(bw4, bh4) < 32 &&
  ------------------
  |  Branch (200:25): [True: 354k, False: 24.0k]
  ------------------
  201|   354k|                        have_top && t->bx + bw4 < t->ts->tiling.col_end &&
  ------------------
  |  Branch (201:25): [True: 326k, False: 28.2k]
  |  Branch (201:37): [True: 302k, False: 23.3k]
  ------------------
  202|   302k|                        (intra_edge_flags & EDGE_I444_TOP_HAS_RIGHT);
  ------------------
  |  Branch (202:25): [True: 188k, False: 114k]
  ------------------
  203|       |
  204|   378k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  205|   378k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  206|       |
  207|   378k|    if (have_top) {
  ------------------
  |  Branch (207:9): [True: 345k, False: 33.2k]
  ------------------
  208|   345k|        const refmvs_block *r2 = &r[-1][t->bx];
  209|   345k|        if (matches(r2)) {
  ------------------
  |  |  205|   345k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (205:22): [True: 298k, False: 46.6k]
  |  |  |  Branch (205:53): [True: 276k, False: 21.5k]
  |  |  ------------------
  ------------------
  210|   276k|            masks[0] |= 1;
  211|   276k|            count = 1;
  212|   276k|        }
  213|   345k|        int aw4 = bs(r2)[0];
  ------------------
  |  |  204|   345k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  214|   345k|        if (aw4 >= bw4) {
  ------------------
  |  Branch (214:13): [True: 296k, False: 48.3k]
  ------------------
  215|   296k|            const int off = t->bx & (aw4 - 1);
  216|   296k|            if (off) have_topleft = 0;
  ------------------
  |  Branch (216:17): [True: 50.0k, False: 246k]
  ------------------
  217|   296k|            if (aw4 - off > bw4) have_topright = 0;
  ------------------
  |  Branch (217:17): [True: 51.6k, False: 245k]
  ------------------
  218|   296k|        } else {
  219|  48.3k|            unsigned mask = 1 << aw4;
  220|   119k|            for (int x = aw4; x < w4; x += aw4) {
  ------------------
  |  Branch (220:31): [True: 72.2k, False: 47.7k]
  ------------------
  221|  72.2k|                r2 += aw4;
  222|  72.2k|                if (matches(r2)) {
  ------------------
  |  |  205|  72.2k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (205:22): [True: 58.8k, False: 13.3k]
  |  |  |  Branch (205:53): [True: 55.4k, False: 3.43k]
  |  |  ------------------
  ------------------
  223|  55.4k|                    masks[0] |= mask;
  224|  55.4k|                    if (++count >= 8) return;
  ------------------
  |  Branch (224:25): [True: 537, False: 54.8k]
  ------------------
  225|  55.4k|                }
  226|  71.6k|                aw4 = bs(r2)[0];
  ------------------
  |  |  204|  71.6k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  227|  71.6k|                mask <<= aw4;
  228|  71.6k|            }
  229|  48.3k|        }
  230|   345k|    }
  231|   377k|    if (have_left) {
  ------------------
  |  Branch (231:9): [True: 349k, False: 28.0k]
  ------------------
  232|   349k|        /*const*/ refmvs_block *const *r2 = r;
  233|   349k|        if (matches(&r2[0][t->bx - 1])) {
  ------------------
  |  |  205|   349k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (205:22): [True: 302k, False: 47.7k]
  |  |  |  Branch (205:53): [True: 279k, False: 22.3k]
  |  |  ------------------
  ------------------
  234|   279k|            masks[1] |= 1;
  235|   279k|            if (++count >= 8) return;
  ------------------
  |  Branch (235:17): [True: 335, False: 279k]
  ------------------
  236|   279k|        }
  237|   349k|        int lh4 = bs(&r2[0][t->bx - 1])[1];
  ------------------
  |  |  204|   349k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  238|   349k|        if (lh4 >= bh4) {
  ------------------
  |  Branch (238:13): [True: 292k, False: 56.4k]
  ------------------
  239|   292k|            if (t->by & (lh4 - 1)) have_topleft = 0;
  ------------------
  |  Branch (239:17): [True: 55.2k, False: 237k]
  ------------------
  240|   292k|        } else {
  241|  56.4k|            unsigned mask = 1 << lh4;
  242|   138k|            for (int y = lh4; y < h4; y += lh4) {
  ------------------
  |  Branch (242:31): [True: 83.5k, False: 55.3k]
  ------------------
  243|  83.5k|                r2 += lh4;
  244|  83.5k|                if (matches(&r2[0][t->bx - 1])) {
  ------------------
  |  |  205|  83.5k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (205:22): [True: 62.9k, False: 20.5k]
  |  |  |  Branch (205:53): [True: 58.8k, False: 4.09k]
  |  |  ------------------
  ------------------
  245|  58.8k|                    masks[1] |= mask;
  246|  58.8k|                    if (++count >= 8) return;
  ------------------
  |  Branch (246:25): [True: 1.16k, False: 57.6k]
  ------------------
  247|  58.8k|                }
  248|  82.3k|                lh4 = bs(&r2[0][t->bx - 1])[1];
  ------------------
  |  |  204|  82.3k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  249|  82.3k|                mask <<= lh4;
  250|  82.3k|            }
  251|  56.4k|        }
  252|   349k|    }
  253|   376k|    if (have_topleft && matches(&r[-1][t->bx - 1])) {
  ------------------
  |  |  205|   209k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (205:22): [True: 172k, False: 36.9k]
  |  |  |  Branch (205:53): [True: 158k, False: 14.0k]
  |  |  ------------------
  ------------------
  |  Branch (253:9): [True: 209k, False: 166k]
  ------------------
  254|   158k|        masks[1] |= 1ULL << 32;
  255|   158k|        if (++count >= 8) return;
  ------------------
  |  Branch (255:13): [True: 950, False: 157k]
  ------------------
  256|   158k|    }
  257|   375k|    if (have_topright && matches(&r[-1][t->bx + bw4])) {
  ------------------
  |  |  205|   137k|#define matches(rp) ((rp)->ref.ref[0] == ref + 1 && (rp)->ref.ref[1] == -1)
  |  |  ------------------
  |  |  |  Branch (205:22): [True: 111k, False: 25.9k]
  |  |  |  Branch (205:53): [True: 102k, False: 8.54k]
  |  |  ------------------
  ------------------
  |  Branch (257:9): [True: 137k, False: 238k]
  ------------------
  258|   102k|        masks[0] |= 1ULL << 32;
  259|   102k|    }
  260|   375k|#undef matches
  261|   375k|}
decode.c:derive_warpmv:
  267|  63.8k|{
  268|  63.8k|    int pts[8][2 /* in, out */][2 /* x, y */], np = 0;
  269|  63.8k|    /*const*/ refmvs_block *const *r = &t->rt.r[(t->by & 31) + 5];
  270|       |
  271|  63.8k|#define add_sample(dx, dy, sx, sy, rp) do { \
  272|  63.8k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  273|  63.8k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  274|  63.8k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  275|  63.8k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  276|  63.8k|    np++; \
  277|  63.8k|} while (0)
  278|       |
  279|       |    // use masks[] to find the projectable motion vectors in the edges
  280|  63.8k|    if ((unsigned) masks[0] == 1 && !(masks[1] >> 32)) {
  ------------------
  |  Branch (280:9): [True: 46.2k, False: 17.6k]
  |  Branch (280:37): [True: 18.1k, False: 28.0k]
  ------------------
  281|  18.1k|        const int off = t->bx & (bs(&r[-1][t->bx])[0] - 1);
  ------------------
  |  |  204|  18.1k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  282|  18.1k|        add_sample(-off, 0, 1, -1, &r[-1][t->bx]);
  ------------------
  |  |  271|  18.1k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  272|  18.1k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  18.1k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  273|  18.1k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  18.1k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  18.1k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  275|  18.1k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  276|  18.1k|    np++; \
  |  |  277|  18.1k|} while (0)
  |  |  ------------------
  |  |  |  Branch (277:10): [Folded, False: 18.1k]
  |  |  ------------------
  ------------------
  283|  90.8k|    } else for (unsigned off = 0, xmask = (uint32_t) masks[0]; np < 8 && xmask;) { // top
  ------------------
  |  Branch (283:64): [True: 90.6k, False: 251]
  |  Branch (283:74): [True: 45.2k, False: 45.4k]
  ------------------
  284|  45.2k|        const int tz = ctz(xmask);
  285|  45.2k|        off += tz;
  286|  45.2k|        xmask >>= tz;
  287|  45.2k|        add_sample(off, 0, 1, -1, &r[-1][t->bx + off]);
  ------------------
  |  |  271|  45.2k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  272|  45.2k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  45.2k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  273|  45.2k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  45.2k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  45.2k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  275|  45.2k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  276|  45.2k|    np++; \
  |  |  277|  45.2k|} while (0)
  |  |  ------------------
  |  |  |  Branch (277:10): [Folded, False: 45.2k]
  |  |  ------------------
  ------------------
  288|  45.2k|        xmask &= ~1;
  289|  45.2k|    }
  290|  63.8k|    if (np < 8 && masks[1] == 1) {
  ------------------
  |  Branch (290:9): [True: 63.6k, False: 251]
  |  Branch (290:19): [True: 21.8k, False: 41.7k]
  ------------------
  291|  21.8k|        const int off = t->by & (bs(&r[0][t->bx - 1])[1] - 1);
  ------------------
  |  |  204|  21.8k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  ------------------
  292|  21.8k|        add_sample(0, -off, -1, 1, &r[-off][t->bx - 1]);
  ------------------
  |  |  271|  21.8k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  272|  21.8k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  21.8k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  273|  21.8k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  21.8k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  21.8k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  275|  21.8k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  276|  21.8k|    np++; \
  |  |  277|  21.8k|} while (0)
  |  |  ------------------
  |  |  |  Branch (277:10): [Folded, False: 21.8k]
  |  |  ------------------
  ------------------
  293|  88.8k|    } else for (unsigned off = 0, ymask = (uint32_t) masks[1]; np < 8 && ymask;) { // left
  ------------------
  |  Branch (293:64): [True: 88.2k, False: 619]
  |  Branch (293:74): [True: 46.8k, False: 41.3k]
  ------------------
  294|  46.8k|        const int tz = ctz(ymask);
  295|  46.8k|        off += tz;
  296|  46.8k|        ymask >>= tz;
  297|  46.8k|        add_sample(0, off, -1, 1, &r[off][t->bx - 1]);
  ------------------
  |  |  271|  46.8k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  272|  46.8k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  46.8k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  273|  46.8k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  46.8k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  46.8k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  275|  46.8k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  276|  46.8k|    np++; \
  |  |  277|  46.8k|} while (0)
  |  |  ------------------
  |  |  |  Branch (277:10): [Folded, False: 46.8k]
  |  |  ------------------
  ------------------
  298|  46.8k|        ymask &= ~1;
  299|  46.8k|    }
  300|  63.8k|    if (np < 8 && masks[1] >> 32) // top/left
  ------------------
  |  Branch (300:9): [True: 63.0k, False: 758]
  |  Branch (300:19): [True: 33.9k, False: 29.1k]
  ------------------
  301|  33.9k|        add_sample(0, 0, -1, -1, &r[-1][t->bx - 1]);
  ------------------
  |  |  271|  33.9k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  272|  33.9k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  33.9k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  273|  33.9k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  33.9k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  33.9k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  275|  33.9k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  276|  33.9k|    np++; \
  |  |  277|  33.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (277:10): [Folded, False: 33.9k]
  |  |  ------------------
  ------------------
  302|  63.8k|    if (np < 8 && masks[0] >> 32) // top/right
  ------------------
  |  Branch (302:9): [True: 62.8k, False: 1.02k]
  |  Branch (302:19): [True: 24.1k, False: 38.6k]
  ------------------
  303|  24.1k|        add_sample(bw4, 0, 1, -1, &r[-1][t->bx + bw4]);
  ------------------
  |  |  271|  24.1k|#define add_sample(dx, dy, sx, sy, rp) do { \
  |  |  272|  24.1k|    pts[np][0][0] = 16 * (2 * dx + sx * bs(rp)[0]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  24.1k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  273|  24.1k|    pts[np][0][1] = 16 * (2 * dy + sy * bs(rp)[1]) - 8; \
  |  |  ------------------
  |  |  |  |  204|  24.1k|#define bs(rp) dav1d_block_dimensions[(rp)->bs]
  |  |  ------------------
  |  |  274|  24.1k|    pts[np][1][0] = pts[np][0][0] + (rp)->mv.mv[0].x; \
  |  |  275|  24.1k|    pts[np][1][1] = pts[np][0][1] + (rp)->mv.mv[0].y; \
  |  |  276|  24.1k|    np++; \
  |  |  277|  24.1k|} while (0)
  |  |  ------------------
  |  |  |  Branch (277:10): [Folded, False: 24.1k]
  |  |  ------------------
  ------------------
  304|  63.8k|    assert(np > 0 && np <= 8);
  ------------------
  |  Branch (304:5): [True: 63.8k, False: 0]
  |  Branch (304:5): [True: 63.8k, False: 0]
  ------------------
  305|  63.8k|#undef bs
  306|       |
  307|       |    // select according to motion vector difference against a threshold
  308|  63.8k|    int mvd[8], ret = 0;
  309|  63.8k|    const int thresh = 4 * iclip(imax(bw4, bh4), 4, 28);
  310|   254k|    for (int i = 0; i < np; i++) {
  ------------------
  |  Branch (310:21): [True: 190k, False: 63.8k]
  ------------------
  311|   190k|        mvd[i] = abs(pts[i][1][0] - pts[i][0][0] - mv.x) +
  312|   190k|                 abs(pts[i][1][1] - pts[i][0][1] - mv.y);
  313|   190k|        if (mvd[i] > thresh)
  ------------------
  |  Branch (313:13): [True: 40.2k, False: 149k]
  ------------------
  314|  40.2k|            mvd[i] = -1;
  315|   149k|        else
  316|   149k|            ret++;
  317|   190k|    }
  318|  63.8k|    if (!ret) {
  ------------------
  |  Branch (318:9): [True: 8.74k, False: 55.1k]
  ------------------
  319|  8.74k|        ret = 1;
  320|  63.4k|    } else for (int i = 0, j = np - 1, k = 0; k < np - ret; k++, i++, j--) {
  ------------------
  |  Branch (320:47): [True: 17.1k, False: 46.3k]
  ------------------
  321|  27.2k|        while (mvd[i] != -1) i++;
  ------------------
  |  Branch (321:16): [True: 10.1k, False: 17.1k]
  ------------------
  322|  31.6k|        while (mvd[j] == -1) j--;
  ------------------
  |  Branch (322:16): [True: 14.5k, False: 17.1k]
  ------------------
  323|  17.1k|        assert(i != j);
  ------------------
  |  Branch (323:9): [True: 17.1k, False: 0]
  ------------------
  324|  17.1k|        if (i > j) break;
  ------------------
  |  Branch (324:13): [True: 8.80k, False: 8.31k]
  ------------------
  325|       |        // replace the discarded samples;
  326|  8.31k|        mvd[i] = mvd[j];
  327|  8.31k|        memcpy(pts[i], pts[j], sizeof(*pts));
  328|  8.31k|    }
  329|       |
  330|  63.8k|    if (!dav1d_find_affine_int(pts, ret, bw4, bh4, mv, wmp, t->bx, t->by) &&
  ------------------
  |  Branch (330:9): [True: 60.7k, False: 3.10k]
  ------------------
  331|  60.7k|        !dav1d_get_shear_params(wmp))
  ------------------
  |  Branch (331:9): [True: 58.6k, False: 2.12k]
  ------------------
  332|  58.6k|    {
  333|  58.6k|        wmp->type = DAV1D_WM_TYPE_AFFINE;
  334|  58.6k|    } else
  335|  5.22k|        wmp->type = DAV1D_WM_TYPE_IDENTITY;
  336|  63.8k|}
decode.c:splat_tworef_mv:
  587|   136k|{
  588|   136k|    assert(bw4 >= 2 && bh4 >= 2);
  ------------------
  |  Branch (588:5): [True: 136k, False: 0]
  |  Branch (588:5): [True: 136k, False: 0]
  ------------------
  589|   136k|    const enum CompInterPredMode mode = b->inter_mode;
  590|   136k|    const refmvs_block ALIGN(tmpl, 16) = (refmvs_block) {
  591|   136k|        .ref.ref = { b->ref[0] + 1, b->ref[1] + 1 },
  592|   136k|        .mv.mv = { b->mv[0], b->mv[1] },
  593|   136k|        .bs = bs,
  594|   136k|        .mf = (mode == GLOBALMV_GLOBALMV) | !!((1 << mode) & (0xbc)) * 2,
  595|   136k|    };
  596|   136k|    c->refmvs_dsp.splat_mv(&t->rt.r[(t->by & 31) + 5], &tmpl, t->bx, bw4, bh4);
  597|   136k|}
decode.c:splat_oneref_mv:
  556|   790k|{
  557|   790k|    const enum InterPredMode mode = b->inter_mode;
  558|   790k|    const refmvs_block ALIGN(tmpl, 16) = (refmvs_block) {
  559|   790k|        .ref.ref = { b->ref[0] + 1, b->interintra_type ? 0 : -1 },
  ------------------
  |  Branch (559:37): [True: 47.4k, False: 743k]
  ------------------
  560|   790k|        .mv.mv[0] = b->mv[0],
  561|   790k|        .bs = bs,
  562|   790k|        .mf = (mode == GLOBALMV && imin(bw4, bh4) >= 2) | ((mode == NEWMV) * 2),
  ------------------
  |  Branch (562:16): [True: 363k, False: 427k]
  |  Branch (562:36): [True: 253k, False: 109k]
  ------------------
  563|   790k|    };
  564|   790k|    c->refmvs_dsp.splat_mv(&t->rt.r[(t->by & 31) + 5], &tmpl, t->bx, bw4, bh4);
  565|   790k|}
decode.c:read_restoration_info:
 2557|   108k|{
 2558|   108k|    const Dav1dFrameContext *const f = t->f;
 2559|   108k|    Dav1dTileState *const ts = t->ts;
 2560|   108k|    const Av1RestorationUnit *const lr_ref = ts->lr_ref[p];
 2561|       |
 2562|   108k|    if (frame_type == DAV1D_RESTORATION_SWITCHABLE) {
  ------------------
  |  Branch (2562:9): [True: 31.4k, False: 76.9k]
  ------------------
 2563|  31.4k|        const int filter = dav1d_msac_decode_symbol_adapt4(&ts->msac,
  ------------------
  |  |   47|  31.4k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
 2564|  31.4k|                               ts->cdf.m.restore_switchable, 2);
 2565|  31.4k|        lr->type = filter + !!filter; /* NONE/WIENER/SGRPROJ */
 2566|  76.9k|    } else {
 2567|  76.9k|        const unsigned type =
 2568|  76.9k|            dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  76.9k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
 2569|  76.9k|                frame_type == DAV1D_RESTORATION_WIENER ?
  ------------------
  |  Branch (2569:17): [True: 18.9k, False: 57.9k]
  ------------------
 2570|  57.9k|                ts->cdf.m.restore_wiener : ts->cdf.m.restore_sgrproj);
 2571|  76.9k|        lr->type = type ? frame_type : DAV1D_RESTORATION_NONE;
  ------------------
  |  Branch (2571:20): [True: 31.7k, False: 45.1k]
  ------------------
 2572|  76.9k|    }
 2573|       |
 2574|   108k|    if (lr->type == DAV1D_RESTORATION_WIENER) {
  ------------------
  |  Branch (2574:9): [True: 14.1k, False: 94.2k]
  ------------------
 2575|  14.1k|        lr->filter_v[0] = p ? 0 :
  ------------------
  |  Branch (2575:27): [True: 8.94k, False: 5.23k]
  ------------------
 2576|  14.1k|            dav1d_msac_decode_subexp(&ts->msac,
 2577|  5.23k|                lr_ref->filter_v[0] + 5, 16, 1) - 5;
 2578|  14.1k|        lr->filter_v[1] =
 2579|  14.1k|            dav1d_msac_decode_subexp(&ts->msac,
 2580|  14.1k|                lr_ref->filter_v[1] + 23, 32, 2) - 23;
 2581|  14.1k|        lr->filter_v[2] =
 2582|  14.1k|            dav1d_msac_decode_subexp(&ts->msac,
 2583|  14.1k|                lr_ref->filter_v[2] + 17, 64, 3) - 17;
 2584|       |
 2585|  14.1k|        lr->filter_h[0] = p ? 0 :
  ------------------
  |  Branch (2585:27): [True: 8.94k, False: 5.23k]
  ------------------
 2586|  14.1k|            dav1d_msac_decode_subexp(&ts->msac,
 2587|  5.23k|                lr_ref->filter_h[0] + 5, 16, 1) - 5;
 2588|  14.1k|        lr->filter_h[1] =
 2589|  14.1k|            dav1d_msac_decode_subexp(&ts->msac,
 2590|  14.1k|                lr_ref->filter_h[1] + 23, 32, 2) - 23;
 2591|  14.1k|        lr->filter_h[2] =
 2592|  14.1k|            dav1d_msac_decode_subexp(&ts->msac,
 2593|  14.1k|                lr_ref->filter_h[2] + 17, 64, 3) - 17;
 2594|  14.1k|        memcpy(lr->sgr_weights, lr_ref->sgr_weights, sizeof(lr->sgr_weights));
 2595|  14.1k|        ts->lr_ref[p] = lr;
 2596|  14.1k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  14.1k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 14.1k]
  |  |  ------------------
  |  |   35|  14.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|  14.1k|        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|  94.2k|    } else if (lr->type == DAV1D_RESTORATION_SGRPROJ) {
  ------------------
  |  Branch (2601:16): [True: 34.0k, False: 60.2k]
  ------------------
 2602|  34.0k|        const unsigned idx = dav1d_msac_decode_bools(&ts->msac, 4);
 2603|  34.0k|        const uint16_t *const sgr_params = dav1d_sgr_params[idx];
 2604|  34.0k|        lr->type += idx;
 2605|  34.0k|        lr->sgr_weights[0] = sgr_params[0] ? dav1d_msac_decode_subexp(&ts->msac,
  ------------------
  |  Branch (2605:30): [True: 26.0k, False: 7.95k]
  ------------------
 2606|  26.0k|            lr_ref->sgr_weights[0] + 96, 128, 4) - 96 : 0;
 2607|  34.0k|        lr->sgr_weights[1] = sgr_params[1] ? dav1d_msac_decode_subexp(&ts->msac,
  ------------------
  |  Branch (2607:30): [True: 26.0k, False: 7.91k]
  ------------------
 2608|  26.0k|            lr_ref->sgr_weights[1] + 32, 128, 4) - 32 : 95;
 2609|  34.0k|        memcpy(lr->filter_v, lr_ref->filter_v, sizeof(lr->filter_v));
 2610|  34.0k|        memcpy(lr->filter_h, lr_ref->filter_h, sizeof(lr->filter_h));
 2611|  34.0k|        ts->lr_ref[p] = lr;
 2612|  34.0k|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  34.0k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 34.0k]
  |  |  ------------------
  |  |   35|  34.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|  34.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|  34.0k|    }
 2617|   108k|}
decode.c:init_quant_tables:
   57|  57.7k|{
   58|   202k|    for (int i = 0; i < (frame_hdr->segmentation.enabled ? 8 : 1); i++) {
  ------------------
  |  Branch (58:21): [True: 144k, False: 57.7k]
  |  Branch (58:26): [True: 111k, False: 90.7k]
  ------------------
   59|   144k|        const int yac = frame_hdr->segmentation.enabled ?
  ------------------
  |  Branch (59:25): [True: 99.2k, False: 45.3k]
  ------------------
   60|  99.2k|            iclip_u8(qidx + frame_hdr->segmentation.seg_data.d[i].delta_q) : qidx;
   61|   144k|        const int ydc = iclip_u8(yac + frame_hdr->quant.ydc_delta);
   62|   144k|        const int uac = iclip_u8(yac + frame_hdr->quant.uac_delta);
   63|   144k|        const int udc = iclip_u8(yac + frame_hdr->quant.udc_delta);
   64|   144k|        const int vac = iclip_u8(yac + frame_hdr->quant.vac_delta);
   65|   144k|        const int vdc = iclip_u8(yac + frame_hdr->quant.vdc_delta);
   66|       |
   67|   144k|        dq[i][0][0] = dav1d_dq_tbl[seq_hdr->hbd][ydc][0];
   68|   144k|        dq[i][0][1] = dav1d_dq_tbl[seq_hdr->hbd][yac][1];
   69|   144k|        dq[i][1][0] = dav1d_dq_tbl[seq_hdr->hbd][udc][0];
   70|   144k|        dq[i][1][1] = dav1d_dq_tbl[seq_hdr->hbd][uac][1];
   71|   144k|        dq[i][2][0] = dav1d_dq_tbl[seq_hdr->hbd][vdc][0];
   72|   144k|        dq[i][2][1] = dav1d_dq_tbl[seq_hdr->hbd][vac][1];
   73|   144k|    }
   74|  57.7k|}
decode.c:setup_tile:
 2473|  49.9k|{
 2474|  49.9k|    const int col_sb_start = f->frame_hdr->tiling.col_start_sb[tile_col];
 2475|  49.9k|    const int col_sb128_start = col_sb_start >> !f->seq_hdr->sb128;
 2476|  49.9k|    const int col_sb_end = f->frame_hdr->tiling.col_start_sb[tile_col + 1];
 2477|  49.9k|    const int row_sb_start = f->frame_hdr->tiling.row_start_sb[tile_row];
 2478|  49.9k|    const int row_sb_end = f->frame_hdr->tiling.row_start_sb[tile_row + 1];
 2479|  49.9k|    const int sb_shift = f->sb_shift;
 2480|       |
 2481|  49.9k|    const uint8_t *const size_mul = ss_size_mul[f->cur.p.layout];
 2482|   149k|    for (int p = 0; p < 2; p++) {
  ------------------
  |  Branch (2482:21): [True: 99.9k, False: 49.9k]
  ------------------
 2483|  99.9k|        ts->frame_thread[p].pal_idx = f->frame_thread.pal_idx ?
  ------------------
  |  Branch (2483:39): [True: 0, False: 99.9k]
  ------------------
 2484|      0|            &f->frame_thread.pal_idx[(size_t)tile_start_off * size_mul[1] / 8] :
 2485|  99.9k|            NULL;
 2486|  99.9k|        ts->frame_thread[p].cbi = f->frame_thread.cbi ?
  ------------------
  |  Branch (2486:35): [True: 0, False: 99.9k]
  ------------------
 2487|      0|            &f->frame_thread.cbi[(size_t)tile_start_off * size_mul[0] / 64] :
 2488|  99.9k|            NULL;
 2489|  99.9k|        ts->frame_thread[p].cf = f->frame_thread.cf ?
  ------------------
  |  Branch (2489:34): [True: 0, False: 99.9k]
  ------------------
 2490|      0|            (uint8_t*)f->frame_thread.cf +
 2491|      0|                (((size_t)tile_start_off * size_mul[0]) >> !f->seq_hdr->hbd) :
 2492|  99.9k|            NULL;
 2493|  99.9k|    }
 2494|       |
 2495|  49.9k|    dav1d_cdf_thread_copy(&ts->cdf, &f->in_cdf);
 2496|  49.9k|    ts->last_qidx = f->frame_hdr->quant.yac;
 2497|  49.9k|    ts->last_delta_lf.u32 = 0;
 2498|       |
 2499|  49.9k|    dav1d_msac_init(&ts->msac, data, sz, f->frame_hdr->disable_cdf_update);
 2500|       |
 2501|  49.9k|    ts->tiling.row = tile_row;
 2502|  49.9k|    ts->tiling.col = tile_col;
 2503|  49.9k|    ts->tiling.col_start = col_sb_start << sb_shift;
 2504|  49.9k|    ts->tiling.col_end = imin(col_sb_end << sb_shift, f->bw);
 2505|  49.9k|    ts->tiling.row_start = row_sb_start << sb_shift;
 2506|  49.9k|    ts->tiling.row_end = imin(row_sb_end << sb_shift, f->bh);
 2507|       |
 2508|       |    // Reference Restoration Unit (used for exp coding)
 2509|  49.9k|    int sb_idx, unit_idx;
 2510|  49.9k|    if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (2510:9): [True: 5.86k, False: 44.1k]
  ------------------
 2511|       |        // vertical components only
 2512|  5.86k|        sb_idx = (ts->tiling.row_start >> 5) * f->sr_sb128w;
 2513|  5.86k|        unit_idx = (ts->tiling.row_start & 16) >> 3;
 2514|  44.1k|    } else {
 2515|  44.1k|        sb_idx = (ts->tiling.row_start >> 5) * f->sb128w + col_sb128_start;
 2516|  44.1k|        unit_idx = ((ts->tiling.row_start & 16) >> 3) +
 2517|  44.1k|                   ((ts->tiling.col_start & 16) >> 4);
 2518|  44.1k|    }
 2519|   199k|    for (int p = 0; p < 3; p++) {
  ------------------
  |  Branch (2519:21): [True: 149k, False: 49.9k]
  ------------------
 2520|   149k|        if (!((f->lf.restore_planes >> p) & 1U))
  ------------------
  |  Branch (2520:13): [True: 129k, False: 20.8k]
  ------------------
 2521|   129k|            continue;
 2522|       |
 2523|  20.8k|        if (f->frame_hdr->width[0] != f->frame_hdr->width[1]) {
  ------------------
  |  Branch (2523:13): [True: 6.72k, False: 14.1k]
  ------------------
 2524|  6.72k|            const int ss_hor = p && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (2524:32): [True: 4.57k, False: 2.15k]
  |  Branch (2524:37): [True: 2.33k, False: 2.23k]
  ------------------
 2525|  6.72k|            const int d = f->frame_hdr->super_res.width_scale_denominator;
 2526|  6.72k|            const int unit_size_log2 = f->frame_hdr->restoration.unit_size[!!p];
 2527|  6.72k|            const int rnd = (8 << unit_size_log2) - 1, shift = unit_size_log2 + 3;
 2528|  6.72k|            const int x = ((4 * ts->tiling.col_start * d >> ss_hor) + rnd) >> shift;
 2529|  6.72k|            const int px_x = x << (unit_size_log2 + ss_hor);
 2530|  6.72k|            const int u_idx = unit_idx + ((px_x & 64) >> 6);
 2531|  6.72k|            const int sb128x = px_x >> 7;
 2532|  6.72k|            if (sb128x >= f->sr_sb128w) continue;
  ------------------
  |  Branch (2532:17): [True: 377, False: 6.34k]
  ------------------
 2533|  6.34k|            ts->lr_ref[p] = &f->lf.lr_mask[sb_idx + sb128x].lr[p][u_idx];
 2534|  14.1k|        } else {
 2535|  14.1k|            ts->lr_ref[p] = &f->lf.lr_mask[sb_idx].lr[p][unit_idx];
 2536|  14.1k|        }
 2537|       |
 2538|  20.5k|        ts->lr_ref[p]->filter_v[0] = 3;
 2539|  20.5k|        ts->lr_ref[p]->filter_v[1] = -7;
 2540|  20.5k|        ts->lr_ref[p]->filter_v[2] = 15;
 2541|  20.5k|        ts->lr_ref[p]->filter_h[0] = 3;
 2542|  20.5k|        ts->lr_ref[p]->filter_h[1] = -7;
 2543|  20.5k|        ts->lr_ref[p]->filter_h[2] = 15;
 2544|  20.5k|        ts->lr_ref[p]->sgr_weights[0] = -32;
 2545|  20.5k|        ts->lr_ref[p]->sgr_weights[1] = 31;
 2546|  20.5k|    }
 2547|       |
 2548|  49.9k|    if (f->c->n_tc > 1) {
  ------------------
  |  Branch (2548:9): [True: 0, False: 49.9k]
  ------------------
 2549|      0|        for (int p = 0; p < 2; p++)
  ------------------
  |  Branch (2549:25): [True: 0, False: 0]
  ------------------
 2550|      0|            atomic_init(&ts->progress[p], row_sb_start);
 2551|      0|    }
 2552|  49.9k|}
decode.c:get_upscale_x0:
 3376|  9.58k|static int get_upscale_x0(const int in_w, const int out_w, const int step) {
 3377|  9.58k|    const int err = out_w * step - (in_w << 14);
 3378|  9.58k|    const int x0 = (-((out_w - in_w) << 13) + (out_w >> 1)) / out_w + 128 - (err / 2);
 3379|  9.58k|    return x0 & 0x3fff;
 3380|  9.58k|}

obu.c:get_poc_diff:
  239|   222k|{
  240|   222k|    if (!order_hint_n_bits) return 0;
  ------------------
  |  Branch (240:9): [True: 0, False: 222k]
  ------------------
  241|   222k|    const int mask = 1 << (order_hint_n_bits - 1);
  242|   222k|    const int diff = poc0 - poc1;
  243|   222k|    return (diff & (mask - 1)) - (diff & mask);
  244|   222k|}
refmvs.c:get_gmv_2d:
  482|  1.06M|{
  483|  1.06M|    switch (gmv->type) {
  484|   162k|    case DAV1D_WM_TYPE_ROT_ZOOM:
  ------------------
  |  Branch (484:5): [True: 162k, False: 900k]
  ------------------
  485|   162k|        assert(gmv->matrix[5] ==  gmv->matrix[2]);
  ------------------
  |  Branch (485:9): [True: 162k, False: 0]
  ------------------
  486|   162k|        assert(gmv->matrix[4] == -gmv->matrix[3]);
  ------------------
  |  Branch (486:9): [True: 162k, False: 0]
  ------------------
  487|       |        // fall-through
  488|   162k|    default:
  ------------------
  |  Branch (488:5): [True: 0, False: 1.06M]
  ------------------
  489|   197k|    case DAV1D_WM_TYPE_AFFINE: {
  ------------------
  |  Branch (489:5): [True: 35.1k, False: 1.02M]
  ------------------
  490|   197k|        const int x = bx4 * 4 + bw4 * 2 - 1;
  491|   197k|        const int y = by4 * 4 + bh4 * 2 - 1;
  492|   197k|        const int xc = (gmv->matrix[2] - (1 << 16)) * x +
  493|   197k|                       gmv->matrix[3] * y + gmv->matrix[0];
  494|   197k|        const int yc = (gmv->matrix[5] - (1 << 16)) * y +
  495|   197k|                       gmv->matrix[4] * x + gmv->matrix[1];
  496|   197k|        const int shift = 16 - (3 - !hdr->hp);
  497|   197k|        const int round = (1 << shift) >> 1;
  498|   197k|        mv res = (mv) {
  499|   197k|            .y = apply_sign(((abs(yc) + round) >> shift) << !hdr->hp, yc),
  500|   197k|            .x = apply_sign(((abs(xc) + round) >> shift) << !hdr->hp, xc),
  501|   197k|        };
  502|   197k|        if (hdr->force_integer_mv)
  ------------------
  |  Branch (502:13): [True: 75.2k, False: 122k]
  ------------------
  503|  75.2k|            fix_int_mv_precision(&res);
  504|   197k|        return res;
  505|   162k|    }
  506|   128k|    case DAV1D_WM_TYPE_TRANSLATION: {
  ------------------
  |  Branch (506:5): [True: 128k, False: 934k]
  ------------------
  507|   128k|        mv res = (mv) {
  508|   128k|            .y = gmv->matrix[0] >> 13,
  509|   128k|            .x = gmv->matrix[1] >> 13,
  510|   128k|        };
  511|   128k|        if (hdr->force_integer_mv)
  ------------------
  |  Branch (511:13): [True: 17.7k, False: 111k]
  ------------------
  512|  17.7k|            fix_int_mv_precision(&res);
  513|   128k|        return res;
  514|   162k|    }
  515|   736k|    case DAV1D_WM_TYPE_IDENTITY:
  ------------------
  |  Branch (515:5): [True: 736k, False: 326k]
  ------------------
  516|   736k|        return (mv) { .x = 0, .y = 0 };
  517|  1.06M|    }
  518|  1.06M|}
refmvs.c:fix_int_mv_precision:
  462|  98.1k|static inline void fix_int_mv_precision(mv *const mv) {
  463|  98.1k|    mv->x = (mv->x - (mv->x >> 15) + 3) & ~7U;
  464|  98.1k|    mv->y = (mv->y - (mv->y >> 15) + 3) & ~7U;
  465|  98.1k|}
refmvs.c:fix_mv_precision:
  469|   179k|{
  470|   179k|    if (hdr->force_integer_mv) {
  ------------------
  |  Branch (470:9): [True: 5.05k, False: 174k]
  ------------------
  471|  5.05k|        fix_int_mv_precision(mv);
  472|   174k|    } else if (!hdr->hp) {
  ------------------
  |  Branch (472:16): [True: 15.2k, False: 159k]
  ------------------
  473|  15.2k|        mv->x = (mv->x - (mv->x >> 15)) & ~1U;
  474|  15.2k|        mv->y = (mv->y - (mv->y >> 15)) & ~1U;
  475|  15.2k|    }
  476|   179k|}
refmvs.c:get_poc_diff:
  239|   564k|{
  240|   564k|    if (!order_hint_n_bits) return 0;
  ------------------
  |  Branch (240:9): [True: 247k, False: 316k]
  ------------------
  241|   316k|    const int mask = 1 << (order_hint_n_bits - 1);
  242|   316k|    const int diff = poc0 - poc1;
  243|   316k|    return (diff & (mask - 1)) - (diff & mask);
  244|   564k|}
decode.c:get_partition_ctx:
   87|  2.96M|{
   88|  2.96M|    return ((a->partition[xb8] >> (4 - bl)) & 1) +
   89|  2.96M|          (((l->partition[yb8] >> (4 - bl)) & 1) << 1);
   90|  2.96M|}
decode.c:get_cur_frame_segid:
  445|   905k|{
  446|   905k|    cur_seg_map += bx + by * stride;
  447|   905k|    if (have_left && have_top) {
  ------------------
  |  Branch (447:9): [True: 778k, False: 127k]
  |  Branch (447:22): [True: 570k, False: 207k]
  ------------------
  448|   570k|        const int l = cur_seg_map[-1];
  449|   570k|        const int a = cur_seg_map[-stride];
  450|   570k|        const int al = cur_seg_map[-(stride + 1)];
  451|       |
  452|   570k|        if (l == a && al == l) *seg_ctx = 2;
  ------------------
  |  Branch (452:13): [True: 328k, False: 241k]
  |  Branch (452:23): [True: 314k, False: 13.5k]
  ------------------
  453|   255k|        else if (l == a || al == l || a == al) *seg_ctx = 1;
  ------------------
  |  Branch (453:18): [True: 13.5k, False: 241k]
  |  Branch (453:28): [True: 108k, False: 133k]
  |  Branch (453:39): [True: 83.3k, False: 49.7k]
  ------------------
  454|  49.7k|        else *seg_ctx = 0;
  455|   570k|        return a == al ? a : l;
  ------------------
  |  Branch (455:16): [True: 398k, False: 172k]
  ------------------
  456|   570k|    } else {
  457|   335k|        *seg_ctx = 0;
  458|   335k|        return have_left ? cur_seg_map[-1] : have_top ? cur_seg_map[-stride] : 0;
  ------------------
  |  Branch (458:16): [True: 207k, False: 127k]
  |  Branch (458:46): [True: 123k, False: 3.40k]
  ------------------
  459|   335k|    }
  460|   905k|}
decode.c:get_intra_ctx:
   63|   680k|{
   64|   680k|    if (have_left) {
  ------------------
  |  Branch (64:9): [True: 652k, False: 28.0k]
  ------------------
   65|   652k|        if (have_top) {
  ------------------
  |  Branch (65:13): [True: 578k, False: 73.6k]
  ------------------
   66|   578k|            const int ctx = l->intra[yb4] + a->intra[xb4];
   67|   578k|            return ctx + (ctx == 2);
   68|   578k|        } else
   69|  73.6k|            return l->intra[yb4] * 2;
   70|   652k|    } else {
   71|  28.0k|        return have_top ? a->intra[xb4] * 2 : 0;
  ------------------
  |  Branch (71:16): [True: 16.5k, False: 11.4k]
  ------------------
   72|  28.0k|    }
   73|   680k|}
decode.c:get_tx_ctx:
   79|   669k|{
   80|   669k|    return (l->tx_intra[yb4] >= max_tx->lh) + (a->tx_intra[xb4] >= max_tx->lw);
   81|   669k|}
decode.c:get_comp_ctx:
  160|   203k|{
  161|   203k|    if (have_top) {
  ------------------
  |  Branch (161:9): [True: 168k, False: 34.3k]
  ------------------
  162|   168k|        if (have_left) {
  ------------------
  |  Branch (162:13): [True: 160k, False: 8.03k]
  ------------------
  163|   160k|            if (a->comp_type[xb4]) {
  ------------------
  |  Branch (163:17): [True: 84.9k, False: 75.5k]
  ------------------
  164|  84.9k|                if (l->comp_type[yb4]) {
  ------------------
  |  Branch (164:21): [True: 60.1k, False: 24.8k]
  ------------------
  165|  60.1k|                    return 4;
  166|  60.1k|                } else {
  167|       |                    // 4U means intra (-1) or bwd (>= 4)
  168|  24.8k|                    return 2 + ((unsigned)l->ref[0][yb4] >= 4U);
  169|  24.8k|                }
  170|  84.9k|            } else if (l->comp_type[yb4]) {
  ------------------
  |  Branch (170:24): [True: 28.4k, False: 47.1k]
  ------------------
  171|       |                // 4U means intra (-1) or bwd (>= 4)
  172|  28.4k|                return 2 + ((unsigned)a->ref[0][xb4] >= 4U);
  173|  47.1k|            } else {
  174|  47.1k|                return (l->ref[0][yb4] >= 4) ^ (a->ref[0][xb4] >= 4);
  175|  47.1k|            }
  176|   160k|        } else {
  177|  8.03k|            return a->comp_type[xb4] ? 3 : a->ref[0][xb4] >= 4;
  ------------------
  |  Branch (177:20): [True: 3.27k, False: 4.76k]
  ------------------
  178|  8.03k|        }
  179|   168k|    } else if (have_left) {
  ------------------
  |  Branch (179:16): [True: 31.4k, False: 2.97k]
  ------------------
  180|  31.4k|        return l->comp_type[yb4] ? 3 : l->ref[0][yb4] >= 4;
  ------------------
  |  Branch (180:16): [True: 16.7k, False: 14.6k]
  ------------------
  181|  31.4k|    } else {
  182|  2.97k|        return 1;
  183|  2.97k|    }
  184|   203k|}
decode.c:fix_mv_precision:
  469|   469k|{
  470|   469k|    if (hdr->force_integer_mv) {
  ------------------
  |  Branch (470:9): [True: 145k, False: 324k]
  ------------------
  471|   145k|        fix_int_mv_precision(mv);
  472|   324k|    } else if (!hdr->hp) {
  ------------------
  |  Branch (472:16): [True: 74.2k, False: 249k]
  ------------------
  473|  74.2k|        mv->x = (mv->x - (mv->x >> 15)) & ~1U;
  474|  74.2k|        mv->y = (mv->y - (mv->y >> 15)) & ~1U;
  475|  74.2k|    }
  476|   469k|}
decode.c:fix_int_mv_precision:
  462|   174k|static inline void fix_int_mv_precision(mv *const mv) {
  463|   174k|    mv->x = (mv->x - (mv->x >> 15) + 3) & ~7U;
  464|   174k|    mv->y = (mv->y - (mv->y >> 15) + 3) & ~7U;
  465|   174k|}
decode.c:get_comp_dir_ctx:
  190|   128k|{
  191|   128k|#define has_uni_comp(edge, off) \
  192|   128k|    ((edge->ref[0][off] < 4) == (edge->ref[1][off] < 4))
  193|       |
  194|   128k|    if (have_top && have_left) {
  ------------------
  |  Branch (194:9): [True: 108k, False: 19.6k]
  |  Branch (194:21): [True: 104k, False: 3.86k]
  ------------------
  195|   104k|        const int a_intra = a->intra[xb4], l_intra = l->intra[yb4];
  196|       |
  197|   104k|        if (a_intra && l_intra) return 2;
  ------------------
  |  Branch (197:13): [True: 4.20k, False: 100k]
  |  Branch (197:24): [True: 911, False: 3.29k]
  ------------------
  198|   103k|        if (a_intra || l_intra) {
  ------------------
  |  Branch (198:13): [True: 3.29k, False: 100k]
  |  Branch (198:24): [True: 2.97k, False: 97.4k]
  ------------------
  199|  6.26k|            const BlockContext *const edge = a_intra ? l : a;
  ------------------
  |  Branch (199:46): [True: 3.29k, False: 2.97k]
  ------------------
  200|  6.26k|            const int off = a_intra ? yb4 : xb4;
  ------------------
  |  Branch (200:29): [True: 3.29k, False: 2.97k]
  ------------------
  201|       |
  202|  6.26k|            if (edge->comp_type[off] == COMP_INTER_NONE) return 2;
  ------------------
  |  Branch (202:17): [True: 1.43k, False: 4.82k]
  ------------------
  203|  4.82k|            return 1 + 2 * has_uni_comp(edge, off);
  ------------------
  |  |  192|  4.82k|    ((edge->ref[0][off] < 4) == (edge->ref[1][off] < 4))
  ------------------
  204|  6.26k|        }
  205|       |
  206|  97.4k|        const int a_comp = a->comp_type[xb4] != COMP_INTER_NONE;
  207|  97.4k|        const int l_comp = l->comp_type[yb4] != COMP_INTER_NONE;
  208|  97.4k|        const int a_ref0 = a->ref[0][xb4], l_ref0 = l->ref[0][yb4];
  209|       |
  210|  97.4k|        if (!a_comp && !l_comp) {
  ------------------
  |  Branch (210:13): [True: 26.1k, False: 71.2k]
  |  Branch (210:24): [True: 7.94k, False: 18.2k]
  ------------------
  211|  7.94k|            return 1 + 2 * ((a_ref0 >= 4) == (l_ref0 >= 4));
  212|  89.4k|        } else if (!a_comp || !l_comp) {
  ------------------
  |  Branch (212:20): [True: 18.2k, False: 71.2k]
  |  Branch (212:31): [True: 15.1k, False: 56.1k]
  ------------------
  213|  33.3k|            const BlockContext *const edge = a_comp ? a : l;
  ------------------
  |  Branch (213:46): [True: 15.1k, False: 18.2k]
  ------------------
  214|  33.3k|            const int off = a_comp ? xb4 : yb4;
  ------------------
  |  Branch (214:29): [True: 15.1k, False: 18.2k]
  ------------------
  215|       |
  216|  33.3k|            if (!has_uni_comp(edge, off)) return 1;
  ------------------
  |  |  192|  33.3k|    ((edge->ref[0][off] < 4) == (edge->ref[1][off] < 4))
  ------------------
  |  Branch (216:17): [True: 27.2k, False: 6.09k]
  ------------------
  217|  6.09k|            return 3 + ((a_ref0 >= 4) == (l_ref0 >= 4));
  218|  56.1k|        } else {
  219|  56.1k|            const int a_uni = has_uni_comp(a, xb4), l_uni = has_uni_comp(l, yb4);
  ------------------
  |  |  192|  56.1k|    ((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|  56.1k|    ((edge->ref[0][off] < 4) == (edge->ref[1][off] < 4))
  ------------------
  220|       |
  221|  56.1k|            if (!a_uni && !l_uni) return 0;
  ------------------
  |  Branch (221:17): [True: 47.5k, False: 8.56k]
  |  Branch (221:27): [True: 43.3k, False: 4.17k]
  ------------------
  222|  12.7k|            if (!a_uni || !l_uni) return 2;
  ------------------
  |  Branch (222:17): [True: 4.17k, False: 8.56k]
  |  Branch (222:27): [True: 4.98k, False: 3.58k]
  ------------------
  223|  3.58k|            return 3 + ((a_ref0 == 4) == (l_ref0 == 4));
  224|  12.7k|        }
  225|  97.4k|    } else if (have_top || have_left) {
  ------------------
  |  Branch (225:16): [True: 3.86k, False: 19.6k]
  |  Branch (225:28): [True: 18.8k, False: 806]
  ------------------
  226|  22.6k|        const BlockContext *const edge = have_left ? l : a;
  ------------------
  |  Branch (226:42): [True: 18.8k, False: 3.86k]
  ------------------
  227|  22.6k|        const int off = have_left ? yb4 : xb4;
  ------------------
  |  Branch (227:25): [True: 18.8k, False: 3.86k]
  ------------------
  228|       |
  229|  22.6k|        if (edge->intra[off]) return 2;
  ------------------
  |  Branch (229:13): [True: 694, False: 22.0k]
  ------------------
  230|  22.0k|        if (edge->comp_type[off] == COMP_INTER_NONE) return 2;
  ------------------
  |  Branch (230:13): [True: 5.27k, False: 16.7k]
  ------------------
  231|  16.7k|        return 4 * has_uni_comp(edge, off);
  ------------------
  |  |  192|  16.7k|    ((edge->ref[0][off] < 4) == (edge->ref[1][off] < 4))
  ------------------
  232|  22.0k|    } else {
  233|    806|        return 2;
  234|    806|    }
  235|   128k|}
decode.c:av1_get_fwd_ref_ctx:
  307|   365k|{
  308|   365k|    int cnt[4] = { 0 };
  309|       |
  310|   365k|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (310:9): [True: 325k, False: 39.5k]
  |  Branch (310:21): [True: 302k, False: 23.5k]
  ------------------
  311|   302k|        if (a->ref[0][xb4] < 4) cnt[a->ref[0][xb4]]++;
  ------------------
  |  Branch (311:13): [True: 274k, False: 28.2k]
  ------------------
  312|   302k|        if (a->comp_type[xb4] && a->ref[1][xb4] < 4) cnt[a->ref[1][xb4]]++;
  ------------------
  |  Branch (312:13): [True: 83.7k, False: 218k]
  |  Branch (312:34): [True: 10.0k, False: 73.7k]
  ------------------
  313|   302k|    }
  314|       |
  315|   365k|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (315:9): [True: 355k, False: 10.1k]
  |  Branch (315:22): [True: 331k, False: 23.9k]
  ------------------
  316|   331k|        if (l->ref[0][yb4] < 4) cnt[l->ref[0][yb4]]++;
  ------------------
  |  Branch (316:13): [True: 303k, False: 27.8k]
  ------------------
  317|   331k|        if (l->comp_type[yb4] && l->ref[1][yb4] < 4) cnt[l->ref[1][yb4]]++;
  ------------------
  |  Branch (317:13): [True: 102k, False: 228k]
  |  Branch (317:34): [True: 10.5k, False: 92.3k]
  ------------------
  318|   331k|    }
  319|       |
  320|   365k|    cnt[0] += cnt[1];
  321|   365k|    cnt[2] += cnt[3];
  322|       |
  323|   365k|    return cnt[0] == cnt[2] ? 1 : cnt[0] < cnt[2] ? 0 : 2;
  ------------------
  |  Branch (323:12): [True: 53.9k, False: 311k]
  |  Branch (323:35): [True: 72.7k, False: 238k]
  ------------------
  324|   365k|}
decode.c:av1_get_fwd_ref_2_ctx:
  350|   106k|{
  351|   106k|    int cnt[2] = { 0 };
  352|       |
  353|   106k|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (353:9): [True: 87.5k, False: 18.8k]
  |  Branch (353:21): [True: 80.1k, False: 7.41k]
  ------------------
  354|  80.1k|        if ((a->ref[0][xb4] ^ 2U) < 2) cnt[a->ref[0][xb4] - 2]++;
  ------------------
  |  Branch (354:13): [True: 48.8k, False: 31.2k]
  ------------------
  355|  80.1k|        if (a->comp_type[xb4] && (a->ref[1][xb4] ^ 2U) < 2) cnt[a->ref[1][xb4] - 2]++;
  ------------------
  |  Branch (355:13): [True: 34.2k, False: 45.8k]
  |  Branch (355:34): [True: 4.72k, False: 29.5k]
  ------------------
  356|  80.1k|    }
  357|       |
  358|   106k|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (358:9): [True: 102k, False: 3.40k]
  |  Branch (358:22): [True: 95.7k, False: 7.20k]
  ------------------
  359|  95.7k|        if ((l->ref[0][yb4] ^ 2U) < 2) cnt[l->ref[0][yb4] - 2]++;
  ------------------
  |  Branch (359:13): [True: 64.1k, False: 31.6k]
  ------------------
  360|  95.7k|        if (l->comp_type[yb4] && (l->ref[1][yb4] ^ 2U) < 2) cnt[l->ref[1][yb4] - 2]++;
  ------------------
  |  Branch (360:13): [True: 47.6k, False: 48.0k]
  |  Branch (360:34): [True: 5.61k, False: 42.0k]
  ------------------
  361|  95.7k|    }
  362|       |
  363|   106k|    return cnt[0] == cnt[1] ? 1 : cnt[0] < cnt[1] ? 0 : 2;
  ------------------
  |  Branch (363:12): [True: 24.9k, False: 81.4k]
  |  Branch (363:35): [True: 61.6k, False: 19.7k]
  ------------------
  364|   106k|}
decode.c:av1_get_fwd_ref_1_ctx:
  330|   268k|{
  331|   268k|    int cnt[2] = { 0 };
  332|       |
  333|   268k|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (333:9): [True: 247k, False: 21.8k]
  |  Branch (333:21): [True: 230k, False: 16.3k]
  ------------------
  334|   230k|        if (a->ref[0][xb4] < 2) cnt[a->ref[0][xb4]]++;
  ------------------
  |  Branch (334:13): [True: 199k, False: 31.1k]
  ------------------
  335|   230k|        if (a->comp_type[xb4] && a->ref[1][xb4] < 2) cnt[a->ref[1][xb4]]++;
  ------------------
  |  Branch (335:13): [True: 55.3k, False: 175k]
  |  Branch (335:34): [True: 3.94k, False: 51.4k]
  ------------------
  336|   230k|    }
  337|       |
  338|   268k|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (338:9): [True: 261k, False: 7.45k]
  |  Branch (338:22): [True: 244k, False: 17.0k]
  ------------------
  339|   244k|        if (l->ref[0][yb4] < 2) cnt[l->ref[0][yb4]]++;
  ------------------
  |  Branch (339:13): [True: 212k, False: 31.7k]
  ------------------
  340|   244k|        if (l->comp_type[yb4] && l->ref[1][yb4] < 2) cnt[l->ref[1][yb4]]++;
  ------------------
  |  Branch (340:13): [True: 61.5k, False: 182k]
  |  Branch (340:34): [True: 3.97k, False: 57.5k]
  ------------------
  341|   244k|    }
  342|       |
  343|   268k|    return cnt[0] == cnt[1] ? 1 : cnt[0] < cnt[1] ? 0 : 2;
  ------------------
  |  Branch (343:12): [True: 36.5k, False: 232k]
  |  Branch (343:35): [True: 16.3k, False: 216k]
  ------------------
  344|   268k|}
decode.c:av1_get_bwd_ref_ctx:
  370|   281k|{
  371|   281k|    int cnt[3] = { 0 };
  372|       |
  373|   281k|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (373:9): [True: 234k, False: 47.0k]
  |  Branch (373:21): [True: 221k, False: 13.3k]
  ------------------
  374|   221k|        if (a->ref[0][xb4] >= 4) cnt[a->ref[0][xb4] - 4]++;
  ------------------
  |  Branch (374:13): [True: 114k, False: 106k]
  ------------------
  375|   221k|        if (a->comp_type[xb4] && a->ref[1][xb4] >= 4) cnt[a->ref[1][xb4] - 4]++;
  ------------------
  |  Branch (375:13): [True: 77.4k, False: 144k]
  |  Branch (375:34): [True: 71.5k, False: 5.94k]
  ------------------
  376|   221k|    }
  377|       |
  378|   281k|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (378:9): [True: 271k, False: 9.90k]
  |  Branch (378:22): [True: 257k, False: 14.2k]
  ------------------
  379|   257k|        if (l->ref[0][yb4] >= 4) cnt[l->ref[0][yb4] - 4]++;
  ------------------
  |  Branch (379:13): [True: 136k, False: 121k]
  ------------------
  380|   257k|        if (l->comp_type[yb4] && l->ref[1][yb4] >= 4) cnt[l->ref[1][yb4] - 4]++;
  ------------------
  |  Branch (380:13): [True: 93.8k, False: 163k]
  |  Branch (380:34): [True: 88.7k, False: 5.09k]
  ------------------
  381|   257k|    }
  382|       |
  383|   281k|    cnt[1] += cnt[0];
  384|       |
  385|   281k|    return cnt[2] == cnt[1] ? 1 : cnt[1] < cnt[2] ? 0 : 2;
  ------------------
  |  Branch (385:12): [True: 44.9k, False: 236k]
  |  Branch (385:35): [True: 156k, False: 79.9k]
  ------------------
  386|   281k|}
decode.c:av1_get_bwd_ref_1_ctx:
  392|  99.8k|{
  393|  99.8k|    int cnt[3] = { 0 };
  394|       |
  395|  99.8k|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (395:9): [True: 89.4k, False: 10.4k]
  |  Branch (395:21): [True: 83.5k, False: 5.85k]
  ------------------
  396|  83.5k|        if (a->ref[0][xb4] >= 4) cnt[a->ref[0][xb4] - 4]++;
  ------------------
  |  Branch (396:13): [True: 33.5k, False: 49.9k]
  ------------------
  397|  83.5k|        if (a->comp_type[xb4] && a->ref[1][xb4] >= 4) cnt[a->ref[1][xb4] - 4]++;
  ------------------
  |  Branch (397:13): [True: 37.8k, False: 45.6k]
  |  Branch (397:34): [True: 34.7k, False: 3.15k]
  ------------------
  398|  83.5k|    }
  399|       |
  400|  99.8k|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (400:9): [True: 95.9k, False: 3.91k]
  |  Branch (400:22): [True: 89.4k, False: 6.44k]
  ------------------
  401|  89.4k|        if (l->ref[0][yb4] >= 4) cnt[l->ref[0][yb4] - 4]++;
  ------------------
  |  Branch (401:13): [True: 34.8k, False: 54.6k]
  ------------------
  402|  89.4k|        if (l->comp_type[yb4] && l->ref[1][yb4] >= 4) cnt[l->ref[1][yb4] - 4]++;
  ------------------
  |  Branch (402:13): [True: 42.5k, False: 46.8k]
  |  Branch (402:34): [True: 39.7k, False: 2.78k]
  ------------------
  403|  89.4k|    }
  404|       |
  405|  99.8k|    return cnt[0] == cnt[1] ? 1 : cnt[0] < cnt[1] ? 0 : 2;
  ------------------
  |  Branch (405:12): [True: 20.6k, False: 79.2k]
  |  Branch (405:35): [True: 33.6k, False: 45.5k]
  ------------------
  406|  99.8k|}
decode.c:av1_get_ref_ctx:
  287|   451k|{
  288|   451k|    int cnt[2] = { 0 };
  289|       |
  290|   451k|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (290:9): [True: 395k, False: 55.1k]
  |  Branch (290:21): [True: 365k, False: 30.5k]
  ------------------
  291|   365k|        cnt[a->ref[0][xb4] >= 4]++;
  292|   365k|        if (a->comp_type[xb4]) cnt[a->ref[1][xb4] >= 4]++;
  ------------------
  |  Branch (292:13): [True: 42.5k, False: 322k]
  ------------------
  293|   365k|    }
  294|       |
  295|   451k|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (295:9): [True: 436k, False: 14.9k]
  |  Branch (295:22): [True: 404k, False: 31.5k]
  ------------------
  296|   404k|        cnt[l->ref[0][yb4] >= 4]++;
  297|   404k|        if (l->comp_type[yb4]) cnt[l->ref[1][yb4] >= 4]++;
  ------------------
  |  Branch (297:13): [True: 50.7k, False: 353k]
  ------------------
  298|   404k|    }
  299|       |
  300|   451k|    return cnt[0] == cnt[1] ? 1 : cnt[0] < cnt[1] ? 0 : 2;
  ------------------
  |  Branch (300:12): [True: 67.6k, False: 383k]
  |  Branch (300:35): [True: 146k, False: 237k]
  ------------------
  301|   451k|}
decode.c:av1_get_uni_p1_ctx:
  412|  16.1k|{
  413|  16.1k|    int cnt[3] = { 0 };
  414|       |
  415|  16.1k|    if (have_top && !a->intra[xb4]) {
  ------------------
  |  Branch (415:9): [True: 14.1k, False: 2.07k]
  |  Branch (415:21): [True: 13.5k, False: 567]
  ------------------
  416|  13.5k|        if (a->ref[0][xb4] - 1U < 3) cnt[a->ref[0][xb4] - 1]++;
  ------------------
  |  Branch (416:13): [True: 2.89k, False: 10.6k]
  ------------------
  417|  13.5k|        if (a->comp_type[xb4] && a->ref[1][xb4] - 1U < 3) cnt[a->ref[1][xb4] - 1]++;
  ------------------
  |  Branch (417:13): [True: 9.15k, False: 4.39k]
  |  Branch (417:34): [True: 5.52k, False: 3.63k]
  ------------------
  418|  13.5k|    }
  419|       |
  420|  16.1k|    if (have_left && !l->intra[yb4]) {
  ------------------
  |  Branch (420:9): [True: 14.9k, False: 1.23k]
  |  Branch (420:22): [True: 14.2k, False: 682]
  ------------------
  421|  14.2k|        if (l->ref[0][yb4] - 1U < 3) cnt[l->ref[0][yb4] - 1]++;
  ------------------
  |  Branch (421:13): [True: 3.30k, False: 10.9k]
  ------------------
  422|  14.2k|        if (l->comp_type[yb4] && l->ref[1][yb4] - 1U < 3) cnt[l->ref[1][yb4] - 1]++;
  ------------------
  |  Branch (422:13): [True: 10.0k, False: 4.24k]
  |  Branch (422:34): [True: 5.90k, False: 4.11k]
  ------------------
  423|  14.2k|    }
  424|       |
  425|  16.1k|    cnt[1] += cnt[2];
  426|       |
  427|  16.1k|    return cnt[0] == cnt[1] ? 1 : cnt[0] < cnt[1] ? 0 : 2;
  ------------------
  |  Branch (427:12): [True: 4.99k, False: 11.1k]
  |  Branch (427:35): [True: 7.39k, False: 3.78k]
  ------------------
  428|  16.1k|}
decode.c:get_drl_context:
  432|   231k|{
  433|   231k|    if (ref_mv_stack[ref_idx].weight >= 640)
  ------------------
  |  Branch (433:9): [True: 186k, False: 44.8k]
  ------------------
  434|   186k|        return ref_mv_stack[ref_idx + 1].weight < 640;
  435|       |
  436|  44.8k|    return ref_mv_stack[ref_idx + 1].weight < 640 ? 2 : 0;
  ------------------
  |  Branch (436:12): [True: 44.8k, False: 0]
  ------------------
  437|   231k|}
decode.c:get_gmv_2d:
  482|   386k|{
  483|   386k|    switch (gmv->type) {
  484|  58.3k|    case DAV1D_WM_TYPE_ROT_ZOOM:
  ------------------
  |  Branch (484:5): [True: 58.3k, False: 328k]
  ------------------
  485|  58.3k|        assert(gmv->matrix[5] ==  gmv->matrix[2]);
  ------------------
  |  Branch (485:9): [True: 58.3k, False: 0]
  ------------------
  486|  58.3k|        assert(gmv->matrix[4] == -gmv->matrix[3]);
  ------------------
  |  Branch (486:9): [True: 58.3k, False: 0]
  ------------------
  487|       |        // fall-through
  488|  58.3k|    default:
  ------------------
  |  Branch (488:5): [True: 0, False: 386k]
  ------------------
  489|  65.0k|    case DAV1D_WM_TYPE_AFFINE: {
  ------------------
  |  Branch (489:5): [True: 6.76k, False: 379k]
  ------------------
  490|  65.0k|        const int x = bx4 * 4 + bw4 * 2 - 1;
  491|  65.0k|        const int y = by4 * 4 + bh4 * 2 - 1;
  492|  65.0k|        const int xc = (gmv->matrix[2] - (1 << 16)) * x +
  493|  65.0k|                       gmv->matrix[3] * y + gmv->matrix[0];
  494|  65.0k|        const int yc = (gmv->matrix[5] - (1 << 16)) * y +
  495|  65.0k|                       gmv->matrix[4] * x + gmv->matrix[1];
  496|  65.0k|        const int shift = 16 - (3 - !hdr->hp);
  497|  65.0k|        const int round = (1 << shift) >> 1;
  498|  65.0k|        mv res = (mv) {
  499|  65.0k|            .y = apply_sign(((abs(yc) + round) >> shift) << !hdr->hp, yc),
  500|  65.0k|            .x = apply_sign(((abs(xc) + round) >> shift) << !hdr->hp, xc),
  501|  65.0k|        };
  502|  65.0k|        if (hdr->force_integer_mv)
  ------------------
  |  Branch (502:13): [True: 20.6k, False: 44.3k]
  ------------------
  503|  20.6k|            fix_int_mv_precision(&res);
  504|  65.0k|        return res;
  505|  58.3k|    }
  506|   108k|    case DAV1D_WM_TYPE_TRANSLATION: {
  ------------------
  |  Branch (506:5): [True: 108k, False: 277k]
  ------------------
  507|   108k|        mv res = (mv) {
  508|   108k|            .y = gmv->matrix[0] >> 13,
  509|   108k|            .x = gmv->matrix[1] >> 13,
  510|   108k|        };
  511|   108k|        if (hdr->force_integer_mv)
  ------------------
  |  Branch (511:13): [True: 8.29k, False: 100k]
  ------------------
  512|  8.29k|            fix_int_mv_precision(&res);
  513|   108k|        return res;
  514|  58.3k|    }
  515|   212k|    case DAV1D_WM_TYPE_IDENTITY:
  ------------------
  |  Branch (515:5): [True: 212k, False: 173k]
  ------------------
  516|   212k|        return (mv) { .x = 0, .y = 0 };
  517|   386k|    }
  518|   386k|}
decode.c:get_mask_comp_ctx:
  266|   114k|{
  267|   114k|    const int a_ctx = a->comp_type[xb4] >= COMP_INTER_SEG ? 1 :
  ------------------
  |  Branch (267:23): [True: 19.0k, False: 95.4k]
  ------------------
  268|   114k|                      a->ref[0][xb4] == 6 ? 3 : 0;
  ------------------
  |  Branch (268:23): [True: 5.40k, False: 90.0k]
  ------------------
  269|   114k|    const int l_ctx = l->comp_type[yb4] >= COMP_INTER_SEG ? 1 :
  ------------------
  |  Branch (269:23): [True: 28.6k, False: 85.8k]
  ------------------
  270|   114k|                      l->ref[0][yb4] == 6 ? 3 : 0;
  ------------------
  |  Branch (270:23): [True: 5.12k, False: 80.7k]
  ------------------
  271|       |
  272|   114k|    return imin(a_ctx + l_ctx, 5);
  273|   114k|}
decode.c:get_jnt_comp_ctx:
  251|  55.4k|{
  252|  55.4k|    const int d0 = abs(get_poc_diff(order_hint_n_bits, ref0poc, poc));
  253|  55.4k|    const int d1 = abs(get_poc_diff(order_hint_n_bits, poc, ref1poc));
  254|  55.4k|    const int offset = d0 == d1;
  255|  55.4k|    const int a_ctx = a->comp_type[xb4] >= COMP_INTER_AVG ||
  ------------------
  |  Branch (255:23): [True: 26.2k, False: 29.2k]
  ------------------
  256|  29.2k|                      a->ref[0][xb4] == 6;
  ------------------
  |  Branch (256:23): [True: 2.62k, False: 26.6k]
  ------------------
  257|  55.4k|    const int l_ctx = l->comp_type[yb4] >= COMP_INTER_AVG ||
  ------------------
  |  Branch (257:23): [True: 27.2k, False: 28.2k]
  ------------------
  258|  28.2k|                      l->ref[0][yb4] == 6;
  ------------------
  |  Branch (258:23): [True: 2.32k, False: 25.9k]
  ------------------
  259|       |
  260|  55.4k|    return 3 * offset + a_ctx + l_ctx;
  261|  55.4k|}
decode.c:get_filter_ctx:
  139|   587k|{
  140|   587k|    const int a_filter = (a->ref[0][xb4] == ref || a->ref[1][xb4] == ref) ?
  ------------------
  |  Branch (140:27): [True: 405k, False: 181k]
  |  Branch (140:52): [True: 10.8k, False: 170k]
  ------------------
  141|   416k|                         a->filter[dir][xb4] : DAV1D_N_SWITCHABLE_FILTERS;
  142|   587k|    const int l_filter = (l->ref[0][yb4] == ref || l->ref[1][yb4] == ref) ?
  ------------------
  |  Branch (142:27): [True: 447k, False: 139k]
  |  Branch (142:52): [True: 11.9k, False: 127k]
  ------------------
  143|   459k|                         l->filter[dir][yb4] : DAV1D_N_SWITCHABLE_FILTERS;
  144|       |
  145|   587k|    if (a_filter == l_filter) {
  ------------------
  |  Branch (145:9): [True: 381k, False: 206k]
  ------------------
  146|   381k|        return comp * 4 + a_filter;
  147|   381k|    } else if (a_filter == DAV1D_N_SWITCHABLE_FILTERS) {
  ------------------
  |  Branch (147:16): [True: 110k, False: 95.4k]
  ------------------
  148|   110k|        return comp * 4 + l_filter;
  149|   110k|    } else if (l_filter == DAV1D_N_SWITCHABLE_FILTERS) {
  ------------------
  |  Branch (149:16): [True: 67.6k, False: 27.8k]
  ------------------
  150|  67.6k|        return comp * 4 + a_filter;
  151|  67.6k|    } else {
  152|  27.8k|        return comp * 4 + DAV1D_N_SWITCHABLE_FILTERS;
  153|  27.8k|    }
  154|   587k|}
decode.c:gather_top_partition_prob:
  106|   575k|{
  107|       |    // Exploit the fact that cdfs for PARTITION_V, PARTITION_SPLIT and
  108|       |    // PARTITION_T_TOP_SPLIT are neighbors.
  109|   575k|    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|   575k|    out += in[PARTITION_T_LEFT_SPLIT - 1];
  115|   575k|    if (bl != BL_128X128)
  ------------------
  |  Branch (115:9): [True: 516k, False: 58.4k]
  ------------------
  116|   516k|        out += in[PARTITION_V4 - 1] - in[PARTITION_T_RIGHT_SPLIT];
  117|   575k|    return out;
  118|   575k|}
decode.c:gather_left_partition_prob:
   94|  55.3k|{
   95|  55.3k|    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|  55.3k|    out += in[PARTITION_SPLIT - 1] - in[PARTITION_T_LEFT_SPLIT];
   99|  55.3k|    if (bl != BL_128X128)
  ------------------
  |  Branch (99:9): [True: 48.8k, False: 6.41k]
  ------------------
  100|  48.8k|        out += in[PARTITION_H4 - 1] - in[PARTITION_H4];
  101|  55.3k|    return out;
  102|  55.3k|}
decode.c:get_poc_diff:
  239|   507k|{
  240|   507k|    if (!order_hint_n_bits) return 0;
  ------------------
  |  Branch (240:9): [True: 35.7k, False: 472k]
  ------------------
  241|   472k|    const int mask = 1 << (order_hint_n_bits - 1);
  242|   472k|    const int diff = poc0 - poc1;
  243|   472k|    return (diff & (mask - 1)) - (diff & mask);
  244|   507k|}
recon_tmpl.c:get_uv_inter_txtp:
  122|   178k|{
  123|   178k|    if (uvt_dim->max == TX_32X32)
  ------------------
  |  Branch (123:9): [True: 48.8k, False: 129k]
  ------------------
  124|  48.8k|        return ytxtp == IDTX ? IDTX : DCT_DCT;
  ------------------
  |  Branch (124:16): [True: 1.57k, False: 47.2k]
  ------------------
  125|   129k|    if (uvt_dim->min == TX_16X16 &&
  ------------------
  |  Branch (125:9): [True: 16.2k, False: 113k]
  ------------------
  126|  16.2k|        ((1 << ytxtp) & ((1 << H_FLIPADST) | (1 << V_FLIPADST) |
  ------------------
  |  Branch (126:9): [True: 461, False: 15.7k]
  ------------------
  127|  16.2k|                         (1 << H_ADST) | (1 << V_ADST))))
  128|    461|    {
  129|    461|        return DCT_DCT;
  130|    461|    }
  131|       |
  132|   128k|    return ytxtp;
  133|   129k|}

dav1d_prep_grain_8bpc:
  105|  2.10k|{
  106|  2.10k|    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|  2.10k|    dsp->generate_grain_y(grain_lut[0], data HIGHBD_TAIL_SUFFIX); // always needed
  113|  2.10k|    if (data->num_uv_points[0] || data->chroma_scaling_from_luma)
  ------------------
  |  Branch (113:9): [True: 558, False: 1.55k]
  |  Branch (113:35): [True: 217, False: 1.33k]
  ------------------
  114|    775|        dsp->generate_grain_uv[in->p.layout - 1](grain_lut[1], grain_lut[0],
  115|    775|                                                 data, 0 HIGHBD_TAIL_SUFFIX);
  116|  2.10k|    if (data->num_uv_points[1] || data->chroma_scaling_from_luma)
  ------------------
  |  Branch (116:9): [True: 937, False: 1.17k]
  |  Branch (116:35): [True: 217, False: 955]
  ------------------
  117|  1.15k|        dsp->generate_grain_uv[in->p.layout - 1](grain_lut[2], grain_lut[0],
  118|  1.15k|                                                 data, 1 HIGHBD_TAIL_SUFFIX);
  119|       |
  120|       |    // Generate scaling LUTs as needed
  121|  2.10k|    if (data->num_y_points || data->chroma_scaling_from_luma)
  ------------------
  |  Branch (121:9): [True: 779, False: 1.33k]
  |  Branch (121:31): [True: 212, False: 1.11k]
  ------------------
  122|    991|        generate_scaling(in->p.bpc, data->y_points, data->num_y_points, scaling[0]);
  123|  2.10k|    if (data->num_uv_points[0])
  ------------------
  |  Branch (123:9): [True: 558, False: 1.55k]
  ------------------
  124|    558|        generate_scaling(in->p.bpc, data->uv_points[0], data->num_uv_points[0], scaling[1]);
  125|  2.10k|    if (data->num_uv_points[1])
  ------------------
  |  Branch (125:9): [True: 937, False: 1.17k]
  ------------------
  126|    937|        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.10k|    assert(out->stride[0] == in->stride[0]);
  ------------------
  |  Branch (129:5): [True: 2.10k, False: 0]
  ------------------
  130|  2.10k|    if (!data->num_y_points) {
  ------------------
  |  Branch (130:9): [True: 1.33k, False: 779]
  ------------------
  131|  1.33k|        const ptrdiff_t stride = out->stride[0];
  132|  1.33k|        const ptrdiff_t sz = out->p.h * stride;
  133|  1.33k|        if (sz < 0)
  ------------------
  |  Branch (133:13): [True: 0, False: 1.33k]
  ------------------
  134|      0|            memcpy((uint8_t*) out->data[0] + sz - stride,
  135|      0|                   (uint8_t*) in->data[0] + sz - stride, -sz);
  136|  1.33k|        else
  137|  1.33k|            memcpy(out->data[0], in->data[0], sz);
  138|  1.33k|    }
  139|       |
  140|  2.10k|    if (in->p.layout != DAV1D_PIXEL_LAYOUT_I400 && !data->chroma_scaling_from_luma) {
  ------------------
  |  Branch (140:9): [True: 1.75k, False: 350]
  |  Branch (140:52): [True: 1.54k, False: 217]
  ------------------
  141|  1.54k|        assert(out->stride[1] == in->stride[1]);
  ------------------
  |  Branch (141:9): [True: 1.54k, False: 0]
  ------------------
  142|  1.54k|        const int ss_ver = in->p.layout == DAV1D_PIXEL_LAYOUT_I420;
  143|  1.54k|        const ptrdiff_t stride = out->stride[1];
  144|  1.54k|        const ptrdiff_t sz = ((out->p.h + ss_ver) >> ss_ver) * stride;
  145|  1.54k|        if (sz < 0) {
  ------------------
  |  Branch (145:13): [True: 0, False: 1.54k]
  ------------------
  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|  1.54k|        } else {
  153|  1.54k|            if (!data->num_uv_points[0])
  ------------------
  |  Branch (153:17): [True: 984, False: 558]
  ------------------
  154|    984|                memcpy(out->data[1], in->data[1], sz);
  155|  1.54k|            if (!data->num_uv_points[1])
  ------------------
  |  Branch (155:17): [True: 605, False: 937]
  ------------------
  156|    605|                memcpy(out->data[2], in->data[2], sz);
  157|  1.54k|        }
  158|  1.54k|    }
  159|  2.10k|}
dav1d_apply_grain_row_8bpc:
  167|  15.7k|{
  168|       |    // Synthesize grain for the affected planes
  169|  15.7k|    const Dav1dFilmGrainData *const data = &out->frame_hdr->film_grain.data;
  170|  15.7k|    const int ss_y = in->p.layout == DAV1D_PIXEL_LAYOUT_I420;
  171|  15.7k|    const int ss_x = in->p.layout != DAV1D_PIXEL_LAYOUT_I444;
  172|  15.7k|    const int cpw = (out->p.w + ss_x) >> ss_x;
  173|  15.7k|    const int is_id = out->seq_hdr->mtrx == DAV1D_MC_IDENTITY;
  174|  15.7k|    pixel *const luma_src =
  175|  15.7k|        ((pixel *) in->data[0]) + row * FG_BLOCK_SIZE * PXSTRIDE(in->stride[0]);
  ------------------
  |  |   37|  15.7k|#define FG_BLOCK_SIZE 32
  ------------------
                      ((pixel *) in->data[0]) + row * FG_BLOCK_SIZE * PXSTRIDE(in->stride[0]);
  ------------------
  |  |   53|  15.7k|#define PXSTRIDE(x) (x)
  ------------------
  176|       |#if BITDEPTH != 8
  177|       |    const int bitdepth_max = (1 << out->p.bpc) - 1;
  178|       |#endif
  179|       |
  180|  15.7k|    if (data->num_y_points) {
  ------------------
  |  Branch (180:9): [True: 4.92k, False: 10.8k]
  ------------------
  181|  4.92k|        const int bh = imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE);
  ------------------
  |  |   37|  4.92k|#define FG_BLOCK_SIZE 32
  ------------------
                      const int bh = imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE);
  ------------------
  |  |   37|  4.92k|#define FG_BLOCK_SIZE 32
  ------------------
  182|  4.92k|        dsp->fgy_32x32xn(((pixel *) out->data[0]) + row * FG_BLOCK_SIZE * PXSTRIDE(out->stride[0]),
  ------------------
  |  |   37|  4.92k|#define FG_BLOCK_SIZE 32
  ------------------
                      dsp->fgy_32x32xn(((pixel *) out->data[0]) + row * FG_BLOCK_SIZE * PXSTRIDE(out->stride[0]),
  ------------------
  |  |   53|  4.92k|#define PXSTRIDE(x) (x)
  ------------------
  183|  4.92k|                         luma_src, out->stride[0], data,
  184|  4.92k|                         out->p.w, scaling[0], grain_lut[0], bh, row HIGHBD_TAIL_SUFFIX);
  185|  4.92k|    }
  186|       |
  187|  15.7k|    if (!data->num_uv_points[0] && !data->num_uv_points[1] &&
  ------------------
  |  Branch (187:9): [True: 13.0k, False: 2.67k]
  |  Branch (187:36): [True: 5.52k, False: 7.56k]
  ------------------
  188|  5.52k|        !data->chroma_scaling_from_luma)
  ------------------
  |  Branch (188:9): [True: 4.59k, False: 923]
  ------------------
  189|  4.59k|    {
  190|  4.59k|        return;
  191|  4.59k|    }
  192|       |
  193|  11.1k|    const int bh = (imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE) + ss_y) >> ss_y;
  ------------------
  |  |   37|  11.1k|#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.1k|#define FG_BLOCK_SIZE 32
  ------------------
  194|       |
  195|       |    // extend padding pixels
  196|  11.1k|    if (out->p.w & ss_x) {
  ------------------
  |  Branch (196:9): [True: 3.84k, False: 7.32k]
  ------------------
  197|  3.84k|        pixel *ptr = luma_src;
  198|   101k|        for (int y = 0; y < bh; y++) {
  ------------------
  |  Branch (198:25): [True: 97.1k, False: 3.84k]
  ------------------
  199|  97.1k|            ptr[out->p.w] = ptr[out->p.w - 1];
  200|  97.1k|            ptr += PXSTRIDE(in->stride[0]) << ss_y;
  ------------------
  |  |   53|  97.1k|#define PXSTRIDE(x) (x)
  ------------------
  201|  97.1k|        }
  202|  3.84k|    }
  203|       |
  204|  11.1k|    const ptrdiff_t uv_off = row * FG_BLOCK_SIZE * PXSTRIDE(out->stride[1]) >> ss_y;
  ------------------
  |  |   37|  11.1k|#define FG_BLOCK_SIZE 32
  ------------------
                  const ptrdiff_t uv_off = row * FG_BLOCK_SIZE * PXSTRIDE(out->stride[1]) >> ss_y;
  ------------------
  |  |   53|  11.1k|#define PXSTRIDE(x) (x)
  ------------------
  205|  11.1k|    if (data->chroma_scaling_from_luma) {
  ------------------
  |  Branch (205:9): [True: 923, False: 10.2k]
  ------------------
  206|  2.76k|        for (int pl = 0; pl < 2; pl++)
  ------------------
  |  Branch (206:26): [True: 1.84k, False: 923]
  ------------------
  207|  1.84k|            dsp->fguv_32x32xn[in->p.layout - 1](((pixel *) out->data[1 + pl]) + uv_off,
  208|  1.84k|                                                ((const pixel *) in->data[1 + pl]) + uv_off,
  209|  1.84k|                                                in->stride[1], data, cpw,
  210|  1.84k|                                                scaling[0], grain_lut[1 + pl],
  211|  1.84k|                                                bh, row, luma_src, in->stride[0],
  212|  1.84k|                                                pl, is_id HIGHBD_TAIL_SUFFIX);
  213|  10.2k|    } else {
  214|  30.7k|        for (int pl = 0; pl < 2; pl++)
  ------------------
  |  Branch (214:26): [True: 20.4k, False: 10.2k]
  ------------------
  215|  20.4k|            if (data->num_uv_points[pl])
  ------------------
  |  Branch (215:17): [True: 10.5k, False: 9.95k]
  ------------------
  216|  10.5k|                dsp->fguv_32x32xn[in->p.layout - 1](((pixel *) out->data[1 + pl]) + uv_off,
  217|  10.5k|                                                    ((const pixel *) in->data[1 + pl]) + uv_off,
  218|  10.5k|                                                    in->stride[1], data, cpw,
  219|  10.5k|                                                    scaling[1 + pl], grain_lut[1 + pl],
  220|  10.5k|                                                    bh, row, luma_src, in->stride[0],
  221|  10.5k|                                                    pl, is_id HIGHBD_TAIL_SUFFIX);
  222|  10.2k|    }
  223|  11.1k|}
dav1d_apply_grain_8bpc:
  228|  2.10k|{
  229|  2.10k|    ALIGN_STK_16(entry, grain_lut, 3,[GRAIN_HEIGHT + 1][GRAIN_WIDTH]);
  ------------------
  |  |  100|  2.10k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  2.10k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  230|  2.10k|#if ARCH_X86_64 && BITDEPTH == 8
  231|  2.10k|    ALIGN_STK_64(uint8_t, scaling, 3,[SCALING_SIZE]);
  ------------------
  |  |   96|  2.10k|    ALIGN(type var[sz1d]sznd, ALIGN_64_VAL)
  |  |  ------------------
  |  |  |  |   86|  2.10k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  232|       |#else
  233|       |    uint8_t scaling[3][SCALING_SIZE];
  234|       |#endif
  235|  2.10k|    const int rows = (out->p.h + FG_BLOCK_SIZE - 1) / FG_BLOCK_SIZE;
  ------------------
  |  |   37|  2.10k|#define FG_BLOCK_SIZE 32
  ------------------
                  const int rows = (out->p.h + FG_BLOCK_SIZE - 1) / FG_BLOCK_SIZE;
  ------------------
  |  |   37|  2.10k|#define FG_BLOCK_SIZE 32
  ------------------
  236|       |
  237|  2.10k|    bitfn(dav1d_prep_grain)(dsp, out, in, scaling, grain_lut);
  ------------------
  |  |   51|  2.10k|#define bitfn(x) x##_8bpc
  ------------------
  238|  17.8k|    for (int row = 0; row < rows; row++)
  ------------------
  |  Branch (238:23): [True: 15.7k, False: 2.10k]
  ------------------
  239|  15.7k|        bitfn(dav1d_apply_grain_row)(dsp, out, in, scaling, grain_lut, row);
  ------------------
  |  |   51|  15.7k|#define bitfn(x) x##_8bpc
  ------------------
  240|  2.10k|}
fg_apply_tmpl.c:generate_scaling:
   44|  2.48k|{
   45|  2.48k|#if BITDEPTH == 8
   46|  2.48k|    const int shift_x = 0;
   47|  2.48k|    const int scaling_size = SCALING_SIZE;
  ------------------
  |  |   39|  2.48k|#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.48k|    if (num == 0) {
  ------------------
  |  Branch (54:9): [True: 212, False: 2.27k]
  ------------------
   55|    212|        memset(scaling, 0, scaling_size);
   56|    212|        return;
   57|    212|    }
   58|       |
   59|       |    // Fill up the preceding entries with the initial value
   60|  2.27k|    memset(scaling, points[0][1], points[0][0] << shift_x);
   61|       |
   62|       |    // Linearly interpolate the values in the middle
   63|  5.17k|    for (int i = 0; i < num - 1; i++) {
  ------------------
  |  Branch (63:21): [True: 2.89k, False: 2.27k]
  ------------------
   64|  2.89k|        const int bx = points[i][0];
   65|  2.89k|        const int by = points[i][1];
   66|  2.89k|        const int ex = points[i+1][0];
   67|  2.89k|        const int ey = points[i+1][1];
   68|  2.89k|        const int dx = ex - bx;
   69|  2.89k|        const int dy = ey - by;
   70|  2.89k|        assert(dx > 0);
  ------------------
  |  Branch (70:9): [True: 2.89k, False: 0]
  ------------------
   71|  2.89k|        const int delta = dy * ((0x10000 + (dx >> 1)) / dx);
   72|   185k|        for (int x = 0, d = 0x8000; x < dx; x++) {
  ------------------
  |  Branch (72:37): [True: 182k, False: 2.89k]
  ------------------
   73|   182k|            scaling[(bx + x) << shift_x] = by + (d >> 16);
   74|   182k|            d += delta;
   75|   182k|        }
   76|  2.89k|    }
   77|       |
   78|       |    // Fill up the remaining entries with the final value
   79|  2.27k|    const int n = points[num - 1][0] << shift_x;
   80|  2.27k|    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|  2.27k|}
dav1d_prep_grain_16bpc:
  105|  2.36k|{
  106|  2.36k|    const Dav1dFilmGrainData *const data = &out->frame_hdr->film_grain.data;
  107|  2.36k|#if BITDEPTH != 8
  108|  2.36k|    const int bitdepth_max = (1 << out->p.bpc) - 1;
  109|  2.36k|#endif
  110|       |
  111|       |    // Generate grain LUTs as needed
  112|  2.36k|    dsp->generate_grain_y(grain_lut[0], data HIGHBD_TAIL_SUFFIX); // always needed
  ------------------
  |  |   74|  2.36k|#define HIGHBD_TAIL_SUFFIX , bitdepth_max
  ------------------
  113|  2.36k|    if (data->num_uv_points[0] || data->chroma_scaling_from_luma)
  ------------------
  |  Branch (113:9): [True: 337, False: 2.02k]
  |  Branch (113:35): [True: 230, False: 1.79k]
  ------------------
  114|    567|        dsp->generate_grain_uv[in->p.layout - 1](grain_lut[1], grain_lut[0],
  115|    567|                                                 data, 0 HIGHBD_TAIL_SUFFIX);
  ------------------
  |  |   74|    567|#define HIGHBD_TAIL_SUFFIX , bitdepth_max
  ------------------
  116|  2.36k|    if (data->num_uv_points[1] || data->chroma_scaling_from_luma)
  ------------------
  |  Branch (116:9): [True: 527, False: 1.83k]
  |  Branch (116:35): [True: 230, False: 1.60k]
  ------------------
  117|    757|        dsp->generate_grain_uv[in->p.layout - 1](grain_lut[2], grain_lut[0],
  118|    757|                                                 data, 1 HIGHBD_TAIL_SUFFIX);
  ------------------
  |  |   74|    757|#define HIGHBD_TAIL_SUFFIX , bitdepth_max
  ------------------
  119|       |
  120|       |    // Generate scaling LUTs as needed
  121|  2.36k|    if (data->num_y_points || data->chroma_scaling_from_luma)
  ------------------
  |  Branch (121:9): [True: 1.55k, False: 816]
  |  Branch (121:31): [True: 220, False: 596]
  ------------------
  122|  1.77k|        generate_scaling(in->p.bpc, data->y_points, data->num_y_points, scaling[0]);
  123|  2.36k|    if (data->num_uv_points[0])
  ------------------
  |  Branch (123:9): [True: 337, False: 2.02k]
  ------------------
  124|    337|        generate_scaling(in->p.bpc, data->uv_points[0], data->num_uv_points[0], scaling[1]);
  125|  2.36k|    if (data->num_uv_points[1])
  ------------------
  |  Branch (125:9): [True: 527, False: 1.83k]
  ------------------
  126|    527|        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.36k|    assert(out->stride[0] == in->stride[0]);
  ------------------
  |  Branch (129:5): [True: 2.36k, False: 0]
  ------------------
  130|  2.36k|    if (!data->num_y_points) {
  ------------------
  |  Branch (130:9): [True: 816, False: 1.55k]
  ------------------
  131|    816|        const ptrdiff_t stride = out->stride[0];
  132|    816|        const ptrdiff_t sz = out->p.h * stride;
  133|    816|        if (sz < 0)
  ------------------
  |  Branch (133:13): [True: 0, False: 816]
  ------------------
  134|      0|            memcpy((uint8_t*) out->data[0] + sz - stride,
  135|      0|                   (uint8_t*) in->data[0] + sz - stride, -sz);
  136|    816|        else
  137|    816|            memcpy(out->data[0], in->data[0], sz);
  138|    816|    }
  139|       |
  140|  2.36k|    if (in->p.layout != DAV1D_PIXEL_LAYOUT_I400 && !data->chroma_scaling_from_luma) {
  ------------------
  |  Branch (140:9): [True: 1.42k, False: 939]
  |  Branch (140:52): [True: 1.19k, False: 230]
  ------------------
  141|  1.19k|        assert(out->stride[1] == in->stride[1]);
  ------------------
  |  Branch (141:9): [True: 1.19k, False: 0]
  ------------------
  142|  1.19k|        const int ss_ver = in->p.layout == DAV1D_PIXEL_LAYOUT_I420;
  143|  1.19k|        const ptrdiff_t stride = out->stride[1];
  144|  1.19k|        const ptrdiff_t sz = ((out->p.h + ss_ver) >> ss_ver) * stride;
  145|  1.19k|        if (sz < 0) {
  ------------------
  |  Branch (145:13): [True: 0, False: 1.19k]
  ------------------
  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|  1.19k|        } else {
  153|  1.19k|            if (!data->num_uv_points[0])
  ------------------
  |  Branch (153:17): [True: 860, False: 337]
  ------------------
  154|    860|                memcpy(out->data[1], in->data[1], sz);
  155|  1.19k|            if (!data->num_uv_points[1])
  ------------------
  |  Branch (155:17): [True: 670, False: 527]
  ------------------
  156|    670|                memcpy(out->data[2], in->data[2], sz);
  157|  1.19k|        }
  158|  1.19k|    }
  159|  2.36k|}
dav1d_apply_grain_row_16bpc:
  167|  11.4k|{
  168|       |    // Synthesize grain for the affected planes
  169|  11.4k|    const Dav1dFilmGrainData *const data = &out->frame_hdr->film_grain.data;
  170|  11.4k|    const int ss_y = in->p.layout == DAV1D_PIXEL_LAYOUT_I420;
  171|  11.4k|    const int ss_x = in->p.layout != DAV1D_PIXEL_LAYOUT_I444;
  172|  11.4k|    const int cpw = (out->p.w + ss_x) >> ss_x;
  173|  11.4k|    const int is_id = out->seq_hdr->mtrx == DAV1D_MC_IDENTITY;
  174|  11.4k|    pixel *const luma_src =
  175|  11.4k|        ((pixel *) in->data[0]) + row * FG_BLOCK_SIZE * PXSTRIDE(in->stride[0]);
  ------------------
  |  |   37|  11.4k|#define FG_BLOCK_SIZE 32
  ------------------
  176|  11.4k|#if BITDEPTH != 8
  177|  11.4k|    const int bitdepth_max = (1 << out->p.bpc) - 1;
  178|  11.4k|#endif
  179|       |
  180|  11.4k|    if (data->num_y_points) {
  ------------------
  |  Branch (180:9): [True: 9.41k, False: 2.05k]
  ------------------
  181|  9.41k|        const int bh = imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE);
  ------------------
  |  |   37|  9.41k|#define FG_BLOCK_SIZE 32
  ------------------
                      const int bh = imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE);
  ------------------
  |  |   37|  9.41k|#define FG_BLOCK_SIZE 32
  ------------------
  182|  9.41k|        dsp->fgy_32x32xn(((pixel *) out->data[0]) + row * FG_BLOCK_SIZE * PXSTRIDE(out->stride[0]),
  ------------------
  |  |   37|  9.41k|#define FG_BLOCK_SIZE 32
  ------------------
  183|  9.41k|                         luma_src, out->stride[0], data,
  184|  9.41k|                         out->p.w, scaling[0], grain_lut[0], bh, row HIGHBD_TAIL_SUFFIX);
  ------------------
  |  |   74|  9.41k|#define HIGHBD_TAIL_SUFFIX , bitdepth_max
  ------------------
  185|  9.41k|    }
  186|       |
  187|  11.4k|    if (!data->num_uv_points[0] && !data->num_uv_points[1] &&
  ------------------
  |  Branch (187:9): [True: 10.8k, False: 655]
  |  Branch (187:36): [True: 10.1k, False: 635]
  ------------------
  188|  10.1k|        !data->chroma_scaling_from_luma)
  ------------------
  |  Branch (188:9): [True: 9.00k, False: 1.16k]
  ------------------
  189|  9.00k|    {
  190|  9.00k|        return;
  191|  9.00k|    }
  192|       |
  193|  2.45k|    const int bh = (imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE) + ss_y) >> ss_y;
  ------------------
  |  |   37|  2.45k|#define FG_BLOCK_SIZE 32
  ------------------
                  const int bh = (imin(out->p.h - row * FG_BLOCK_SIZE, FG_BLOCK_SIZE) + ss_y) >> ss_y;
  ------------------
  |  |   37|  2.45k|#define FG_BLOCK_SIZE 32
  ------------------
  194|       |
  195|       |    // extend padding pixels
  196|  2.45k|    if (out->p.w & ss_x) {
  ------------------
  |  Branch (196:9): [True: 1.14k, False: 1.31k]
  ------------------
  197|  1.14k|        pixel *ptr = luma_src;
  198|  22.8k|        for (int y = 0; y < bh; y++) {
  ------------------
  |  Branch (198:25): [True: 21.7k, False: 1.14k]
  ------------------
  199|  21.7k|            ptr[out->p.w] = ptr[out->p.w - 1];
  200|  21.7k|            ptr += PXSTRIDE(in->stride[0]) << ss_y;
  201|  21.7k|        }
  202|  1.14k|    }
  203|       |
  204|  2.45k|    const ptrdiff_t uv_off = row * FG_BLOCK_SIZE * PXSTRIDE(out->stride[1]) >> ss_y;
  ------------------
  |  |   37|  2.45k|#define FG_BLOCK_SIZE 32
  ------------------
  205|  2.45k|    if (data->chroma_scaling_from_luma) {
  ------------------
  |  Branch (205:9): [True: 1.16k, False: 1.29k]
  ------------------
  206|  3.50k|        for (int pl = 0; pl < 2; pl++)
  ------------------
  |  Branch (206:26): [True: 2.33k, False: 1.16k]
  ------------------
  207|  2.33k|            dsp->fguv_32x32xn[in->p.layout - 1](((pixel *) out->data[1 + pl]) + uv_off,
  208|  2.33k|                                                ((const pixel *) in->data[1 + pl]) + uv_off,
  209|  2.33k|                                                in->stride[1], data, cpw,
  210|  2.33k|                                                scaling[0], grain_lut[1 + pl],
  211|  2.33k|                                                bh, row, luma_src, in->stride[0],
  212|  2.33k|                                                pl, is_id HIGHBD_TAIL_SUFFIX);
  ------------------
  |  |   74|  2.33k|#define HIGHBD_TAIL_SUFFIX , bitdepth_max
  ------------------
  213|  1.29k|    } else {
  214|  3.87k|        for (int pl = 0; pl < 2; pl++)
  ------------------
  |  Branch (214:26): [True: 2.58k, False: 1.29k]
  ------------------
  215|  2.58k|            if (data->num_uv_points[pl])
  ------------------
  |  Branch (215:17): [True: 1.42k, False: 1.15k]
  ------------------
  216|  1.42k|                dsp->fguv_32x32xn[in->p.layout - 1](((pixel *) out->data[1 + pl]) + uv_off,
  217|  1.42k|                                                    ((const pixel *) in->data[1 + pl]) + uv_off,
  218|  1.42k|                                                    in->stride[1], data, cpw,
  219|  1.42k|                                                    scaling[1 + pl], grain_lut[1 + pl],
  220|  1.42k|                                                    bh, row, luma_src, in->stride[0],
  221|  1.42k|                                                    pl, is_id HIGHBD_TAIL_SUFFIX);
  ------------------
  |  |   74|  1.42k|#define HIGHBD_TAIL_SUFFIX , bitdepth_max
  ------------------
  222|  1.29k|    }
  223|  2.45k|}
dav1d_apply_grain_16bpc:
  228|  2.36k|{
  229|  2.36k|    ALIGN_STK_16(entry, grain_lut, 3,[GRAIN_HEIGHT + 1][GRAIN_WIDTH]);
  ------------------
  |  |  100|  2.36k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  2.36k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  230|       |#if ARCH_X86_64 && BITDEPTH == 8
  231|       |    ALIGN_STK_64(uint8_t, scaling, 3,[SCALING_SIZE]);
  232|       |#else
  233|  2.36k|    uint8_t scaling[3][SCALING_SIZE];
  234|  2.36k|#endif
  235|  2.36k|    const int rows = (out->p.h + FG_BLOCK_SIZE - 1) / FG_BLOCK_SIZE;
  ------------------
  |  |   37|  2.36k|#define FG_BLOCK_SIZE 32
  ------------------
                  const int rows = (out->p.h + FG_BLOCK_SIZE - 1) / FG_BLOCK_SIZE;
  ------------------
  |  |   37|  2.36k|#define FG_BLOCK_SIZE 32
  ------------------
  236|       |
  237|  2.36k|    bitfn(dav1d_prep_grain)(dsp, out, in, scaling, grain_lut);
  ------------------
  |  |   77|  2.36k|#define bitfn(x) x##_16bpc
  ------------------
  238|  13.8k|    for (int row = 0; row < rows; row++)
  ------------------
  |  Branch (238:23): [True: 11.4k, False: 2.36k]
  ------------------
  239|  11.4k|        bitfn(dav1d_apply_grain_row)(dsp, out, in, scaling, grain_lut, row);
  ------------------
  |  |   77|  11.4k|#define bitfn(x) x##_16bpc
  ------------------
  240|  2.36k|}

dav1d_film_grain_dsp_init_8bpc:
  431|  3.82k|COLD void bitfn(dav1d_film_grain_dsp_init)(Dav1dFilmGrainDSPContext *const c) {
  432|  3.82k|    c->generate_grain_y = generate_grain_y_c;
  433|  3.82k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I420 - 1] = generate_grain_uv_420_c;
  434|  3.82k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I422 - 1] = generate_grain_uv_422_c;
  435|  3.82k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I444 - 1] = generate_grain_uv_444_c;
  436|       |
  437|  3.82k|    c->fgy_32x32xn = fgy_32x32xn_c;
  438|  3.82k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I420 - 1] = fguv_32x32xn_420_c;
  439|  3.82k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I422 - 1] = fguv_32x32xn_422_c;
  440|  3.82k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I444 - 1] = fguv_32x32xn_444_c;
  441|       |
  442|  3.82k|#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|  3.82k|#endif
  451|  3.82k|}
dav1d_film_grain_dsp_init_16bpc:
  431|  5.54k|COLD void bitfn(dav1d_film_grain_dsp_init)(Dav1dFilmGrainDSPContext *const c) {
  432|  5.54k|    c->generate_grain_y = generate_grain_y_c;
  433|  5.54k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I420 - 1] = generate_grain_uv_420_c;
  434|  5.54k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I422 - 1] = generate_grain_uv_422_c;
  435|  5.54k|    c->generate_grain_uv[DAV1D_PIXEL_LAYOUT_I444 - 1] = generate_grain_uv_444_c;
  436|       |
  437|  5.54k|    c->fgy_32x32xn = fgy_32x32xn_c;
  438|  5.54k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I420 - 1] = fguv_32x32xn_420_c;
  439|  5.54k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I422 - 1] = fguv_32x32xn_422_c;
  440|  5.54k|    c->fguv_32x32xn[DAV1D_PIXEL_LAYOUT_I444 - 1] = fguv_32x32xn_444_c;
  441|       |
  442|  5.54k|#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.54k|#endif
  451|  5.54k|}

dav1d_init_get_bits:
   38|   130k|{
   39|   130k|    assert(sz);
  ------------------
  |  Branch (39:5): [True: 130k, False: 0]
  ------------------
   40|   130k|    c->ptr = c->ptr_start = data;
   41|   130k|    c->ptr_end = &c->ptr_start[sz];
   42|   130k|    c->state = 0;
   43|   130k|    c->bits_left = 0;
   44|   130k|    c->error = 0;
   45|   130k|}
dav1d_get_bit:
   47|  3.07M|unsigned dav1d_get_bit(GetBits *const c) {
   48|  3.07M|    if (!c->bits_left) {
  ------------------
  |  Branch (48:9): [True: 458k, False: 2.61M]
  ------------------
   49|   458k|        if (c->ptr >= c->ptr_end) {
  ------------------
  |  Branch (49:13): [True: 5.50k, False: 452k]
  ------------------
   50|  5.50k|            c->error = 1;
   51|   452k|        } else {
   52|   452k|            const unsigned state = *c->ptr++;
   53|   452k|            c->bits_left = 7;
   54|   452k|            c->state = (uint64_t) state << 57;
   55|   452k|            return state >> 7;
   56|   452k|        }
   57|   458k|    }
   58|       |
   59|  2.62M|    const uint64_t state = c->state;
   60|  2.62M|    c->bits_left--;
   61|  2.62M|    c->state = state << 1;
   62|  2.62M|    return (unsigned) (state >> 63);
   63|  3.07M|}
dav1d_get_uleb128:
   95|  62.1k|unsigned dav1d_get_uleb128(GetBits *const c) {
   96|  62.1k|    uint64_t val = 0;
   97|  62.1k|    unsigned i = 0, more;
   98|       |
   99|  67.0k|    do {
  100|  67.0k|        const int v = dav1d_get_bits(c, 8);
  101|  67.0k|        more = v & 0x80;
  102|  67.0k|        val |= ((uint64_t) (v & 0x7F)) << i;
  103|  67.0k|        i += 7;
  104|  67.0k|    } while (more && i < 56);
  ------------------
  |  Branch (104:14): [True: 5.25k, False: 61.7k]
  |  Branch (104:22): [True: 4.89k, False: 359]
  ------------------
  105|       |
  106|  62.1k|    if (val > UINT32_MAX || more) {
  ------------------
  |  Branch (106:9): [True: 256, False: 61.8k]
  |  Branch (106:29): [True: 340, False: 61.5k]
  ------------------
  107|    596|        c->error = 1;
  108|    596|        return 0;
  109|    596|    }
  110|       |
  111|  61.5k|    return (unsigned) val;
  112|  62.1k|}
dav1d_get_uniform:
  114|   112k|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|   112k|    assert(max > 1);
  ------------------
  |  Branch (117:5): [True: 112k, False: 0]
  ------------------
  118|   112k|    const int l = ulog2(max) + 1;
  119|   112k|    assert(l > 1);
  ------------------
  |  Branch (119:5): [True: 112k, False: 0]
  ------------------
  120|   112k|    const unsigned m = (1U << l) - max;
  121|   112k|    const unsigned v = dav1d_get_bits(c, l - 1);
  122|   112k|    return v < m ? v : (v << 1) - m + dav1d_get_bit(c);
  ------------------
  |  Branch (122:12): [True: 108k, False: 4.33k]
  ------------------
  123|   112k|}
dav1d_get_vlc:
  125|  1.27k|unsigned dav1d_get_vlc(GetBits *const c) {
  126|  1.27k|    if (dav1d_get_bit(c))
  ------------------
  |  Branch (126:9): [True: 685, False: 592]
  ------------------
  127|    685|        return 0;
  128|       |
  129|    592|    int n_bits = 0;
  130|  14.1k|    do {
  131|  14.1k|        if (++n_bits == 32)
  ------------------
  |  Branch (131:13): [True: 202, False: 13.9k]
  ------------------
  132|    202|            return UINT32_MAX;
  133|  14.1k|    } while (!dav1d_get_bit(c));
  ------------------
  |  Branch (133:14): [True: 13.6k, False: 390]
  ------------------
  134|       |
  135|    390|    return ((1U << n_bits) - 1) + dav1d_get_bits(c, n_bits);
  136|    592|}
dav1d_get_bits_subexp:
  162|  35.9k|int dav1d_get_bits_subexp(GetBits *const c, const int ref, const unsigned n) {
  163|  35.9k|    return (int) get_bits_subexp_u(c, ref + (1 << n), 2 << n) - (1 << n);
  164|  35.9k|}
getbits.c:refill:
   65|   615k|static inline void refill(GetBits *const c, const int n) {
   66|   615k|    assert(c->bits_left >= 0 && c->bits_left < 32);
  ------------------
  |  Branch (66:5): [True: 615k, False: 0]
  |  Branch (66:5): [True: 615k, False: 0]
  ------------------
   67|   615k|    unsigned state = 0;
   68|   678k|    do {
   69|   678k|        if (c->ptr >= c->ptr_end) {
  ------------------
  |  Branch (69:13): [True: 20.5k, False: 657k]
  ------------------
   70|  20.5k|            c->error = 1;
   71|  20.5k|            if (state) break;
  ------------------
  |  Branch (71:17): [True: 2.10k, False: 18.4k]
  ------------------
   72|  18.4k|            return;
   73|  20.5k|        }
   74|   657k|        state = (state << 8) | *c->ptr++;
   75|   657k|        c->bits_left += 8;
   76|   657k|    } while (n > c->bits_left);
  ------------------
  |  Branch (76:14): [True: 62.4k, False: 595k]
  ------------------
   77|   597k|    c->state |= (uint64_t) state << (64 - c->bits_left);
   78|   597k|}
getbits.c:get_bits_subexp_u:
  140|  35.9k|{
  141|  35.9k|    unsigned v = 0;
  142|       |
  143|   101k|    for (int i = 0;; i++) {
  144|   101k|        const int b = i ? 3 + i - 1 : 3;
  ------------------
  |  Branch (144:23): [True: 65.4k, False: 35.9k]
  ------------------
  145|       |
  146|   101k|        if (n < v + 3 * (1 << b)) {
  ------------------
  |  Branch (146:13): [True: 4.39k, False: 96.9k]
  ------------------
  147|  4.39k|            v += dav1d_get_uniform(c, n - v + 1);
  148|  4.39k|            break;
  149|  4.39k|        }
  150|       |
  151|  96.9k|        if (!dav1d_get_bit(c)) {
  ------------------
  |  Branch (151:13): [True: 31.5k, False: 65.4k]
  ------------------
  152|  31.5k|            v += dav1d_get_bits(c, b);
  153|  31.5k|            break;
  154|  31.5k|        }
  155|       |
  156|  65.4k|        v += 1 << b;
  157|  65.4k|    }
  158|       |
  159|  35.9k|    return ref * 2 <= n ? inv_recenter(ref, v) : n - inv_recenter(n - ref, v);
  ------------------
  |  Branch (159:12): [True: 33.5k, False: 2.34k]
  ------------------
  160|  35.9k|}

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

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|  5.55M|static inline int sm_flag(const BlockContext *const b, const int idx) {
   96|  5.55M|    if (!b->intra[idx]) return 0;
  ------------------
  |  Branch (96:9): [True: 253k, False: 5.30M]
  ------------------
   97|  5.30M|    const enum IntraPredMode m = b->mode[idx];
   98|  5.30M|    return (m == SMOOTH_PRED || m == SMOOTH_H_PRED ||
  ------------------
  |  Branch (98:13): [True: 372k, False: 4.92M]
  |  Branch (98:33): [True: 124k, False: 4.80M]
  ------------------
   99|  4.80M|            m == SMOOTH_V_PRED) ? ANGLE_SMOOTH_EDGE_FLAG : 0;
  ------------------
  |  |   93|   603k|#define ANGLE_SMOOTH_EDGE_FLAG      512
  ------------------
  |  Branch (99:13): [True: 105k, False: 4.69M]
  ------------------
  100|  5.55M|}
recon_tmpl.c:sm_uv_flag:
  102|  3.66M|static inline int sm_uv_flag(const BlockContext *const b, const int idx) {
  103|  3.66M|    const enum IntraPredMode m = b->uvmode[idx];
  104|  3.66M|    return (m == SMOOTH_PRED || m == SMOOTH_H_PRED ||
  ------------------
  |  Branch (104:13): [True: 251k, False: 3.41M]
  |  Branch (104:33): [True: 92.7k, False: 3.31M]
  ------------------
  105|  3.31M|            m == SMOOTH_V_PRED) ? ANGLE_SMOOTH_EDGE_FLAG : 0;
  ------------------
  |  |   93|   395k|#define ANGLE_SMOOTH_EDGE_FLAG      512
  ------------------
  |  Branch (105:13): [True: 50.5k, False: 3.26M]
  ------------------
  106|  3.66M|}

dav1d_prepare_intra_edges_8bpc:
   86|  9.36M|{
   87|  9.36M|    const int bitdepth = bitdepth_from_max(bitdepth_max);
  ------------------
  |  |   58|  9.36M|#define bitdepth_from_max(x) 8
  ------------------
   88|  9.36M|    assert(y < h && x < w);
  ------------------
  |  Branch (88:5): [True: 9.36M, False: 0]
  |  Branch (88:5): [True: 9.36M, False: 0]
  ------------------
   89|       |
   90|  9.36M|    switch (mode) {
   91|   173k|    case VERT_PRED:
  ------------------
  |  Branch (91:5): [True: 173k, False: 9.19M]
  ------------------
   92|   470k|    case HOR_PRED:
  ------------------
  |  Branch (92:5): [True: 297k, False: 9.07M]
  ------------------
   93|   539k|    case DIAG_DOWN_LEFT_PRED:
  ------------------
  |  Branch (93:5): [True: 69.0k, False: 9.29M]
  ------------------
   94|   612k|    case DIAG_DOWN_RIGHT_PRED:
  ------------------
  |  Branch (94:5): [True: 72.5k, False: 9.29M]
  ------------------
   95|   678k|    case VERT_RIGHT_PRED:
  ------------------
  |  Branch (95:5): [True: 66.3k, False: 9.30M]
  ------------------
   96|   765k|    case HOR_DOWN_PRED:
  ------------------
  |  Branch (96:5): [True: 86.9k, False: 9.28M]
  ------------------
   97|   900k|    case HOR_UP_PRED:
  ------------------
  |  Branch (97:5): [True: 134k, False: 9.23M]
  ------------------
   98|  1.00M|    case VERT_LEFT_PRED: {
  ------------------
  |  Branch (98:5): [True: 108k, False: 9.25M]
  ------------------
   99|  1.00M|        *angle = av1_mode_to_angle_map[mode - VERT_PRED] + 3 * *angle;
  100|       |
  101|  1.00M|        if (*angle <= 90)
  ------------------
  |  Branch (101:13): [True: 312k, False: 695k]
  ------------------
  102|   312k|            mode = *angle < 90 && have_top ? Z1_PRED : VERT_PRED;
  ------------------
  |  Branch (102:20): [True: 207k, False: 105k]
  |  Branch (102:35): [True: 166k, False: 40.7k]
  ------------------
  103|   695k|        else if (*angle < 180)
  ------------------
  |  Branch (103:18): [True: 321k, False: 374k]
  ------------------
  104|   321k|            mode = Z2_PRED;
  105|   374k|        else
  106|   374k|            mode = *angle > 180 && have_left ? Z3_PRED : HOR_PRED;
  ------------------
  |  Branch (106:20): [True: 197k, False: 176k]
  |  Branch (106:36): [True: 194k, False: 2.74k]
  ------------------
  107|  1.00M|        break;
  108|   900k|    }
  109|  6.75M|    case DC_PRED:
  ------------------
  |  Branch (109:5): [True: 6.75M, False: 2.61M]
  ------------------
  110|  7.57M|    case PAETH_PRED:
  ------------------
  |  Branch (110:5): [True: 819k, False: 8.54M]
  ------------------
  111|  7.57M|        mode = av1_mode_conv[mode][have_left][have_top];
  112|  7.57M|        break;
  113|   788k|    default:
  ------------------
  |  Branch (113:5): [True: 788k, False: 8.57M]
  ------------------
  114|   788k|        break;
  115|  9.36M|    }
  116|       |
  117|  9.36M|    const pixel *dst_top;
  118|  9.36M|    if (have_top &&
  ------------------
  |  Branch (118:9): [True: 8.52M, False: 847k]
  ------------------
  119|  8.52M|        (av1_intra_prediction_edges[mode].needs_top ||
  ------------------
  |  Branch (119:10): [True: 8.21M, False: 310k]
  ------------------
  120|   310k|         av1_intra_prediction_edges[mode].needs_topleft ||
  ------------------
  |  Branch (120:10): [True: 156k, False: 154k]
  ------------------
  121|   154k|         (av1_intra_prediction_edges[mode].needs_left && !have_left)))
  ------------------
  |  Branch (121:11): [True: 154k, False: 0]
  |  Branch (121:58): [True: 4.63k, False: 149k]
  ------------------
  122|  8.37M|    {
  123|  8.37M|        if (prefilter_toplevel_sb_edge) {
  ------------------
  |  Branch (123:13): [True: 511k, False: 7.85M]
  ------------------
  124|   511k|            dst_top = &prefilter_toplevel_sb_edge[x * 4];
  125|  7.85M|        } else {
  126|  7.85M|            dst_top = &dst[-PXSTRIDE(stride)];
  ------------------
  |  |   53|  7.85M|#define PXSTRIDE(x) (x)
  ------------------
  127|  7.85M|        }
  128|  8.37M|    }
  129|       |
  130|  9.36M|    if (av1_intra_prediction_edges[mode].needs_left) {
  ------------------
  |  Branch (130:9): [True: 8.59M, False: 775k]
  ------------------
  131|  8.59M|        const int sz = th << 2;
  132|  8.59M|        pixel *const left = &topleft_out[-sz];
  133|       |
  134|  8.59M|        if (have_left) {
  ------------------
  |  Branch (134:13): [True: 8.56M, False: 23.0k]
  ------------------
  135|  8.56M|            const int px_have = imin(sz, (h - y) << 2);
  136|       |
  137|  75.1M|            for (int i = 0; i < px_have; i++)
  ------------------
  |  Branch (137:29): [True: 66.5M, False: 8.56M]
  ------------------
  138|  66.5M|                left[sz - 1 - i] = dst[PXSTRIDE(stride) * i - 1];
  ------------------
  |  |   53|  66.5M|#define PXSTRIDE(x) (x)
  ------------------
  139|  8.56M|            if (px_have < sz)
  ------------------
  |  Branch (139:17): [True: 108k, False: 8.46M]
  ------------------
  140|   108k|                pixel_set(left, left[sz - px_have], sz - px_have);
  ------------------
  |  |   48|   108k|#define pixel_set memset
  ------------------
  141|  8.56M|        } else {
  142|  23.0k|            pixel_set(left, have_top ? *dst_top : ((1 << bitdepth) >> 1) + 1, sz);
  ------------------
  |  |   48|  23.0k|#define pixel_set memset
  ------------------
  |  Branch (142:29): [True: 18.8k, False: 4.15k]
  ------------------
  143|  23.0k|        }
  144|       |
  145|  8.59M|        if (av1_intra_prediction_edges[mode].needs_bottomleft) {
  ------------------
  |  Branch (145:13): [True: 194k, False: 8.39M]
  ------------------
  146|   194k|            const int have_bottomleft = (!have_left || y + th >= h) ? 0 :
  ------------------
  |  Branch (146:42): [True: 0, False: 194k]
  |  Branch (146:56): [True: 45.1k, False: 149k]
  ------------------
  147|   194k|                                        (edge_flags & EDGE_I444_LEFT_HAS_BOTTOM);
  148|       |
  149|   194k|            if (have_bottomleft) {
  ------------------
  |  Branch (149:17): [True: 58.7k, False: 135k]
  ------------------
  150|  58.7k|                const int px_have = imin(sz, (h - y - th) << 2);
  151|       |
  152|   630k|                for (int i = 0; i < px_have; i++)
  ------------------
  |  Branch (152:33): [True: 571k, False: 58.7k]
  ------------------
  153|   571k|                    left[-(i + 1)] = dst[(sz + i) * PXSTRIDE(stride) - 1];
  ------------------
  |  |   53|   571k|#define PXSTRIDE(x) (x)
  ------------------
  154|  58.7k|                if (px_have < sz)
  ------------------
  |  Branch (154:21): [True: 2.04k, False: 56.7k]
  ------------------
  155|  2.04k|                    pixel_set(left - sz, left[-px_have], sz - px_have);
  ------------------
  |  |   48|  2.04k|#define pixel_set memset
  ------------------
  156|   135k|            } else {
  157|   135k|                pixel_set(left - sz, left[0], sz);
  ------------------
  |  |   48|   135k|#define pixel_set memset
  ------------------
  158|   135k|            }
  159|   194k|        }
  160|  8.59M|    }
  161|       |
  162|  9.36M|    if (av1_intra_prediction_edges[mode].needs_top) {
  ------------------
  |  Branch (162:9): [True: 8.45M, False: 912k]
  ------------------
  163|  8.45M|        const int sz = tw << 2;
  164|  8.45M|        pixel *const top = &topleft_out[1];
  165|       |
  166|  8.45M|        if (have_top) {
  ------------------
  |  Branch (166:13): [True: 8.21M, False: 244k]
  ------------------
  167|  8.21M|            const int px_have = imin(sz, (w - x) << 2);
  168|  8.21M|            pixel_copy(top, dst_top, px_have);
  ------------------
  |  |   47|  8.21M|#define pixel_copy memcpy
  ------------------
  169|  8.21M|            if (px_have < sz)
  ------------------
  |  Branch (169:17): [True: 157k, False: 8.05M]
  ------------------
  170|   157k|                pixel_set(top + px_have, top[px_have - 1], sz - px_have);
  ------------------
  |  |   48|   157k|#define pixel_set memset
  ------------------
  171|  8.21M|        } else {
  172|   244k|            pixel_set(top, have_left ? dst[-1] : ((1 << bitdepth) >> 1) - 1, sz);
  ------------------
  |  |   48|   244k|#define pixel_set memset
  ------------------
  |  Branch (172:28): [True: 239k, False: 5.11k]
  ------------------
  173|   244k|        }
  174|       |
  175|  8.45M|        if (av1_intra_prediction_edges[mode].needs_topright) {
  ------------------
  |  Branch (175:13): [True: 166k, False: 8.28M]
  ------------------
  176|   166k|            const int have_topright = (!have_top || x + tw >= w) ? 0 :
  ------------------
  |  Branch (176:40): [True: 0, False: 166k]
  |  Branch (176:53): [True: 5.44k, False: 161k]
  ------------------
  177|   166k|                                      (edge_flags & EDGE_I444_TOP_HAS_RIGHT);
  178|       |
  179|   166k|            if (have_topright) {
  ------------------
  |  Branch (179:17): [True: 104k, False: 62.2k]
  ------------------
  180|   104k|                const int px_have = imin(sz, (w - x - tw) << 2);
  181|       |
  182|   104k|                pixel_copy(top + sz, &dst_top[sz], px_have);
  ------------------
  |  |   47|   104k|#define pixel_copy memcpy
  ------------------
  183|   104k|                if (px_have < sz)
  ------------------
  |  Branch (183:21): [True: 1.40k, False: 103k]
  ------------------
  184|  1.40k|                    pixel_set(top + sz + px_have, top[sz + px_have - 1],
  ------------------
  |  |   48|  1.40k|#define pixel_set memset
  ------------------
  185|  1.40k|                              sz - px_have);
  186|   104k|            } else {
  187|  62.2k|                pixel_set(top + sz, top[sz - 1], sz);
  ------------------
  |  |   48|  62.2k|#define pixel_set memset
  ------------------
  188|  62.2k|            }
  189|   166k|        }
  190|  8.45M|    }
  191|       |
  192|  9.36M|    if (av1_intra_prediction_edges[mode].needs_topleft) {
  ------------------
  |  Branch (192:9): [True: 1.56M, False: 7.79M]
  ------------------
  193|  1.56M|        if (have_left)
  ------------------
  |  Branch (193:13): [True: 1.55M, False: 12.9k]
  ------------------
  194|  1.55M|            *topleft_out = have_top ? dst_top[-1] : dst[-1];
  ------------------
  |  Branch (194:28): [True: 1.42M, False: 129k]
  ------------------
  195|  12.9k|        else
  196|  12.9k|            *topleft_out = have_top ? *dst_top : (1 << bitdepth) >> 1;
  ------------------
  |  Branch (196:28): [True: 11.8k, False: 1.18k]
  ------------------
  197|       |
  198|  1.56M|        if (mode == Z2_PRED && tw + th >= 6 && filter_edge)
  ------------------
  |  Branch (198:13): [True: 321k, False: 1.24M]
  |  Branch (198:32): [True: 126k, False: 194k]
  |  Branch (198:48): [True: 22.6k, False: 104k]
  ------------------
  199|  22.6k|            *topleft_out = ((topleft_out[-1] + topleft_out[1]) * 5 +
  200|  22.6k|                            topleft_out[0] * 6 + 8) >> 4;
  201|  1.56M|    }
  202|       |
  203|  9.36M|    return mode;
  204|  9.36M|}
dav1d_prepare_intra_edges_16bpc:
   86|  7.92M|{
   87|  7.92M|    const int bitdepth = bitdepth_from_max(bitdepth_max);
  ------------------
  |  |   75|  7.92M|#define bitdepth_from_max(bitdepth_max) (32 - clz(bitdepth_max))
  ------------------
   88|  7.92M|    assert(y < h && x < w);
  ------------------
  |  Branch (88:5): [True: 7.92M, False: 0]
  |  Branch (88:5): [True: 7.92M, False: 0]
  ------------------
   89|       |
   90|  7.92M|    switch (mode) {
   91|   252k|    case VERT_PRED:
  ------------------
  |  Branch (91:5): [True: 252k, False: 7.67M]
  ------------------
   92|   659k|    case HOR_PRED:
  ------------------
  |  Branch (92:5): [True: 407k, False: 7.51M]
  ------------------
   93|   743k|    case DIAG_DOWN_LEFT_PRED:
  ------------------
  |  Branch (93:5): [True: 83.3k, False: 7.84M]
  ------------------
   94|   827k|    case DIAG_DOWN_RIGHT_PRED:
  ------------------
  |  Branch (94:5): [True: 84.3k, False: 7.84M]
  ------------------
   95|   894k|    case VERT_RIGHT_PRED:
  ------------------
  |  Branch (95:5): [True: 66.5k, False: 7.85M]
  ------------------
   96|  1.07M|    case HOR_DOWN_PRED:
  ------------------
  |  Branch (96:5): [True: 176k, False: 7.74M]
  ------------------
   97|  1.27M|    case HOR_UP_PRED:
  ------------------
  |  Branch (97:5): [True: 201k, False: 7.72M]
  ------------------
   98|  1.38M|    case VERT_LEFT_PRED: {
  ------------------
  |  Branch (98:5): [True: 113k, False: 7.81M]
  ------------------
   99|  1.38M|        *angle = av1_mode_to_angle_map[mode - VERT_PRED] + 3 * *angle;
  100|       |
  101|  1.38M|        if (*angle <= 90)
  ------------------
  |  Branch (101:13): [True: 364k, False: 1.02M]
  ------------------
  102|   364k|            mode = *angle < 90 && have_top ? Z1_PRED : VERT_PRED;
  ------------------
  |  Branch (102:20): [True: 234k, False: 129k]
  |  Branch (102:35): [True: 170k, False: 64.6k]
  ------------------
  103|  1.02M|        else if (*angle < 180)
  ------------------
  |  Branch (103:18): [True: 499k, False: 521k]
  ------------------
  104|   499k|            mode = Z2_PRED;
  105|   521k|        else
  106|   521k|            mode = *angle > 180 && have_left ? Z3_PRED : HOR_PRED;
  ------------------
  |  Branch (106:20): [True: 287k, False: 233k]
  |  Branch (106:36): [True: 278k, False: 9.10k]
  ------------------
  107|  1.38M|        break;
  108|  1.27M|    }
  109|  4.48M|    case DC_PRED:
  ------------------
  |  Branch (109:5): [True: 4.48M, False: 3.44M]
  ------------------
  110|  5.58M|    case PAETH_PRED:
  ------------------
  |  Branch (110:5): [True: 1.10M, False: 6.82M]
  ------------------
  111|  5.58M|        mode = av1_mode_conv[mode][have_left][have_top];
  112|  5.58M|        break;
  113|   955k|    default:
  ------------------
  |  Branch (113:5): [True: 955k, False: 6.97M]
  ------------------
  114|   955k|        break;
  115|  7.92M|    }
  116|       |
  117|  7.92M|    const pixel *dst_top;
  118|  7.92M|    if (have_top &&
  ------------------
  |  Branch (118:9): [True: 6.34M, False: 1.58M]
  ------------------
  119|  6.34M|        (av1_intra_prediction_edges[mode].needs_top ||
  ------------------
  |  Branch (119:10): [True: 5.96M, False: 378k]
  ------------------
  120|   378k|         av1_intra_prediction_edges[mode].needs_topleft ||
  ------------------
  |  Branch (120:10): [True: 193k, False: 185k]
  ------------------
  121|   185k|         (av1_intra_prediction_edges[mode].needs_left && !have_left)))
  ------------------
  |  Branch (121:11): [True: 185k, False: 0]
  |  Branch (121:58): [True: 10.9k, False: 174k]
  ------------------
  122|  6.17M|    {
  123|  6.17M|        if (prefilter_toplevel_sb_edge) {
  ------------------
  |  Branch (123:13): [True: 316k, False: 5.85M]
  ------------------
  124|   316k|            dst_top = &prefilter_toplevel_sb_edge[x * 4];
  125|  5.85M|        } else {
  126|  5.85M|            dst_top = &dst[-PXSTRIDE(stride)];
  127|  5.85M|        }
  128|  6.17M|    }
  129|       |
  130|  7.92M|    if (av1_intra_prediction_edges[mode].needs_left) {
  ------------------
  |  Branch (130:9): [True: 7.19M, False: 732k]
  ------------------
  131|  7.19M|        const int sz = th << 2;
  132|  7.19M|        pixel *const left = &topleft_out[-sz];
  133|       |
  134|  7.19M|        if (have_left) {
  ------------------
  |  Branch (134:13): [True: 7.14M, False: 45.8k]
  ------------------
  135|  7.14M|            const int px_have = imin(sz, (h - y) << 2);
  136|       |
  137|  85.7M|            for (int i = 0; i < px_have; i++)
  ------------------
  |  Branch (137:29): [True: 78.6M, False: 7.14M]
  ------------------
  138|  78.6M|                left[sz - 1 - i] = dst[PXSTRIDE(stride) * i - 1];
  139|  7.14M|            if (px_have < sz)
  ------------------
  |  Branch (139:17): [True: 283k, False: 6.86M]
  ------------------
  140|   283k|                pixel_set(left, left[sz - px_have], sz - px_have);
  141|  7.14M|        } else {
  142|  45.8k|            pixel_set(left, have_top ? *dst_top : ((1 << bitdepth) >> 1) + 1, sz);
  ------------------
  |  Branch (142:29): [True: 37.2k, False: 8.54k]
  ------------------
  143|  45.8k|        }
  144|       |
  145|  7.19M|        if (av1_intra_prediction_edges[mode].needs_bottomleft) {
  ------------------
  |  Branch (145:13): [True: 278k, False: 6.91M]
  ------------------
  146|   278k|            const int have_bottomleft = (!have_left || y + th >= h) ? 0 :
  ------------------
  |  Branch (146:42): [True: 0, False: 278k]
  |  Branch (146:56): [True: 83.7k, False: 194k]
  ------------------
  147|   278k|                                        (edge_flags & EDGE_I444_LEFT_HAS_BOTTOM);
  148|       |
  149|   278k|            if (have_bottomleft) {
  ------------------
  |  Branch (149:17): [True: 87.8k, False: 190k]
  ------------------
  150|  87.8k|                const int px_have = imin(sz, (h - y - th) << 2);
  151|       |
  152|  1.03M|                for (int i = 0; i < px_have; i++)
  ------------------
  |  Branch (152:33): [True: 944k, False: 87.8k]
  ------------------
  153|   944k|                    left[-(i + 1)] = dst[(sz + i) * PXSTRIDE(stride) - 1];
  154|  87.8k|                if (px_have < sz)
  ------------------
  |  Branch (154:21): [True: 5.65k, False: 82.1k]
  ------------------
  155|  5.65k|                    pixel_set(left - sz, left[-px_have], sz - px_have);
  156|   190k|            } else {
  157|   190k|                pixel_set(left - sz, left[0], sz);
  158|   190k|            }
  159|   278k|        }
  160|  7.19M|    }
  161|       |
  162|  7.92M|    if (av1_intra_prediction_edges[mode].needs_top) {
  ------------------
  |  Branch (162:9): [True: 6.47M, False: 1.45M]
  ------------------
  163|  6.47M|        const int sz = tw << 2;
  164|  6.47M|        pixel *const top = &topleft_out[1];
  165|       |
  166|  6.47M|        if (have_top) {
  ------------------
  |  Branch (166:13): [True: 5.96M, False: 504k]
  ------------------
  167|  5.96M|            const int px_have = imin(sz, (w - x) << 2);
  168|  5.96M|            pixel_copy(top, dst_top, px_have);
  ------------------
  |  |   65|  5.96M|#define pixel_copy(a, b, c) memcpy(a, b, (c) << 1)
  ------------------
  169|  5.96M|            if (px_have < sz)
  ------------------
  |  Branch (169:17): [True: 182k, False: 5.78M]
  ------------------
  170|   182k|                pixel_set(top + px_have, top[px_have - 1], sz - px_have);
  171|  5.96M|        } else {
  172|   504k|            pixel_set(top, have_left ? dst[-1] : ((1 << bitdepth) >> 1) - 1, sz);
  ------------------
  |  Branch (172:28): [True: 494k, False: 9.21k]
  ------------------
  173|   504k|        }
  174|       |
  175|  6.47M|        if (av1_intra_prediction_edges[mode].needs_topright) {
  ------------------
  |  Branch (175:13): [True: 170k, False: 6.30M]
  ------------------
  176|   170k|            const int have_topright = (!have_top || x + tw >= w) ? 0 :
  ------------------
  |  Branch (176:40): [True: 0, False: 170k]
  |  Branch (176:53): [True: 4.36k, False: 165k]
  ------------------
  177|   170k|                                      (edge_flags & EDGE_I444_TOP_HAS_RIGHT);
  178|       |
  179|   170k|            if (have_topright) {
  ------------------
  |  Branch (179:17): [True: 93.2k, False: 76.9k]
  ------------------
  180|  93.2k|                const int px_have = imin(sz, (w - x - tw) << 2);
  181|       |
  182|  93.2k|                pixel_copy(top + sz, &dst_top[sz], px_have);
  ------------------
  |  |   65|  93.2k|#define pixel_copy(a, b, c) memcpy(a, b, (c) << 1)
  ------------------
  183|  93.2k|                if (px_have < sz)
  ------------------
  |  Branch (183:21): [True: 750, False: 92.5k]
  ------------------
  184|    750|                    pixel_set(top + sz + px_have, top[sz + px_have - 1],
  185|    750|                              sz - px_have);
  186|  93.2k|            } else {
  187|  76.9k|                pixel_set(top + sz, top[sz - 1], sz);
  188|  76.9k|            }
  189|   170k|        }
  190|  6.47M|    }
  191|       |
  192|  7.92M|    if (av1_intra_prediction_edges[mode].needs_topleft) {
  ------------------
  |  Branch (192:9): [True: 2.01M, False: 5.91M]
  ------------------
  193|  2.01M|        if (have_left)
  ------------------
  |  Branch (193:13): [True: 1.99M, False: 21.6k]
  ------------------
  194|  1.99M|            *topleft_out = have_top ? dst_top[-1] : dst[-1];
  ------------------
  |  Branch (194:28): [True: 1.72M, False: 264k]
  ------------------
  195|  21.6k|        else
  196|  21.6k|            *topleft_out = have_top ? *dst_top : (1 << bitdepth) >> 1;
  ------------------
  |  Branch (196:28): [True: 20.1k, False: 1.40k]
  ------------------
  197|       |
  198|  2.01M|        if (mode == Z2_PRED && tw + th >= 6 && filter_edge)
  ------------------
  |  Branch (198:13): [True: 499k, False: 1.51M]
  |  Branch (198:32): [True: 225k, False: 273k]
  |  Branch (198:48): [True: 57.8k, False: 167k]
  ------------------
  199|  57.8k|            *topleft_out = ((topleft_out[-1] + topleft_out[1]) * 5 +
  200|  57.8k|                            topleft_out[0] * 6 + 8) >> 4;
  201|  2.01M|    }
  202|       |
  203|  7.92M|    return mode;
  204|  7.92M|}

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

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

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

dav1d_copy_lpf_8bpc:
  106|  33.0k|{
  107|  33.0k|    const int have_tt = f->c->n_tc > 1;
  108|  33.0k|    const int resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
  109|  33.0k|    const int offset = 8 * !!sby;
  110|  33.0k|    const ptrdiff_t *const src_stride = f->cur.stride;
  111|  33.0k|    const ptrdiff_t *const lr_stride = f->sr_cur.p.stride;
  112|  33.0k|    const int tt_off = have_tt * sby * (4 << f->seq_hdr->sb128);
  113|  33.0k|    pixel *const dst[3] = {
  114|  33.0k|        f->lf.lr_lpf_line[0] + tt_off * PXSTRIDE(lr_stride[0]),
  ------------------
  |  |   53|  33.0k|#define PXSTRIDE(x) (x)
  ------------------
  115|  33.0k|        f->lf.lr_lpf_line[1] + tt_off * PXSTRIDE(lr_stride[1]),
  ------------------
  |  |   53|  33.0k|#define PXSTRIDE(x) (x)
  ------------------
  116|  33.0k|        f->lf.lr_lpf_line[2] + tt_off * PXSTRIDE(lr_stride[1])
  ------------------
  |  |   53|  33.0k|#define PXSTRIDE(x) (x)
  ------------------
  117|  33.0k|    };
  118|       |
  119|       |    // TODO Also check block level restore type to reduce copying.
  120|  33.0k|    const int restore_planes = f->lf.restore_planes;
  121|  33.0k|    const int cdef_planes = f->lf.cdef_planes;
  122|       |
  123|  33.0k|    if ((cdef_planes & 1) || (restore_planes & LR_RESTORE_Y)) {
  ------------------
  |  Branch (123:9): [True: 19.0k, False: 14.0k]
  |  Branch (123:30): [True: 8.71k, False: 5.31k]
  ------------------
  124|  27.7k|        const int h = f->cur.p.h;
  125|  27.7k|        const int w = f->bw << 2;
  126|  27.7k|        const int row_h = imin((sby + 1) << (6 + f->seq_hdr->sb128), h - 1);
  127|  27.7k|        const int y_stripe = (sby << (6 + f->seq_hdr->sb128)) - offset;
  128|  27.7k|        if (restore_planes & LR_RESTORE_Y || !resize)
  ------------------
  |  Branch (128:13): [True: 25.6k, False: 2.07k]
  |  Branch (128:46): [True: 1.29k, False: 777]
  ------------------
  129|  26.9k|            backup_lpf(f, dst[0], lr_stride[0],
  130|  26.9k|                       src[0] - offset * PXSTRIDE(src_stride[0]), src_stride[0],
  ------------------
  |  |   53|  26.9k|#define PXSTRIDE(x) (x)
  ------------------
  131|  26.9k|                       0, f->seq_hdr->sb128, y_stripe, row_h, w, h, 0, 1);
  132|  27.7k|        if (have_tt && resize && (cdef_planes & 1)) {
  ------------------
  |  Branch (132:13): [True: 0, False: 27.7k]
  |  Branch (132:24): [True: 0, False: 0]
  |  Branch (132:34): [True: 0, False: 0]
  ------------------
  133|      0|            const ptrdiff_t cdef_off_y = sby * 4 * PXSTRIDE(src_stride[0]);
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
  134|      0|            backup_lpf(f, f->lf.cdef_lpf_line[0] + cdef_off_y, src_stride[0],
  135|      0|                       src[0] - offset * PXSTRIDE(src_stride[0]), src_stride[0],
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
  136|      0|                       0, f->seq_hdr->sb128, y_stripe, row_h, w, h, 0, 0);
  137|      0|        }
  138|  27.7k|    }
  139|  33.0k|    if (((cdef_planes & 2) || (restore_planes & (LR_RESTORE_U | LR_RESTORE_V))) &&
  ------------------
  |  Branch (139:10): [True: 5.34k, False: 27.7k]
  |  Branch (139:31): [True: 7.97k, False: 19.7k]
  ------------------
  140|  13.3k|        f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400)
  ------------------
  |  Branch (140:9): [True: 13.3k, False: 0]
  ------------------
  141|  13.3k|    {
  142|  13.3k|        const int ss_ver = f->sr_cur.p.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  143|  13.3k|        const int ss_hor = f->sr_cur.p.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  144|  13.3k|        const int h = (f->cur.p.h + ss_ver) >> ss_ver;
  145|  13.3k|        const int w = f->bw << (2 - ss_hor);
  146|  13.3k|        const int row_h = imin((sby + 1) << ((6 - ss_ver) + f->seq_hdr->sb128), h - 1);
  147|  13.3k|        const int offset_uv = offset >> ss_ver;
  148|  13.3k|        const int y_stripe = (sby << ((6 - ss_ver) + f->seq_hdr->sb128)) - offset_uv;
  149|  13.3k|        const ptrdiff_t cdef_off_uv = sby * 4 * PXSTRIDE(src_stride[1]);
  ------------------
  |  |   53|  13.3k|#define PXSTRIDE(x) (x)
  ------------------
  150|  13.3k|        if ((cdef_planes & 2) || (restore_planes & LR_RESTORE_U)) {
  ------------------
  |  Branch (150:13): [True: 5.34k, False: 7.97k]
  |  Branch (150:34): [True: 3.42k, False: 4.54k]
  ------------------
  151|  8.77k|            if (restore_planes & LR_RESTORE_U || !resize)
  ------------------
  |  Branch (151:17): [True: 4.60k, False: 4.16k]
  |  Branch (151:50): [True: 3.95k, False: 213]
  ------------------
  152|  8.56k|                backup_lpf(f, dst[1], lr_stride[1],
  153|  8.56k|                           src[1] - offset_uv * PXSTRIDE(src_stride[1]),
  ------------------
  |  |   53|  8.56k|#define PXSTRIDE(x) (x)
  ------------------
  154|  8.56k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  155|  8.56k|                           row_h, w, h, ss_hor, 1);
  156|  8.77k|            if (have_tt && resize && (cdef_planes & 2))
  ------------------
  |  Branch (156:17): [True: 0, False: 8.77k]
  |  Branch (156:28): [True: 0, False: 0]
  |  Branch (156:38): [True: 0, False: 0]
  ------------------
  157|      0|                backup_lpf(f, f->lf.cdef_lpf_line[1] + cdef_off_uv, src_stride[1],
  158|      0|                           src[1] - offset_uv * PXSTRIDE(src_stride[1]),
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
  159|      0|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  160|      0|                           row_h, w, h, ss_hor, 0);
  161|  8.77k|        }
  162|  13.3k|        if ((cdef_planes & 2) || (restore_planes & LR_RESTORE_V)) {
  ------------------
  |  Branch (162:13): [True: 5.34k, False: 7.97k]
  |  Branch (162:34): [True: 5.77k, False: 2.19k]
  ------------------
  163|  11.1k|            if (restore_planes & LR_RESTORE_V || !resize)
  ------------------
  |  Branch (163:17): [True: 10.1k, False: 1.01k]
  |  Branch (163:50): [True: 788, False: 231]
  ------------------
  164|  10.8k|                backup_lpf(f, dst[2], lr_stride[1],
  165|  10.8k|                           src[2] - offset_uv * PXSTRIDE(src_stride[1]),
  ------------------
  |  |   53|  10.8k|#define PXSTRIDE(x) (x)
  ------------------
  166|  10.8k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  167|  10.8k|                           row_h, w, h, ss_hor, 1);
  168|  11.1k|            if (have_tt && resize && (cdef_planes & 2))
  ------------------
  |  Branch (168:17): [True: 0, False: 11.1k]
  |  Branch (168:28): [True: 0, False: 0]
  |  Branch (168:38): [True: 0, False: 0]
  ------------------
  169|      0|                backup_lpf(f, f->lf.cdef_lpf_line[2] + cdef_off_uv, src_stride[1],
  170|      0|                           src[2] - offset_uv * PXSTRIDE(src_stride[1]),
  ------------------
  |  |   53|      0|#define PXSTRIDE(x) (x)
  ------------------
  171|      0|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  172|      0|                           row_h, w, h, ss_hor, 0);
  173|  11.1k|        }
  174|  13.3k|    }
  175|  33.0k|}
dav1d_loopfilter_sbrow_cols_8bpc:
  315|  38.7k|{
  316|  38.7k|    int x, have_left;
  317|       |    // Don't filter outside the frame
  318|  38.7k|    const int is_sb64 = !f->seq_hdr->sb128;
  319|  38.7k|    const int starty4 = (sby & is_sb64) << 4;
  320|  38.7k|    const int sbsz = 32 >> is_sb64;
  321|  38.7k|    const int sbl2 = 5 - is_sb64;
  322|  38.7k|    const int halign = (f->bh + 31) & ~31;
  323|  38.7k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  324|  38.7k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  325|  38.7k|    const int vmask = 16 >> ss_ver, hmask = 16 >> ss_hor;
  326|  38.7k|    const unsigned vmax = 1U << vmask, hmax = 1U << hmask;
  327|  38.7k|    const unsigned endy4 = starty4 + imin(f->h4 - sby * sbsz, sbsz);
  328|  38.7k|    const unsigned uv_endy4 = (endy4 + ss_ver) >> ss_ver;
  329|       |
  330|       |    // fix lpf strength at tile col boundaries
  331|  38.7k|    const uint8_t *lpf_y = &f->lf.tx_lpf_right_edge[0][sby << sbl2];
  332|  38.7k|    const uint8_t *lpf_uv = &f->lf.tx_lpf_right_edge[1][sby << (sbl2 - ss_ver)];
  333|  40.3k|    for (int tile_col = 1;; tile_col++) {
  334|  40.3k|        x = f->frame_hdr->tiling.col_start_sb[tile_col];
  335|  40.3k|        if ((x << sbl2) >= f->bw) break;
  ------------------
  |  Branch (335:13): [True: 38.7k, False: 1.58k]
  ------------------
  336|  1.58k|        const int bx4 = x & is_sb64 ? 16 : 0, cbx4 = bx4 >> ss_hor;
  ------------------
  |  Branch (336:25): [True: 975, False: 611]
  ------------------
  337|  1.58k|        x >>= is_sb64;
  338|       |
  339|  1.58k|        uint16_t (*const y_hmask)[2] = lflvl[x].filter_y[0][bx4];
  340|  35.2k|        for (unsigned y = starty4, mask = 1 << y; y < endy4; y++, mask <<= 1) {
  ------------------
  |  Branch (340:51): [True: 33.7k, False: 1.58k]
  ------------------
  341|  33.7k|            const int sidx = mask >= 0x10000U;
  342|  33.7k|            const unsigned smask = mask >> (sidx << 4);
  343|  33.7k|            const int idx = 2 * !!(y_hmask[2][sidx] & smask) +
  344|  33.7k|                                !!(y_hmask[1][sidx] & smask);
  345|  33.7k|            y_hmask[2][sidx] &= ~smask;
  346|  33.7k|            y_hmask[1][sidx] &= ~smask;
  347|  33.7k|            y_hmask[0][sidx] &= ~smask;
  348|  33.7k|            y_hmask[imin(idx, lpf_y[y - starty4])][sidx] |= smask;
  349|  33.7k|        }
  350|       |
  351|  1.58k|        if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (351:13): [True: 380, False: 1.20k]
  ------------------
  352|    380|            uint16_t (*const uv_hmask)[2] = lflvl[x].filter_uv[0][cbx4];
  353|  4.74k|            for (unsigned y = starty4 >> ss_ver, uv_mask = 1 << y; y < uv_endy4;
  ------------------
  |  Branch (353:68): [True: 4.36k, False: 380]
  ------------------
  354|  4.36k|                 y++, uv_mask <<= 1)
  355|  4.36k|            {
  356|  4.36k|                const int sidx = uv_mask >= vmax;
  357|  4.36k|                const unsigned smask = uv_mask >> (sidx << (4 - ss_ver));
  358|  4.36k|                const int idx = !!(uv_hmask[1][sidx] & smask);
  359|  4.36k|                uv_hmask[1][sidx] &= ~smask;
  360|  4.36k|                uv_hmask[0][sidx] &= ~smask;
  361|  4.36k|                uv_hmask[imin(idx, lpf_uv[y - (starty4 >> ss_ver)])][sidx] |= smask;
  362|  4.36k|            }
  363|    380|        }
  364|  1.58k|        lpf_y  += halign;
  365|  1.58k|        lpf_uv += halign >> ss_ver;
  366|  1.58k|    }
  367|       |
  368|       |    // fix lpf strength at tile row boundaries
  369|  38.7k|    if (start_of_tile_row) {
  ------------------
  |  Branch (369:9): [True: 337, False: 38.3k]
  ------------------
  370|    337|        const BlockContext *a;
  371|    337|        for (x = 0, a = &f->a[f->sb128w * (start_of_tile_row - 1)];
  372|  1.60k|             x < f->sb128w; x++, a++)
  ------------------
  |  Branch (372:14): [True: 1.26k, False: 337]
  ------------------
  373|  1.26k|        {
  374|  1.26k|            uint16_t (*const y_vmask)[2] = lflvl[x].filter_y[1][starty4];
  375|  1.26k|            const unsigned w = imin(32, f->w4 - (x << 5));
  376|  35.4k|            for (unsigned mask = 1, i = 0; i < w; mask <<= 1, i++) {
  ------------------
  |  Branch (376:44): [True: 34.1k, False: 1.26k]
  ------------------
  377|  34.1k|                const int sidx = mask >= 0x10000U;
  378|  34.1k|                const unsigned smask = mask >> (sidx << 4);
  379|  34.1k|                const int idx = 2 * !!(y_vmask[2][sidx] & smask) +
  380|  34.1k|                                    !!(y_vmask[1][sidx] & smask);
  381|  34.1k|                y_vmask[2][sidx] &= ~smask;
  382|  34.1k|                y_vmask[1][sidx] &= ~smask;
  383|  34.1k|                y_vmask[0][sidx] &= ~smask;
  384|  34.1k|                y_vmask[imin(idx, a->tx_lpf_y[i])][sidx] |= smask;
  385|  34.1k|            }
  386|       |
  387|  1.26k|            if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (387:17): [True: 918, False: 346]
  ------------------
  388|    918|                const unsigned cw = (w + ss_hor) >> ss_hor;
  389|    918|                uint16_t (*const uv_vmask)[2] = lflvl[x].filter_uv[1][starty4 >> ss_ver];
  390|  23.7k|                for (unsigned uv_mask = 1, i = 0; i < cw; uv_mask <<= 1, i++) {
  ------------------
  |  Branch (390:51): [True: 22.7k, False: 918]
  ------------------
  391|  22.7k|                    const int sidx = uv_mask >= hmax;
  392|  22.7k|                    const unsigned smask = uv_mask >> (sidx << (4 - ss_hor));
  393|  22.7k|                    const int idx = !!(uv_vmask[1][sidx] & smask);
  394|  22.7k|                    uv_vmask[1][sidx] &= ~smask;
  395|  22.7k|                    uv_vmask[0][sidx] &= ~smask;
  396|  22.7k|                    uv_vmask[imin(idx, a->tx_lpf_uv[i])][sidx] |= smask;
  397|  22.7k|                }
  398|    918|            }
  399|  1.26k|        }
  400|    337|    }
  401|       |
  402|  38.7k|    pixel *ptr;
  403|  38.7k|    uint8_t (*level_ptr)[2] = f->lf.level[0] + f->b4_stride * sby * sbsz;
  404|  85.4k|    for (ptr = p[0], have_left = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (404:44): [True: 46.7k, False: 38.7k]
  ------------------
  405|  46.7k|         x++, have_left = 1, ptr += 128, level_ptr += 32)
  406|  46.7k|    {
  407|  46.7k|        filter_plane_cols_y(f, have_left, level_ptr, f->b4_stride,
  408|  46.7k|                            lflvl[x].filter_y[0], ptr, f->cur.stride[0],
  409|  46.7k|                            imin(32, f->w4 - x * 32), starty4, endy4);
  410|  46.7k|    }
  411|       |
  412|  38.7k|    if (!f->frame_hdr->loopfilter.level_u && !f->frame_hdr->loopfilter.level_v)
  ------------------
  |  Branch (412:9): [True: 25.8k, False: 12.9k]
  |  Branch (412:46): [True: 23.4k, False: 2.40k]
  ------------------
  413|  23.4k|        return;
  414|       |
  415|  15.3k|    ptrdiff_t uv_off;
  416|  15.3k|    level_ptr = f->lf.level[1] + f->b4_stride * (sby * sbsz >> ss_ver);
  417|  34.1k|    for (uv_off = 0, have_left = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (417:44): [True: 18.8k, False: 15.3k]
  ------------------
  418|  18.8k|         x++, have_left = 1, uv_off += 128 >> ss_hor, level_ptr += 32 >> ss_hor)
  419|  18.8k|    {
  420|  18.8k|        filter_plane_cols_uv(f, have_left, level_ptr, f->b4_stride,
  421|  18.8k|                             lflvl[x].filter_uv[0],
  422|  18.8k|                             &p[1][uv_off], &p[2][uv_off], f->cur.stride[1],
  423|  18.8k|                             (imin(32, f->w4 - x * 32) + ss_hor) >> ss_hor,
  424|  18.8k|                             starty4 >> ss_ver, uv_endy4, ss_ver);
  425|  18.8k|    }
  426|  15.3k|}
dav1d_loopfilter_sbrow_rows_8bpc:
  431|  38.7k|{
  432|  38.7k|    int x;
  433|       |    // Don't filter outside the frame
  434|  38.7k|    const int have_top = sby > 0;
  435|  38.7k|    const int is_sb64 = !f->seq_hdr->sb128;
  436|  38.7k|    const int starty4 = (sby & is_sb64) << 4;
  437|  38.7k|    const int sbsz = 32 >> is_sb64;
  438|  38.7k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  439|  38.7k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  440|  38.7k|    const unsigned endy4 = starty4 + imin(f->h4 - sby * sbsz, sbsz);
  441|  38.7k|    const unsigned uv_endy4 = (endy4 + ss_ver) >> ss_ver;
  442|       |
  443|  38.7k|    pixel *ptr;
  444|  38.7k|    uint8_t (*level_ptr)[2] = f->lf.level[0] + f->b4_stride * sby * sbsz;
  445|  85.4k|    for (ptr = p[0], x = 0; x < f->sb128w; x++, ptr += 128, level_ptr += 32) {
  ------------------
  |  Branch (445:29): [True: 46.7k, False: 38.7k]
  ------------------
  446|  46.7k|        filter_plane_rows_y(f, have_top, level_ptr, f->b4_stride,
  447|  46.7k|                            lflvl[x].filter_y[1], ptr, f->cur.stride[0],
  448|  46.7k|                            imin(32, f->w4 - x * 32), starty4, endy4);
  449|  46.7k|    }
  450|       |
  451|  38.7k|    if (!f->frame_hdr->loopfilter.level_u && !f->frame_hdr->loopfilter.level_v)
  ------------------
  |  Branch (451:9): [True: 25.8k, False: 12.9k]
  |  Branch (451:46): [True: 23.4k, False: 2.40k]
  ------------------
  452|  23.4k|        return;
  453|       |
  454|  15.3k|    ptrdiff_t uv_off;
  455|  15.3k|    level_ptr = f->lf.level[1] + f->b4_stride * (sby * sbsz >> ss_ver);
  456|  34.1k|    for (uv_off = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (456:29): [True: 18.8k, False: 15.3k]
  ------------------
  457|  18.8k|         x++, uv_off += 128 >> ss_hor, level_ptr += 32 >> ss_hor)
  458|  18.8k|    {
  459|  18.8k|        filter_plane_rows_uv(f, have_top, level_ptr, f->b4_stride,
  460|  18.8k|                             lflvl[x].filter_uv[1],
  461|  18.8k|                             &p[1][uv_off], &p[2][uv_off], f->cur.stride[1],
  462|  18.8k|                             (imin(32, f->w4 - x * 32) + ss_hor) >> ss_hor,
  463|  18.8k|                             starty4 >> ss_ver, uv_endy4, ss_hor);
  464|  18.8k|    }
  465|  15.3k|}
lf_apply_tmpl.c:backup_lpf:
   47|  70.4k|{
   48|  70.4k|    const int cdef_backup = !lr_backup;
   49|  70.4k|    const int dst_w = f->frame_hdr->super_res.enabled ?
  ------------------
  |  Branch (49:23): [True: 17.8k, False: 52.6k]
  ------------------
   50|  52.6k|                      (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|  70.4k|    int stripe_h = ((64 << (cdef_backup & sb128)) - 8 * !row) >> ss_ver;
   54|  70.4k|    src += (stripe_h - 2) * PXSTRIDE(src_stride);
  ------------------
  |  |   53|  70.4k|#define PXSTRIDE(x) (x)
  ------------------
   55|       |
   56|  70.4k|    if (f->c->n_tc == 1) {
  ------------------
  |  Branch (56:9): [True: 70.4k, False: 0]
  ------------------
   57|  70.4k|        if (row) {
  ------------------
  |  Branch (57:13): [True: 54.8k, False: 15.6k]
  ------------------
   58|  54.8k|            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|  54.8k|            pixel_copy(&dst[PXSTRIDE(dst_stride) *  0],
  ------------------
  |  |   47|  54.8k|#define pixel_copy memcpy
  ------------------
                          pixel_copy(&dst[PXSTRIDE(dst_stride) *  0],
  ------------------
  |  |   53|  54.8k|#define PXSTRIDE(x) (x)
  ------------------
   62|  54.8k|                       &dst[PXSTRIDE(dst_stride) *  top],      dst_w);
  ------------------
  |  |   53|  54.8k|#define PXSTRIDE(x) (x)
  ------------------
   63|  54.8k|            pixel_copy(&dst[PXSTRIDE(dst_stride) *  1],
  ------------------
  |  |   47|  54.8k|#define pixel_copy memcpy
  ------------------
                          pixel_copy(&dst[PXSTRIDE(dst_stride) *  1],
  ------------------
  |  |   53|  54.8k|#define PXSTRIDE(x) (x)
  ------------------
   64|  54.8k|                       &dst[PXSTRIDE(dst_stride) * (top + 1)], dst_w);
  ------------------
  |  |   53|  54.8k|#define PXSTRIDE(x) (x)
  ------------------
   65|  54.8k|            pixel_copy(&dst[PXSTRIDE(dst_stride) *  2],
  ------------------
  |  |   47|  54.8k|#define pixel_copy memcpy
  ------------------
                          pixel_copy(&dst[PXSTRIDE(dst_stride) *  2],
  ------------------
  |  |   53|  54.8k|#define PXSTRIDE(x) (x)
  ------------------
   66|  54.8k|                       &dst[PXSTRIDE(dst_stride) * (top + 2)], dst_w);
  ------------------
  |  |   53|  54.8k|#define PXSTRIDE(x) (x)
  ------------------
   67|  54.8k|            pixel_copy(&dst[PXSTRIDE(dst_stride) *  3],
  ------------------
  |  |   47|  54.8k|#define pixel_copy memcpy
  ------------------
                          pixel_copy(&dst[PXSTRIDE(dst_stride) *  3],
  ------------------
  |  |   53|  54.8k|#define PXSTRIDE(x) (x)
  ------------------
   68|  54.8k|                       &dst[PXSTRIDE(dst_stride) * (top + 3)], dst_w);
  ------------------
  |  |   53|  54.8k|#define PXSTRIDE(x) (x)
  ------------------
   69|  54.8k|        }
   70|  70.4k|        dst += 4 * PXSTRIDE(dst_stride);
  ------------------
  |  |   53|  70.4k|#define PXSTRIDE(x) (x)
  ------------------
   71|  70.4k|    }
   72|       |
   73|  70.4k|    if (lr_backup && (f->frame_hdr->width[0] != f->frame_hdr->width[1])) {
  ------------------
  |  Branch (73:9): [True: 70.4k, False: 0]
  |  Branch (73:22): [True: 17.3k, False: 53.1k]
  ------------------
   74|  37.7k|        while (row + stripe_h <= row_h) {
  ------------------
  |  Branch (74:16): [True: 20.4k, False: 17.3k]
  ------------------
   75|  20.4k|            const int n_lines = 4 - (row + stripe_h + 1 == h);
   76|  20.4k|            f->dsp->mc.resize(dst, dst_stride, src, src_stride,
   77|  20.4k|                              dst_w, n_lines, src_w, f->resize_step[ss_hor],
   78|  20.4k|                              f->resize_start[ss_hor] HIGHBD_CALL_SUFFIX);
   79|  20.4k|            row += stripe_h; // unmodified stripe_h for the 1st stripe
   80|  20.4k|            stripe_h = 64 >> ss_ver;
   81|  20.4k|            src += stripe_h * PXSTRIDE(src_stride);
  ------------------
  |  |   53|  20.4k|#define PXSTRIDE(x) (x)
  ------------------
   82|  20.4k|            dst += n_lines * PXSTRIDE(dst_stride);
  ------------------
  |  |   53|  20.4k|#define PXSTRIDE(x) (x)
  ------------------
   83|  20.4k|            if (n_lines == 3) {
  ------------------
  |  Branch (83:17): [True: 1.37k, False: 19.0k]
  ------------------
   84|  1.37k|                pixel_copy(dst, &dst[-PXSTRIDE(dst_stride)], dst_w);
  ------------------
  |  |   47|  1.37k|#define pixel_copy memcpy
  ------------------
                              pixel_copy(dst, &dst[-PXSTRIDE(dst_stride)], dst_w);
  ------------------
  |  |   53|  1.37k|#define PXSTRIDE(x) (x)
  ------------------
   85|  1.37k|                dst += PXSTRIDE(dst_stride);
  ------------------
  |  |   53|  1.37k|#define PXSTRIDE(x) (x)
  ------------------
   86|  1.37k|            }
   87|  20.4k|        }
   88|  53.1k|    } else {
   89|   109k|        while (row + stripe_h <= row_h) {
  ------------------
  |  Branch (89:16): [True: 56.6k, False: 53.1k]
  ------------------
   90|  56.6k|            const int n_lines = 4 - (row + stripe_h + 1 == h);
   91|   283k|            for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (91:29): [True: 226k, False: 56.6k]
  ------------------
   92|   226k|                pixel_copy(dst, i == n_lines ? &dst[-PXSTRIDE(dst_stride)] :
  ------------------
  |  |   47|   226k|#define pixel_copy memcpy
  ------------------
                              pixel_copy(dst, i == n_lines ? &dst[-PXSTRIDE(dst_stride)] :
  ------------------
  |  |   53|    214|#define PXSTRIDE(x) (x)
  ------------------
  |  Branch (92:33): [True: 214, False: 226k]
  ------------------
   93|   226k|                                               src, src_w);
   94|   226k|                dst += PXSTRIDE(dst_stride);
  ------------------
  |  |   53|   226k|#define PXSTRIDE(x) (x)
  ------------------
   95|   226k|                src += PXSTRIDE(src_stride);
  ------------------
  |  |   53|   226k|#define PXSTRIDE(x) (x)
  ------------------
   96|   226k|            }
   97|  56.6k|            row += stripe_h; // unmodified stripe_h for the 1st stripe
   98|  56.6k|            stripe_h = 64 >> ss_ver;
   99|  56.6k|            src += (stripe_h - 4) * PXSTRIDE(src_stride);
  ------------------
  |  |   53|  56.6k|#define PXSTRIDE(x) (x)
  ------------------
  100|  56.6k|        }
  101|  53.1k|    }
  102|  70.4k|}
lf_apply_tmpl.c:filter_plane_cols_y:
  185|  92.0k|{
  186|  92.0k|    const Dav1dDSPContext *const dsp = f->dsp;
  187|  92.0k|    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|  2.28M|    for (int x = 0; x < w; x++) {
  ------------------
  |  Branch (190:21): [True: 2.19M, False: 92.0k]
  ------------------
  191|  2.19M|        if (!have_left && !x) continue;
  ------------------
  |  Branch (191:13): [True: 1.44M, False: 753k]
  |  Branch (191:27): [True: 67.7k, False: 1.37M]
  ------------------
  192|  2.12M|        uint32_t hmask[4];
  193|  2.12M|        if (!starty4) {
  ------------------
  |  Branch (193:13): [True: 1.76M, False: 364k]
  ------------------
  194|  1.76M|            hmask[0] = mask[x][0][0];
  195|  1.76M|            hmask[1] = mask[x][1][0];
  196|  1.76M|            hmask[2] = mask[x][2][0];
  197|  1.76M|            if (endy4 > 16) {
  ------------------
  |  Branch (197:17): [True: 1.28M, False: 472k]
  ------------------
  198|  1.28M|                hmask[0] |= (unsigned) mask[x][0][1] << 16;
  199|  1.28M|                hmask[1] |= (unsigned) mask[x][1][1] << 16;
  200|  1.28M|                hmask[2] |= (unsigned) mask[x][2][1] << 16;
  201|  1.28M|            }
  202|  1.76M|        } else {
  203|   364k|            hmask[0] = mask[x][0][1];
  204|   364k|            hmask[1] = mask[x][1][1];
  205|   364k|            hmask[2] = mask[x][2][1];
  206|   364k|        }
  207|  2.12M|        hmask[3] = 0;
  208|  2.12M|        loop_filter_sb(&dst[x * 4], ls, hmask, &lvl[x], b4_stride,
  209|  2.12M|                       &f->lf.lim_lut, endy4 - starty4 HIGHBD_CALL_SUFFIX);
  210|  2.12M|    }
  211|  92.0k|}
lf_apply_tmpl.c:filter_plane_cols_uv:
  252|  35.6k|{
  253|  35.6k|    const Dav1dDSPContext *const dsp = f->dsp;
  254|  35.6k|    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|   553k|    for (int x = 0; x < w; x++) {
  ------------------
  |  Branch (257:21): [True: 517k, False: 35.6k]
  ------------------
  258|   517k|        if (!have_left && !x) continue;
  ------------------
  |  Branch (258:13): [True: 371k, False: 145k]
  |  Branch (258:27): [True: 29.3k, False: 342k]
  ------------------
  259|   488k|        uint32_t hmask[3];
  260|   488k|        if (!starty4) {
  ------------------
  |  Branch (260:13): [True: 435k, False: 52.5k]
  ------------------
  261|   435k|            hmask[0] = mask[x][0][0];
  262|   435k|            hmask[1] = mask[x][1][0];
  263|   435k|            if (endy4 > (16 >> ss_ver)) {
  ------------------
  |  Branch (263:17): [True: 350k, False: 84.7k]
  ------------------
  264|   350k|                hmask[0] |= (unsigned) mask[x][0][1] << (16 >> ss_ver);
  265|   350k|                hmask[1] |= (unsigned) mask[x][1][1] << (16 >> ss_ver);
  266|   350k|            }
  267|   435k|        } else {
  268|  52.5k|            hmask[0] = mask[x][0][1];
  269|  52.5k|            hmask[1] = mask[x][1][1];
  270|  52.5k|        }
  271|   488k|        hmask[2] = 0;
  272|   488k|        loop_filter_sb(&u[x * 4], ls, hmask, &lvl[x], b4_stride,
  273|   488k|                       &f->lf.lim_lut, endy4 - starty4 HIGHBD_CALL_SUFFIX);
  274|   488k|        loop_filter_sb(&v[x * 4], ls, hmask, (const uint8_t(*)[2]) &lvl[x][1],
  275|   488k|                       b4_stride, &f->lf.lim_lut, endy4 - starty4 HIGHBD_CALL_SUFFIX);
  276|   488k|    }
  277|  35.6k|}
lf_apply_tmpl.c:filter_plane_rows_y:
  221|  92.0k|{
  222|  92.0k|    const Dav1dDSPContext *const dsp = f->dsp;
  223|  92.0k|    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|  2.11M|    for (int y = starty4; y < endy4;
  ------------------
  |  Branch (228:27): [True: 2.02M, False: 92.0k]
  ------------------
  229|  2.02M|         y++, dst += 4 * PXSTRIDE(ls), lvl += b4_stride)
  ------------------
  |  |   53|  2.02M|#define PXSTRIDE(x) (x)
  ------------------
  230|  2.02M|    {
  231|  2.02M|        if (!have_top && !y) continue;
  ------------------
  |  Branch (231:13): [True: 266k, False: 1.75M]
  |  Branch (231:26): [True: 19.6k, False: 246k]
  ------------------
  232|  2.00M|        const uint32_t vmask[4] = {
  233|  2.00M|            mask[y][0][0] | ((unsigned) mask[y][0][1] << 16),
  234|  2.00M|            mask[y][1][0] | ((unsigned) mask[y][1][1] << 16),
  235|  2.00M|            mask[y][2][0] | ((unsigned) mask[y][2][1] << 16),
  236|  2.00M|            0,
  237|  2.00M|        };
  238|  2.00M|        loop_filter_sb(dst, ls, vmask, (const uint8_t(*)[2]) &lvl[0][1],
  239|  2.00M|                       b4_stride, &f->lf.lim_lut, w HIGHBD_CALL_SUFFIX);
  240|  2.00M|    }
  241|  92.0k|}
lf_apply_tmpl.c:filter_plane_rows_uv:
  288|  35.6k|{
  289|  35.6k|    const Dav1dDSPContext *const dsp = f->dsp;
  290|  35.6k|    const loopfilter_sb_fn loop_filter_sb = dsp->lf.loop_filter_sb[1][1];
  291|  35.6k|    ptrdiff_t off_l = 0;
  292|       |
  293|       |    //                                 block1
  294|       |    // filter edges between rows (e.g. ------)
  295|       |    //                                 block2
  296|   615k|    for (int y = starty4; y < endy4;
  ------------------
  |  Branch (296:27): [True: 580k, False: 35.6k]
  ------------------
  297|   580k|         y++, off_l += 4 * PXSTRIDE(ls), lvl += b4_stride)
  ------------------
  |  |   53|   580k|#define PXSTRIDE(x) (x)
  ------------------
  298|   580k|    {
  299|   580k|        if (!have_top && !y) continue;
  ------------------
  |  Branch (299:13): [True: 89.4k, False: 490k]
  |  Branch (299:26): [True: 4.55k, False: 84.8k]
  ------------------
  300|   575k|        const uint32_t vmask[3] = {
  301|   575k|            mask[y][0][0] | ((unsigned) mask[y][0][1] << (16 >> ss_hor)),
  302|   575k|            mask[y][1][0] | ((unsigned) mask[y][1][1] << (16 >> ss_hor)),
  303|   575k|            0,
  304|   575k|        };
  305|   575k|        loop_filter_sb(&u[off_l], ls, vmask, lvl, b4_stride,
  306|   575k|                       &f->lf.lim_lut, w HIGHBD_CALL_SUFFIX);
  307|   575k|        loop_filter_sb(&v[off_l], ls, vmask, (const uint8_t(*)[2]) &lvl[0][1],
  308|   575k|                       b4_stride, &f->lf.lim_lut, w HIGHBD_CALL_SUFFIX);
  309|   575k|    }
  310|  35.6k|}
dav1d_copy_lpf_16bpc:
  106|  15.9k|{
  107|  15.9k|    const int have_tt = f->c->n_tc > 1;
  108|  15.9k|    const int resize = f->frame_hdr->width[0] != f->frame_hdr->width[1];
  109|  15.9k|    const int offset = 8 * !!sby;
  110|  15.9k|    const ptrdiff_t *const src_stride = f->cur.stride;
  111|  15.9k|    const ptrdiff_t *const lr_stride = f->sr_cur.p.stride;
  112|  15.9k|    const int tt_off = have_tt * sby * (4 << f->seq_hdr->sb128);
  113|  15.9k|    pixel *const dst[3] = {
  114|  15.9k|        f->lf.lr_lpf_line[0] + tt_off * PXSTRIDE(lr_stride[0]),
  115|  15.9k|        f->lf.lr_lpf_line[1] + tt_off * PXSTRIDE(lr_stride[1]),
  116|  15.9k|        f->lf.lr_lpf_line[2] + tt_off * PXSTRIDE(lr_stride[1])
  117|  15.9k|    };
  118|       |
  119|       |    // TODO Also check block level restore type to reduce copying.
  120|  15.9k|    const int restore_planes = f->lf.restore_planes;
  121|  15.9k|    const int cdef_planes = f->lf.cdef_planes;
  122|       |
  123|  15.9k|    if ((cdef_planes & 1) || (restore_planes & LR_RESTORE_Y)) {
  ------------------
  |  Branch (123:9): [True: 6.32k, False: 9.62k]
  |  Branch (123:30): [True: 7.48k, False: 2.14k]
  ------------------
  124|  13.8k|        const int h = f->cur.p.h;
  125|  13.8k|        const int w = f->bw << 2;
  126|  13.8k|        const int row_h = imin((sby + 1) << (6 + f->seq_hdr->sb128), h - 1);
  127|  13.8k|        const int y_stripe = (sby << (6 + f->seq_hdr->sb128)) - offset;
  128|  13.8k|        if (restore_planes & LR_RESTORE_Y || !resize)
  ------------------
  |  Branch (128:13): [True: 11.5k, False: 2.25k]
  |  Branch (128:46): [True: 2.09k, False: 153]
  ------------------
  129|  13.6k|            backup_lpf(f, dst[0], lr_stride[0],
  130|  13.6k|                       src[0] - offset * PXSTRIDE(src_stride[0]), src_stride[0],
  131|  13.6k|                       0, f->seq_hdr->sb128, y_stripe, row_h, w, h, 0, 1);
  132|  13.8k|        if (have_tt && resize && (cdef_planes & 1)) {
  ------------------
  |  Branch (132:13): [True: 0, False: 13.8k]
  |  Branch (132:24): [True: 0, False: 0]
  |  Branch (132:34): [True: 0, False: 0]
  ------------------
  133|      0|            const ptrdiff_t cdef_off_y = sby * 4 * PXSTRIDE(src_stride[0]);
  134|      0|            backup_lpf(f, f->lf.cdef_lpf_line[0] + cdef_off_y, src_stride[0],
  135|      0|                       src[0] - offset * PXSTRIDE(src_stride[0]), src_stride[0],
  136|      0|                       0, f->seq_hdr->sb128, y_stripe, row_h, w, h, 0, 0);
  137|      0|        }
  138|  13.8k|    }
  139|  15.9k|    if (((cdef_planes & 2) || (restore_planes & (LR_RESTORE_U | LR_RESTORE_V))) &&
  ------------------
  |  Branch (139:10): [True: 2.40k, False: 13.5k]
  |  Branch (139:31): [True: 4.78k, False: 8.76k]
  ------------------
  140|  7.18k|        f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400)
  ------------------
  |  Branch (140:9): [True: 7.18k, False: 0]
  ------------------
  141|  7.18k|    {
  142|  7.18k|        const int ss_ver = f->sr_cur.p.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  143|  7.18k|        const int ss_hor = f->sr_cur.p.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  144|  7.18k|        const int h = (f->cur.p.h + ss_ver) >> ss_ver;
  145|  7.18k|        const int w = f->bw << (2 - ss_hor);
  146|  7.18k|        const int row_h = imin((sby + 1) << ((6 - ss_ver) + f->seq_hdr->sb128), h - 1);
  147|  7.18k|        const int offset_uv = offset >> ss_ver;
  148|  7.18k|        const int y_stripe = (sby << ((6 - ss_ver) + f->seq_hdr->sb128)) - offset_uv;
  149|  7.18k|        const ptrdiff_t cdef_off_uv = sby * 4 * PXSTRIDE(src_stride[1]);
  150|  7.18k|        if ((cdef_planes & 2) || (restore_planes & LR_RESTORE_U)) {
  ------------------
  |  Branch (150:13): [True: 2.40k, False: 4.78k]
  |  Branch (150:34): [True: 3.36k, False: 1.42k]
  ------------------
  151|  5.76k|            if (restore_planes & LR_RESTORE_U || !resize)
  ------------------
  |  Branch (151:17): [True: 4.25k, False: 1.51k]
  |  Branch (151:50): [True: 1.26k, False: 253]
  ------------------
  152|  5.51k|                backup_lpf(f, dst[1], lr_stride[1],
  153|  5.51k|                           src[1] - offset_uv * PXSTRIDE(src_stride[1]),
  154|  5.51k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  155|  5.51k|                           row_h, w, h, ss_hor, 1);
  156|  5.76k|            if (have_tt && resize && (cdef_planes & 2))
  ------------------
  |  Branch (156:17): [True: 0, False: 5.76k]
  |  Branch (156:28): [True: 0, False: 0]
  |  Branch (156:38): [True: 0, False: 0]
  ------------------
  157|      0|                backup_lpf(f, f->lf.cdef_lpf_line[1] + cdef_off_uv, src_stride[1],
  158|      0|                           src[1] - offset_uv * PXSTRIDE(src_stride[1]),
  159|      0|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  160|      0|                           row_h, w, h, ss_hor, 0);
  161|  5.76k|        }
  162|  7.18k|        if ((cdef_planes & 2) || (restore_planes & LR_RESTORE_V)) {
  ------------------
  |  Branch (162:13): [True: 2.40k, False: 4.78k]
  |  Branch (162:34): [True: 2.67k, False: 2.10k]
  ------------------
  163|  5.08k|            if (restore_planes & LR_RESTORE_V || !resize)
  ------------------
  |  Branch (163:17): [True: 3.62k, False: 1.45k]
  |  Branch (163:50): [True: 1.21k, False: 243]
  ------------------
  164|  4.84k|                backup_lpf(f, dst[2], lr_stride[1],
  165|  4.84k|                           src[2] - offset_uv * PXSTRIDE(src_stride[1]),
  166|  4.84k|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  167|  4.84k|                           row_h, w, h, ss_hor, 1);
  168|  5.08k|            if (have_tt && resize && (cdef_planes & 2))
  ------------------
  |  Branch (168:17): [True: 0, False: 5.08k]
  |  Branch (168:28): [True: 0, False: 0]
  |  Branch (168:38): [True: 0, False: 0]
  ------------------
  169|      0|                backup_lpf(f, f->lf.cdef_lpf_line[2] + cdef_off_uv, src_stride[1],
  170|      0|                           src[2] - offset_uv * PXSTRIDE(src_stride[1]),
  171|      0|                           src_stride[1], ss_ver, f->seq_hdr->sb128, y_stripe,
  172|      0|                           row_h, w, h, ss_hor, 0);
  173|  5.08k|        }
  174|  7.18k|    }
  175|  15.9k|}
dav1d_loopfilter_sbrow_cols_16bpc:
  315|  29.0k|{
  316|  29.0k|    int x, have_left;
  317|       |    // Don't filter outside the frame
  318|  29.0k|    const int is_sb64 = !f->seq_hdr->sb128;
  319|  29.0k|    const int starty4 = (sby & is_sb64) << 4;
  320|  29.0k|    const int sbsz = 32 >> is_sb64;
  321|  29.0k|    const int sbl2 = 5 - is_sb64;
  322|  29.0k|    const int halign = (f->bh + 31) & ~31;
  323|  29.0k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  324|  29.0k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  325|  29.0k|    const int vmask = 16 >> ss_ver, hmask = 16 >> ss_hor;
  326|  29.0k|    const unsigned vmax = 1U << vmask, hmax = 1U << hmask;
  327|  29.0k|    const unsigned endy4 = starty4 + imin(f->h4 - sby * sbsz, sbsz);
  328|  29.0k|    const unsigned uv_endy4 = (endy4 + ss_ver) >> ss_ver;
  329|       |
  330|       |    // fix lpf strength at tile col boundaries
  331|  29.0k|    const uint8_t *lpf_y = &f->lf.tx_lpf_right_edge[0][sby << sbl2];
  332|  29.0k|    const uint8_t *lpf_uv = &f->lf.tx_lpf_right_edge[1][sby << (sbl2 - ss_ver)];
  333|  30.2k|    for (int tile_col = 1;; tile_col++) {
  334|  30.2k|        x = f->frame_hdr->tiling.col_start_sb[tile_col];
  335|  30.2k|        if ((x << sbl2) >= f->bw) break;
  ------------------
  |  Branch (335:13): [True: 29.0k, False: 1.24k]
  ------------------
  336|  1.24k|        const int bx4 = x & is_sb64 ? 16 : 0, cbx4 = bx4 >> ss_hor;
  ------------------
  |  Branch (336:25): [True: 559, False: 689]
  ------------------
  337|  1.24k|        x >>= is_sb64;
  338|       |
  339|  1.24k|        uint16_t (*const y_hmask)[2] = lflvl[x].filter_y[0][bx4];
  340|  31.4k|        for (unsigned y = starty4, mask = 1 << y; y < endy4; y++, mask <<= 1) {
  ------------------
  |  Branch (340:51): [True: 30.2k, False: 1.24k]
  ------------------
  341|  30.2k|            const int sidx = mask >= 0x10000U;
  342|  30.2k|            const unsigned smask = mask >> (sidx << 4);
  343|  30.2k|            const int idx = 2 * !!(y_hmask[2][sidx] & smask) +
  344|  30.2k|                                !!(y_hmask[1][sidx] & smask);
  345|  30.2k|            y_hmask[2][sidx] &= ~smask;
  346|  30.2k|            y_hmask[1][sidx] &= ~smask;
  347|  30.2k|            y_hmask[0][sidx] &= ~smask;
  348|  30.2k|            y_hmask[imin(idx, lpf_y[y - starty4])][sidx] |= smask;
  349|  30.2k|        }
  350|       |
  351|  1.24k|        if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (351:13): [True: 373, False: 875]
  ------------------
  352|    373|            uint16_t (*const uv_hmask)[2] = lflvl[x].filter_uv[0][cbx4];
  353|  4.59k|            for (unsigned y = starty4 >> ss_ver, uv_mask = 1 << y; y < uv_endy4;
  ------------------
  |  Branch (353:68): [True: 4.22k, False: 373]
  ------------------
  354|  4.22k|                 y++, uv_mask <<= 1)
  355|  4.22k|            {
  356|  4.22k|                const int sidx = uv_mask >= vmax;
  357|  4.22k|                const unsigned smask = uv_mask >> (sidx << (4 - ss_ver));
  358|  4.22k|                const int idx = !!(uv_hmask[1][sidx] & smask);
  359|  4.22k|                uv_hmask[1][sidx] &= ~smask;
  360|  4.22k|                uv_hmask[0][sidx] &= ~smask;
  361|  4.22k|                uv_hmask[imin(idx, lpf_uv[y - (starty4 >> ss_ver)])][sidx] |= smask;
  362|  4.22k|            }
  363|    373|        }
  364|  1.24k|        lpf_y  += halign;
  365|  1.24k|        lpf_uv += halign >> ss_ver;
  366|  1.24k|    }
  367|       |
  368|       |    // fix lpf strength at tile row boundaries
  369|  29.0k|    if (start_of_tile_row) {
  ------------------
  |  Branch (369:9): [True: 571, False: 28.4k]
  ------------------
  370|    571|        const BlockContext *a;
  371|    571|        for (x = 0, a = &f->a[f->sb128w * (start_of_tile_row - 1)];
  372|  1.82k|             x < f->sb128w; x++, a++)
  ------------------
  |  Branch (372:14): [True: 1.25k, False: 571]
  ------------------
  373|  1.25k|        {
  374|  1.25k|            uint16_t (*const y_vmask)[2] = lflvl[x].filter_y[1][starty4];
  375|  1.25k|            const unsigned w = imin(32, f->w4 - (x << 5));
  376|  29.6k|            for (unsigned mask = 1, i = 0; i < w; mask <<= 1, i++) {
  ------------------
  |  Branch (376:44): [True: 28.3k, False: 1.25k]
  ------------------
  377|  28.3k|                const int sidx = mask >= 0x10000U;
  378|  28.3k|                const unsigned smask = mask >> (sidx << 4);
  379|  28.3k|                const int idx = 2 * !!(y_vmask[2][sidx] & smask) +
  380|  28.3k|                                    !!(y_vmask[1][sidx] & smask);
  381|  28.3k|                y_vmask[2][sidx] &= ~smask;
  382|  28.3k|                y_vmask[1][sidx] &= ~smask;
  383|  28.3k|                y_vmask[0][sidx] &= ~smask;
  384|  28.3k|                y_vmask[imin(idx, a->tx_lpf_y[i])][sidx] |= smask;
  385|  28.3k|            }
  386|       |
  387|  1.25k|            if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (387:17): [True: 578, False: 676]
  ------------------
  388|    578|                const unsigned cw = (w + ss_hor) >> ss_hor;
  389|    578|                uint16_t (*const uv_vmask)[2] = lflvl[x].filter_uv[1][starty4 >> ss_ver];
  390|  11.2k|                for (unsigned uv_mask = 1, i = 0; i < cw; uv_mask <<= 1, i++) {
  ------------------
  |  Branch (390:51): [True: 10.6k, False: 578]
  ------------------
  391|  10.6k|                    const int sidx = uv_mask >= hmax;
  392|  10.6k|                    const unsigned smask = uv_mask >> (sidx << (4 - ss_hor));
  393|  10.6k|                    const int idx = !!(uv_vmask[1][sidx] & smask);
  394|  10.6k|                    uv_vmask[1][sidx] &= ~smask;
  395|  10.6k|                    uv_vmask[0][sidx] &= ~smask;
  396|  10.6k|                    uv_vmask[imin(idx, a->tx_lpf_uv[i])][sidx] |= smask;
  397|  10.6k|                }
  398|    578|            }
  399|  1.25k|        }
  400|    571|    }
  401|       |
  402|  29.0k|    pixel *ptr;
  403|  29.0k|    uint8_t (*level_ptr)[2] = f->lf.level[0] + f->b4_stride * sby * sbsz;
  404|  74.3k|    for (ptr = p[0], have_left = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (404:44): [True: 45.3k, False: 29.0k]
  ------------------
  405|  45.3k|         x++, have_left = 1, ptr += 128, level_ptr += 32)
  406|  45.3k|    {
  407|  45.3k|        filter_plane_cols_y(f, have_left, level_ptr, f->b4_stride,
  408|  45.3k|                            lflvl[x].filter_y[0], ptr, f->cur.stride[0],
  409|  45.3k|                            imin(32, f->w4 - x * 32), starty4, endy4);
  410|  45.3k|    }
  411|       |
  412|  29.0k|    if (!f->frame_hdr->loopfilter.level_u && !f->frame_hdr->loopfilter.level_v)
  ------------------
  |  Branch (412:9): [True: 17.5k, False: 11.4k]
  |  Branch (412:46): [True: 15.0k, False: 2.58k]
  ------------------
  413|  15.0k|        return;
  414|       |
  415|  14.0k|    ptrdiff_t uv_off;
  416|  14.0k|    level_ptr = f->lf.level[1] + f->b4_stride * (sby * sbsz >> ss_ver);
  417|  30.8k|    for (uv_off = 0, have_left = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (417:44): [True: 16.8k, False: 14.0k]
  ------------------
  418|  16.8k|         x++, have_left = 1, uv_off += 128 >> ss_hor, level_ptr += 32 >> ss_hor)
  419|  16.8k|    {
  420|  16.8k|        filter_plane_cols_uv(f, have_left, level_ptr, f->b4_stride,
  421|  16.8k|                             lflvl[x].filter_uv[0],
  422|  16.8k|                             &p[1][uv_off], &p[2][uv_off], f->cur.stride[1],
  423|  16.8k|                             (imin(32, f->w4 - x * 32) + ss_hor) >> ss_hor,
  424|  16.8k|                             starty4 >> ss_ver, uv_endy4, ss_ver);
  425|  16.8k|    }
  426|  14.0k|}
dav1d_loopfilter_sbrow_rows_16bpc:
  431|  29.0k|{
  432|  29.0k|    int x;
  433|       |    // Don't filter outside the frame
  434|  29.0k|    const int have_top = sby > 0;
  435|  29.0k|    const int is_sb64 = !f->seq_hdr->sb128;
  436|  29.0k|    const int starty4 = (sby & is_sb64) << 4;
  437|  29.0k|    const int sbsz = 32 >> is_sb64;
  438|  29.0k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  439|  29.0k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  440|  29.0k|    const unsigned endy4 = starty4 + imin(f->h4 - sby * sbsz, sbsz);
  441|  29.0k|    const unsigned uv_endy4 = (endy4 + ss_ver) >> ss_ver;
  442|       |
  443|  29.0k|    pixel *ptr;
  444|  29.0k|    uint8_t (*level_ptr)[2] = f->lf.level[0] + f->b4_stride * sby * sbsz;
  445|  74.3k|    for (ptr = p[0], x = 0; x < f->sb128w; x++, ptr += 128, level_ptr += 32) {
  ------------------
  |  Branch (445:29): [True: 45.3k, False: 29.0k]
  ------------------
  446|  45.3k|        filter_plane_rows_y(f, have_top, level_ptr, f->b4_stride,
  447|  45.3k|                            lflvl[x].filter_y[1], ptr, f->cur.stride[0],
  448|  45.3k|                            imin(32, f->w4 - x * 32), starty4, endy4);
  449|  45.3k|    }
  450|       |
  451|  29.0k|    if (!f->frame_hdr->loopfilter.level_u && !f->frame_hdr->loopfilter.level_v)
  ------------------
  |  Branch (451:9): [True: 17.5k, False: 11.4k]
  |  Branch (451:46): [True: 15.0k, False: 2.58k]
  ------------------
  452|  15.0k|        return;
  453|       |
  454|  14.0k|    ptrdiff_t uv_off;
  455|  14.0k|    level_ptr = f->lf.level[1] + f->b4_stride * (sby * sbsz >> ss_ver);
  456|  30.8k|    for (uv_off = 0, x = 0; x < f->sb128w;
  ------------------
  |  Branch (456:29): [True: 16.8k, False: 14.0k]
  ------------------
  457|  16.8k|         x++, uv_off += 128 >> ss_hor, level_ptr += 32 >> ss_hor)
  458|  16.8k|    {
  459|  16.8k|        filter_plane_rows_uv(f, have_top, level_ptr, f->b4_stride,
  460|  16.8k|                             lflvl[x].filter_uv[1],
  461|  16.8k|                             &p[1][uv_off], &p[2][uv_off], f->cur.stride[1],
  462|  16.8k|                             (imin(32, f->w4 - x * 32) + ss_hor) >> ss_hor,
  463|  16.8k|                             starty4 >> ss_ver, uv_endy4, ss_hor);
  464|  16.8k|    }
  465|  14.0k|}

dav1d_create_lf_mask_intra:
  298|   419k|{
  299|   419k|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  300|   419k|    const int bw4 = imin(iw - bx, b_dim[0]);
  301|   419k|    const int bh4 = imin(ih - by, b_dim[1]);
  302|   419k|    const int bx4 = bx & 31;
  303|   419k|    const int by4 = by & 31;
  304|   419k|    assert(bw4 >= 0 && bh4 >= 0);
  ------------------
  |  Branch (304:5): [True: 419k, False: 0]
  |  Branch (304:5): [True: 419k, False: 0]
  ------------------
  305|       |
  306|   419k|    if (bw4 && bh4) {
  ------------------
  |  Branch (306:9): [True: 417k, False: 2.30k]
  |  Branch (306:16): [True: 388k, False: 28.7k]
  ------------------
  307|   388k|        uint8_t (*level_cache_ptr)[2] = level_cache[0] + by * b4_stride + bx;
  308|       |
  309|   388k|        dsp->fill_levelcache_block(level_cache_ptr, b4_stride, bw4, bh4,
  310|   388k|                                   filter_level[0][0][0], filter_level[1][0][0]);
  311|   388k|        mask_edges_intra(lflvl->filter_y, by4, bx4, bw4, bh4, ytx, ay, ly);
  312|   388k|    }
  313|       |
  314|   419k|    if (!auv) return;
  ------------------
  |  Branch (314:9): [True: 134k, False: 284k]
  ------------------
  315|       |
  316|   284k|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
  317|   284k|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
  318|   284k|    const int cbw4 = imin(((iw + ss_hor) >> ss_hor) - (bx >> ss_hor),
  319|   284k|                          (b_dim[0] + ss_hor) >> ss_hor);
  320|   284k|    const int cbh4 = imin(((ih + ss_ver) >> ss_ver) - (by >> ss_ver),
  321|   284k|                          (b_dim[1] + ss_ver) >> ss_ver);
  322|   284k|    assert(cbw4 >= 0 && cbh4 >= 0);
  ------------------
  |  Branch (322:5): [True: 284k, False: 0]
  |  Branch (322:5): [True: 284k, False: 0]
  ------------------
  323|       |
  324|   284k|    if (!cbw4 || !cbh4) return;
  ------------------
  |  Branch (324:9): [True: 396, False: 284k]
  |  Branch (324:18): [True: 17.9k, False: 266k]
  ------------------
  325|       |
  326|   266k|    const int cbx4 = bx4 >> ss_hor;
  327|   266k|    const int cby4 = by4 >> ss_ver;
  328|       |
  329|   266k|    uint8_t (*level_cache_ptr)[2] =
  330|   266k|        level_cache[1] + (by >> ss_ver) * b4_stride + (bx >> ss_hor);
  331|       |
  332|   266k|    dsp->fill_levelcache_block(level_cache_ptr, b4_stride, cbw4, cbh4,
  333|   266k|                               filter_level[2][0][0], filter_level[3][0][0]);
  334|   266k|    mask_edges_chroma(lflvl->filter_uv, cby4, cbx4, cbw4, cbh4, 0, uvtx,
  335|   266k|                      auv, luv, ss_hor, ss_ver);
  336|   266k|}
dav1d_create_lf_mask_inter:
  350|   634k|{
  351|   634k|    const Dav1dLfMaskDSPContext *const dsp = &t->c->lf_mask_dsp;
  352|   634k|    Av1Filter *const lflvl = t->lf_mask;
  353|   634k|    const int bx = t->bx, by = t->by;
  354|   634k|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  355|   634k|    const int bw4 = imin(iw - bx, b_dim[0]);
  356|   634k|    const int bh4 = imin(ih - by, b_dim[1]);
  357|   634k|    const int bx4 = bx & 31;
  358|   634k|    const int by4 = by & 31;
  359|   634k|    assert(bw4 >= 0 && bh4 >= 0);
  ------------------
  |  Branch (359:5): [True: 634k, False: 0]
  |  Branch (359:5): [True: 634k, False: 0]
  ------------------
  360|       |
  361|   634k|    if (bw4 && bh4) {
  ------------------
  |  Branch (361:9): [True: 633k, False: 1.42k]
  |  Branch (361:16): [True: 627k, False: 5.95k]
  ------------------
  362|   627k|        uint8_t (*level_cache_ptr)[2] = level_cache[0] + by * b4_stride + bx;
  363|       |
  364|   627k|        dsp->fill_levelcache_block(level_cache_ptr, b4_stride, bw4, bh4,
  365|   627k|                                   filter_level[0][0][0], filter_level[1][0][0]);
  366|       |
  367|   627k|        const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[max_ytx];
  368|   627k|        uint8_t (*const txa)[2][32][32] = t->scratch.txa;
  369|  1.30M|        for (int y_off = 0, y = 0; y < bh4; y += t_dim->h, y_off++)
  ------------------
  |  Branch (369:36): [True: 674k, False: 627k]
  ------------------
  370|  1.64M|            for (int x_off = 0, x = 0; x < bw4; x += t_dim->w, x_off++)
  ------------------
  |  Branch (370:40): [True: 972k, False: 674k]
  ------------------
  371|   972k|                decomp_tx((uint8_t(*)[2][32][32]) &txa[0][0][y][x],
  372|   972k|                          max_ytx, 0, y_off, x_off, tx_masks);
  373|       |
  374|   627k|        dsp->mask_edges_inter_outer(ay, ly, by4, bx4, bw4, bh4, lflvl->filter_y, txa);
  375|   627k|        if (!skip)
  ------------------
  |  Branch (375:13): [True: 173k, False: 454k]
  ------------------
  376|   173k|            mask_edges_inter_inner(by4, bx4, bw4, bh4, lflvl->filter_y, txa);
  377|   627k|    }
  378|       |
  379|   634k|    if (!auv) return;
  ------------------
  |  Branch (379:9): [True: 470k, False: 164k]
  ------------------
  380|       |
  381|   164k|    const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
  382|   164k|    const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
  383|   164k|    const int cbw4 = imin(((iw + ss_hor) >> ss_hor) - (bx >> ss_hor),
  384|   164k|                          (b_dim[0] + ss_hor) >> ss_hor);
  385|   164k|    const int cbh4 = imin(((ih + ss_ver) >> ss_ver) - (by >> ss_ver),
  386|   164k|                          (b_dim[1] + ss_ver) >> ss_ver);
  387|   164k|    assert(cbw4 >= 0 && cbh4 >= 0);
  ------------------
  |  Branch (387:5): [True: 164k, False: 0]
  |  Branch (387:5): [True: 164k, False: 0]
  ------------------
  388|       |
  389|   164k|    if (!cbw4 || !cbh4) return;
  ------------------
  |  Branch (389:9): [True: 805, False: 163k]
  |  Branch (389:18): [True: 1.71k, False: 161k]
  ------------------
  390|       |
  391|   161k|    const int cbx4 = bx4 >> ss_hor;
  392|   161k|    const int cby4 = by4 >> ss_ver;
  393|       |
  394|   161k|    uint8_t (*level_cache_ptr)[2] =
  395|   161k|        level_cache[1] + (by >> ss_ver) * b4_stride + (bx >> ss_hor);
  396|       |
  397|   161k|    dsp->fill_levelcache_block(level_cache_ptr, b4_stride, cbw4, cbh4,
  398|   161k|                               filter_level[2][0][0], filter_level[3][0][0]);
  399|   161k|    mask_edges_chroma(lflvl->filter_uv, cby4, cbx4, cbw4, cbh4, skip, uvtx,
  400|   161k|                      auv, luv, ss_hor, ss_ver);
  401|   161k|}
dav1d_calc_eih:
  403|  15.5k|void dav1d_calc_eih(Av1FilterLUT *const lim_lut, const int filter_sharpness) {
  404|       |    // set E/I/H values from loopfilter level
  405|  15.5k|    const int sharp = filter_sharpness;
  406|  1.01M|    for (int level = 0; level < 64; level++) {
  ------------------
  |  Branch (406:25): [True: 994k, False: 15.5k]
  ------------------
  407|   994k|        int limit = level;
  408|       |
  409|   994k|        if (sharp > 0) {
  ------------------
  |  Branch (409:13): [True: 432k, False: 562k]
  ------------------
  410|   432k|            limit >>= (sharp + 3) >> 2;
  411|   432k|            limit = imin(limit, 9 - sharp);
  412|   432k|        }
  413|   994k|        limit = imax(limit, 1);
  414|       |
  415|   994k|        lim_lut->i[level] = limit;
  416|   994k|        lim_lut->e[level] = 2 * (level + 2) + limit;
  417|   994k|    }
  418|  15.5k|    lim_lut->sharp[0] = (sharp + 3) >> 2;
  419|  15.5k|    lim_lut->sharp[1] = sharp ? 9 - sharp : 0xff;
  ------------------
  |  Branch (419:25): [True: 6.75k, False: 8.79k]
  ------------------
  420|  15.5k|}
dav1d_calc_lf_values:
  459|  60.1k|{
  460|  60.1k|    const int n_seg = hdr->segmentation.enabled ? 8 : 1;
  ------------------
  |  Branch (460:23): [True: 12.5k, False: 47.6k]
  ------------------
  461|       |
  462|  60.1k|    if (!hdr->loopfilter.level_y[0] && !hdr->loopfilter.level_y[1]) {
  ------------------
  |  Branch (462:9): [True: 41.4k, False: 18.6k]
  |  Branch (462:40): [True: 30.1k, False: 11.3k]
  ------------------
  463|  30.1k|        memset(lflvl_values, 0, sizeof(*lflvl_values) * n_seg);
  464|  30.1k|        return;
  465|  30.1k|    }
  466|       |
  467|  30.0k|    const Dav1dLoopfilterModeRefDeltas *const mr_deltas =
  468|  30.0k|        hdr->loopfilter.mode_ref_delta_enabled ?
  ------------------
  |  Branch (468:9): [True: 21.5k, False: 8.44k]
  ------------------
  469|  30.0k|        &hdr->loopfilter.mode_ref_deltas : NULL;
  470|   129k|    for (int s = 0; s < n_seg; s++) {
  ------------------
  |  Branch (470:21): [True: 99.0k, False: 30.0k]
  ------------------
  471|  99.0k|        const Dav1dSegmentationData *const segd =
  472|  99.0k|            hdr->segmentation.enabled ? &hdr->segmentation.seg_data.d[s] : NULL;
  ------------------
  |  Branch (472:13): [True: 78.8k, False: 20.1k]
  ------------------
  473|       |
  474|  99.0k|        calc_lf_value(lflvl_values[s][0], hdr->loopfilter.level_y[0],
  475|  99.0k|                      lf_delta[0], segd ? segd->delta_lf_y_v : 0, mr_deltas);
  ------------------
  |  Branch (475:36): [True: 78.8k, False: 20.1k]
  ------------------
  476|  99.0k|        calc_lf_value(lflvl_values[s][1], hdr->loopfilter.level_y[1],
  477|  99.0k|                      lf_delta[hdr->delta.lf.multi ? 1 : 0],
  ------------------
  |  Branch (477:32): [True: 35.1k, False: 63.8k]
  ------------------
  478|  99.0k|                      segd ? segd->delta_lf_y_h : 0, mr_deltas);
  ------------------
  |  Branch (478:23): [True: 78.8k, False: 20.1k]
  ------------------
  479|  99.0k|        calc_lf_value_chroma(lflvl_values[s][2], hdr->loopfilter.level_u,
  480|  99.0k|                             lf_delta[hdr->delta.lf.multi ? 2 : 0],
  ------------------
  |  Branch (480:39): [True: 35.1k, False: 63.8k]
  ------------------
  481|  99.0k|                             segd ? segd->delta_lf_u : 0, mr_deltas);
  ------------------
  |  Branch (481:30): [True: 78.8k, False: 20.1k]
  ------------------
  482|  99.0k|        calc_lf_value_chroma(lflvl_values[s][3], hdr->loopfilter.level_v,
  483|  99.0k|                             lf_delta[hdr->delta.lf.multi ? 3 : 0],
  ------------------
  |  Branch (483:39): [True: 35.1k, False: 63.8k]
  ------------------
  484|  99.0k|                             segd ? segd->delta_lf_v : 0, mr_deltas);
  ------------------
  |  Branch (484:30): [True: 78.8k, False: 20.1k]
  ------------------
  485|  99.0k|    }
  486|  30.0k|}
dav1d_lf_mask_dsp_init:
  489|  11.2k|{
  490|  11.2k|    c->fill_levelcache_block = fill_levelcache_block_c;
  491|  11.2k|    c->mask_edges_inter_outer = mask_edges_inter_outer_c;
  492|  11.2k|#if HAVE_ASM
  493|  11.2k|#if ARCH_X86_64
  494|  11.2k|    lf_mask_dsp_init_x86(c);
  495|       |#elif ARCH_AARCH64
  496|       |    lf_mask_dsp_init_arm(c);
  497|       |#endif
  498|  11.2k|#endif
  499|  11.2k|}
lf_mask.c:mask_edges_intra:
  161|   388k|{
  162|   388k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[tx];
  163|   388k|    const int twl4 = t_dim->lw, thl4 = t_dim->lh;
  164|   388k|    const int twl4c = imin(2, twl4), thl4c = imin(2, thl4);
  165|   388k|    int y, x;
  166|       |
  167|       |    // left block edge
  168|   388k|    unsigned mask = 1U << by4;
  169|  2.40M|    for (y = 0; y < h4; y++, mask <<= 1) {
  ------------------
  |  Branch (169:17): [True: 2.02M, False: 388k]
  ------------------
  170|  2.02M|        const int sidx = mask >= 0x10000;
  171|  2.02M|        const unsigned smask = mask >> (sidx << 4);
  172|  2.02M|        masks[0][bx4][imin(twl4c, l[y])][sidx] |= smask;
  173|  2.02M|    }
  174|       |
  175|       |    // top block edge
  176|  2.60M|    for (x = 0, mask = 1U << bx4; x < w4; x++, mask <<= 1) {
  ------------------
  |  Branch (176:35): [True: 2.21M, False: 388k]
  ------------------
  177|  2.21M|        const int sidx = mask >= 0x10000;
  178|  2.21M|        const unsigned smask = mask >> (sidx << 4);
  179|  2.21M|        masks[1][by4][imin(thl4c, a[x])][sidx] |= smask;
  180|  2.21M|    }
  181|       |
  182|       |    // inner (tx) left|right edges
  183|   388k|    const int hstep = t_dim->w;
  184|   388k|    unsigned t = 1U << by4;
  185|   388k|    unsigned inner = (unsigned) ((((uint64_t) t) << h4) - t);
  186|   388k|    unsigned inner1 = inner & 0xffff, inner2 = inner >> 16;
  187|   625k|    for (x = hstep; x < w4; x += hstep) {
  ------------------
  |  Branch (187:21): [True: 237k, False: 388k]
  ------------------
  188|   237k|        if (inner1) masks[0][bx4 + x][twl4c][0] |= inner1;
  ------------------
  |  Branch (188:13): [True: 175k, False: 61.6k]
  ------------------
  189|   237k|        if (inner2) masks[0][bx4 + x][twl4c][1] |= inner2;
  ------------------
  |  Branch (189:13): [True: 87.0k, False: 150k]
  ------------------
  190|   237k|    }
  191|       |
  192|       |    //            top
  193|       |    // inner (tx) --- edges
  194|       |    //           bottom
  195|   388k|    const int vstep = t_dim->h;
  196|   388k|    t = 1U << bx4;
  197|   388k|    inner = (unsigned) ((((uint64_t) t) << w4) - t);
  198|   388k|    inner1 = inner & 0xffff;
  199|   388k|    inner2 = inner >> 16;
  200|   596k|    for (y = vstep; y < h4; y += vstep) {
  ------------------
  |  Branch (200:21): [True: 208k, False: 388k]
  ------------------
  201|   208k|        if (inner1) masks[1][by4 + y][thl4c][0] |= inner1;
  ------------------
  |  Branch (201:13): [True: 117k, False: 90.2k]
  ------------------
  202|   208k|        if (inner2) masks[1][by4 + y][thl4c][1] |= inner2;
  ------------------
  |  Branch (202:13): [True: 113k, False: 95.0k]
  ------------------
  203|   208k|    }
  204|       |
  205|   388k|    dav1d_memset_likely_pow2(a, thl4c, w4);
  206|   388k|    dav1d_memset_likely_pow2(l, twl4c, h4);
  207|   388k|}
lf_mask.c:mask_edges_chroma:
  216|   427k|{
  217|   427k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[tx];
  218|   427k|    const int twl4 = t_dim->lw, thl4 = t_dim->lh;
  219|   427k|    const int twl4c = !!twl4, thl4c = !!thl4;
  220|   427k|    int y, x;
  221|   427k|    const int vbits = 4 - ss_ver, hbits = 4 - ss_hor;
  222|   427k|    const int vmask = 16 >> ss_ver, hmask = 16 >> ss_hor;
  223|   427k|    const unsigned vmax = 1 << vmask, hmax = 1 << hmask;
  224|       |
  225|       |    // left block edge
  226|   427k|    unsigned mask = 1U << cby4;
  227|  2.29M|    for (y = 0; y < ch4; y++, mask <<= 1) {
  ------------------
  |  Branch (227:17): [True: 1.87M, False: 427k]
  ------------------
  228|  1.87M|        const int sidx = mask >= vmax;
  229|  1.87M|        const unsigned smask = mask >> (sidx << vbits);
  230|  1.87M|        masks[0][cbx4][imin(twl4c, l[y])][sidx] |= smask;
  231|  1.87M|    }
  232|       |
  233|       |    // top block edge
  234|  2.51M|    for (x = 0, mask = 1U << cbx4; x < cw4; x++, mask <<= 1) {
  ------------------
  |  Branch (234:36): [True: 2.08M, False: 427k]
  ------------------
  235|  2.08M|        const int sidx = mask >= hmax;
  236|  2.08M|        const unsigned smask = mask >> (sidx << hbits);
  237|  2.08M|        masks[1][cby4][imin(thl4c, a[x])][sidx] |= smask;
  238|  2.08M|    }
  239|       |
  240|   427k|    if (!skip_inter) {
  ------------------
  |  Branch (240:9): [True: 338k, False: 89.6k]
  ------------------
  241|       |        // inner (tx) left|right edges
  242|   338k|        const int hstep = t_dim->w;
  243|   338k|        unsigned t = 1U << cby4;
  244|   338k|        unsigned inner = (unsigned) ((((uint64_t) t) << ch4) - t);
  245|   338k|        unsigned inner1 = inner & ((1 << vmask) - 1), inner2 = inner >> vmask;
  246|   417k|        for (x = hstep; x < cw4; x += hstep) {
  ------------------
  |  Branch (246:25): [True: 79.4k, False: 338k]
  ------------------
  247|  79.4k|            if (inner1) masks[0][cbx4 + x][twl4c][0] |= inner1;
  ------------------
  |  Branch (247:17): [True: 55.9k, False: 23.5k]
  ------------------
  248|  79.4k|            if (inner2) masks[0][cbx4 + x][twl4c][1] |= inner2;
  ------------------
  |  Branch (248:17): [True: 39.0k, False: 40.4k]
  ------------------
  249|  79.4k|        }
  250|       |
  251|       |        //            top
  252|       |        // inner (tx) --- edges
  253|       |        //           bottom
  254|   338k|        const int vstep = t_dim->h;
  255|   338k|        t = 1U << cbx4;
  256|   338k|        inner = (unsigned) ((((uint64_t) t) << cw4) - t);
  257|   338k|        inner1 = inner & ((1 << hmask) - 1), inner2 = inner >> hmask;
  258|   467k|        for (y = vstep; y < ch4; y += vstep) {
  ------------------
  |  Branch (258:25): [True: 129k, False: 338k]
  ------------------
  259|   129k|            if (inner1) masks[1][cby4 + y][thl4c][0] |= inner1;
  ------------------
  |  Branch (259:17): [True: 75.0k, False: 54.2k]
  ------------------
  260|   129k|            if (inner2) masks[1][cby4 + y][thl4c][1] |= inner2;
  ------------------
  |  Branch (260:17): [True: 72.0k, False: 57.2k]
  ------------------
  261|   129k|        }
  262|   338k|    }
  263|       |
  264|   427k|    dav1d_memset_likely_pow2(a, thl4c, cw4);
  265|   427k|    dav1d_memset_likely_pow2(l, twl4c, ch4);
  266|   427k|}
lf_mask.c:decomp_tx:
   53|  1.11M|{
   54|  1.11M|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[from];
   55|  1.11M|    const int is_split = (from == (int) TX_4X4 || depth > 1) ? 0 :
  ------------------
  |  Branch (55:27): [True: 348k, False: 763k]
  |  Branch (55:51): [True: 31.0k, False: 732k]
  ------------------
   56|  1.11M|        (tx_masks[depth] >> (y_off * 4 + x_off)) & 1;
   57|       |
   58|  1.11M|    if (is_split) {
  ------------------
  |  Branch (58:9): [True: 45.9k, False: 1.06M]
  ------------------
   59|  45.9k|        const enum RectTxfmSize sub = t_dim->sub;
   60|  45.9k|        const int htw4 = t_dim->w >> 1, hth4 = t_dim->h >> 1;
   61|       |
   62|  45.9k|        decomp_tx(txa, sub, depth + 1, y_off * 2 + 0, x_off * 2 + 0, tx_masks);
   63|  45.9k|        if (t_dim->w >= t_dim->h)
  ------------------
  |  Branch (63:13): [True: 36.9k, False: 9.04k]
  ------------------
   64|  36.9k|            decomp_tx((uint8_t(*)[2][32][32]) &txa[0][0][0][htw4],
   65|  36.9k|                      sub, depth + 1, y_off * 2 + 0, x_off * 2 + 1, tx_masks);
   66|  45.9k|        if (t_dim->h >= t_dim->w) {
  ------------------
  |  Branch (66:13): [True: 32.8k, False: 13.1k]
  ------------------
   67|  32.8k|            decomp_tx((uint8_t(*)[2][32][32]) &txa[0][0][hth4][0],
   68|  32.8k|                      sub, depth + 1, y_off * 2 + 1, x_off * 2 + 0, tx_masks);
   69|  32.8k|            if (t_dim->w >= t_dim->h)
  ------------------
  |  Branch (69:17): [True: 23.7k, False: 9.04k]
  ------------------
   70|  23.7k|                decomp_tx((uint8_t(*)[2][32][32]) &txa[0][0][hth4][htw4],
   71|  23.7k|                          sub, depth + 1, y_off * 2 + 1, x_off * 2 + 1, tx_masks);
   72|  32.8k|        }
   73|  1.06M|    } else {
   74|  1.06M|        const int lw = imin(2, t_dim->lw), lh = imin(2, t_dim->lh);
   75|       |
   76|  1.06M|#define set_ctx(rep_macro) \
   77|  1.06M|        for (int y = 0; y < t_dim->h; y++) { \
   78|  1.06M|            rep_macro(txa[0][0][y], 0, lw); \
   79|  1.06M|            rep_macro(txa[1][0][y], 0, lh); \
   80|  1.06M|            txa[0][1][y][0] = t_dim->w; \
   81|  1.06M|        } \
   82|  1.06M|        rep_macro(txa[1][1][0], 0, t_dim->h);
   83|  1.06M|        case_set_upto16(t_dim->lw);
  ------------------
  |  |   80|  1.06M|    switch (var) { \
  |  |   81|   412k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  |   77|   943k|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:25): [True: 530k, False: 412k]
  |  |  |  |  ------------------
  |  |  |  |   78|   530k|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|   530k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   530k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   79|   530k|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|   530k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   530k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   80|   530k|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   81|   530k|        } \
  |  |  |  |   82|   412k|        rep_macro(txa[1][1][0], 0, t_dim->h);
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|   412k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   412k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (81:5): [True: 412k, False: 653k]
  |  |  ------------------
  |  |   82|   225k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  |   77|   819k|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:25): [True: 594k, False: 225k]
  |  |  |  |  ------------------
  |  |  |  |   78|   594k|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|   594k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   594k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   79|   594k|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|   594k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   594k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   80|   594k|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   81|   594k|        } \
  |  |  |  |   82|   225k|        rep_macro(txa[1][1][0], 0, t_dim->h);
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|   225k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   225k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (82:5): [True: 225k, False: 840k]
  |  |  ------------------
  |  |   83|   187k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  |   77|   998k|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:25): [True: 811k, False: 187k]
  |  |  |  |  ------------------
  |  |  |  |   78|   811k|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|   811k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   811k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   79|   811k|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|   811k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   811k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   80|   811k|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   81|   811k|        } \
  |  |  |  |   82|   187k|        rep_macro(txa[1][1][0], 0, t_dim->h);
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|   187k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   187k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (83:5): [True: 187k, False: 878k]
  |  |  ------------------
  |  |   84|  60.9k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  |   77|   426k|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:25): [True: 365k, False: 60.9k]
  |  |  |  |  ------------------
  |  |  |  |   78|   365k|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|   365k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   365k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   79|   365k|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|   365k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   365k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   80|   365k|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   81|   365k|        } \
  |  |  |  |   82|  60.9k|        rep_macro(txa[1][1][0], 0, t_dim->h);
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|  60.9k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  60.9k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (84:5): [True: 60.9k, False: 1.00M]
  |  |  ------------------
  |  |   85|   179k|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  |   77|  2.97M|        for (int y = 0; y < t_dim->h; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:25): [True: 2.79M, False: 179k]
  |  |  |  |  ------------------
  |  |  |  |   78|  2.79M|            rep_macro(txa[0][0][y], 0, lw); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  2.79M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.79M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.79M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.79M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.79M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   79|  2.79M|            rep_macro(txa[1][0][y], 0, lh); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|  2.79M|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|  2.79M|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|  2.79M|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|  2.79M|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 2.79M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |   80|  2.79M|            txa[0][1][y][0] = t_dim->w; \
  |  |  |  |   81|  2.79M|        } \
  |  |  |  |   82|   179k|        rep_macro(txa[1][1][0], 0, t_dim->h);
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|   179k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   179k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   179k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   179k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 179k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (85:5): [True: 179k, False: 886k]
  |  |  ------------------
  |  |   86|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (86:5): [True: 0, False: 1.06M]
  |  |  ------------------
  |  |   87|  1.06M|    }
  ------------------
  |  Branch (83:9): [Folded, False: 0]
  ------------------
   84|  1.06M|#undef set_ctx
   85|  1.06M|    }
   86|  1.11M|}
lf_mask.c:mask_edges_inter_inner:
   93|   173k|{
   94|   173k|    unsigned mask;
   95|   173k|    int x, y;
   96|       |    // inner (tx) left|right edges
   97|   868k|    for (y = 0, mask = 1U << by4; y < h4; y++, mask <<= 1) {
  ------------------
  |  Branch (97:35): [True: 695k, False: 173k]
  ------------------
   98|   695k|        const int sidx = mask >= 0x10000U;
   99|   695k|        const unsigned smask = mask >> (sidx << 4);
  100|   695k|        int ltx = txa[0][0][y][0];
  101|   695k|        int step = txa[0][1][y][0];
  102|   954k|        for (x = step; x < w4; x += step) {
  ------------------
  |  Branch (102:24): [True: 258k, False: 695k]
  ------------------
  103|   258k|            const int rtx = txa[0][0][y][x];
  104|   258k|            masks[0][bx4 + x][imin(rtx, ltx)][sidx] |= smask;
  105|   258k|            ltx = rtx;
  106|   258k|            step = txa[0][1][y][x];
  107|   258k|        }
  108|   695k|    }
  109|       |
  110|       |    //            top
  111|       |    // inner (tx) --- edges
  112|       |    //           bottom
  113|   939k|    for (x = 0, mask = 1U << bx4; x < w4; x++, mask <<= 1) {
  ------------------
  |  Branch (113:35): [True: 766k, False: 173k]
  ------------------
  114|   766k|        const int sidx = mask >= 0x10000U;
  115|   766k|        const unsigned smask = mask >> (sidx << 4);
  116|   766k|        int ttx = txa[1][0][0][x];
  117|   766k|        int step = txa[1][1][0][x];
  118|  1.01M|        for (y = step; y < h4; y += step) {
  ------------------
  |  Branch (118:24): [True: 248k, False: 766k]
  ------------------
  119|   248k|            const int btx = txa[1][0][y][x];
  120|   248k|            masks[1][by4 + y][imin(ttx, btx)][sidx] |= smask;
  121|   248k|            ttx = btx;
  122|   248k|            step = txa[1][1][y][x];
  123|   248k|        }
  124|   766k|    }
  125|   173k|}
lf_mask.c:calc_lf_value:
  426|   266k|{
  427|   266k|    const int base = iclip(iclip(base_lvl + lf_delta, 0, 63) + seg_delta, 0, 63);
  428|       |
  429|   266k|    if (!mr_delta) {
  ------------------
  |  Branch (429:9): [True: 74.8k, False: 191k]
  ------------------
  430|  74.8k|        memset(lflvl_values, base, sizeof(*lflvl_values) * 8);
  431|   191k|    } else {
  432|   191k|        const int sh = base >= 32;
  433|   191k|        lflvl_values[0][0] = lflvl_values[0][1] =
  434|   191k|            iclip(base + (mr_delta->ref_delta[0] * (1 << sh)), 0, 63);
  435|  1.53M|        for (int r = 1; r < 8; r++) {
  ------------------
  |  Branch (435:25): [True: 1.34M, False: 191k]
  ------------------
  436|  4.02M|            for (int m = 0; m < 2; m++) {
  ------------------
  |  Branch (436:29): [True: 2.68M, False: 1.34M]
  ------------------
  437|  2.68M|                const int delta =
  438|  2.68M|                    mr_delta->mode_delta[m] + mr_delta->ref_delta[r];
  439|  2.68M|                lflvl_values[r][m] = iclip(base + (delta * (1 << sh)), 0, 63);
  440|  2.68M|            }
  441|  1.34M|        }
  442|   191k|    }
  443|   266k|}
lf_mask.c:calc_lf_value_chroma:
  449|   198k|{
  450|   198k|    if (!base_lvl)
  ------------------
  |  Branch (450:9): [True: 129k, False: 68.4k]
  ------------------
  451|   129k|        memset(lflvl_values, 0, sizeof(*lflvl_values) * 8);
  452|  68.4k|    else
  453|  68.4k|        calc_lf_value(lflvl_values, base_lvl, lf_delta, seg_delta, mr_delta);
  454|   198k|}

dav1d_version:
   61|  11.2k|COLD const char *dav1d_version(void) {
   62|  11.2k|    return DAV1D_VERSION;
  ------------------
  |  |    2|  11.2k|#define DAV1D_VERSION "ed06ba3"
  ------------------
   63|  11.2k|}
dav1d_default_settings:
   71|  11.2k|COLD void dav1d_default_settings(Dav1dSettings *const s) {
   72|  11.2k|    s->n_threads = 0;
   73|  11.2k|    s->max_frame_delay = 0;
   74|  11.2k|    s->apply_grain = 1;
   75|  11.2k|    s->allocator.cookie = NULL;
   76|  11.2k|    s->allocator.alloc_picture_callback = dav1d_default_picture_alloc;
   77|  11.2k|    s->allocator.release_picture_callback = dav1d_default_picture_release;
   78|  11.2k|    s->logger.cookie = NULL;
   79|       |    s->logger.callback = dav1d_log_default_callback;
  ------------------
  |  |   43|  11.2k|#define dav1d_log_default_callback NULL
  ------------------
   80|  11.2k|    s->operating_point = 0;
   81|  11.2k|    s->all_layers = 1; // just until the tests are adjusted
   82|  11.2k|    s->frame_size_limit = 0;
   83|  11.2k|    s->strict_std_compliance = 0;
   84|  11.2k|    s->output_invisible_frames = 0;
   85|  11.2k|    s->inloop_filters = DAV1D_INLOOPFILTER_ALL;
   86|  11.2k|    s->decode_frame_type = DAV1D_DECODEFRAMETYPE_ALL;
   87|  11.2k|}
dav1d_open:
  140|  11.2k|COLD int dav1d_open(Dav1dContext **const c_out, const Dav1dSettings *const s) {
  141|  11.2k|    static pthread_once_t initted = PTHREAD_ONCE_INIT;
  142|  11.2k|    pthread_once(&initted, init_internal);
  143|       |
  144|  11.2k|    validate_input_or_ret(c_out != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  11.2k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 11.2k]
  |  |  ------------------
  |  |   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|  11.2k|    validate_input_or_ret(s != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  11.2k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 11.2k]
  |  |  ------------------
  |  |   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|  11.2k|    validate_input_or_ret(s->n_threads >= 0 &&
  ------------------
  |  |   52|  22.5k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 11.2k, False: 0]
  |  |  |  Branch (52:11): [True: 11.2k, 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|  11.2k|                          s->n_threads <= DAV1D_MAX_THREADS, DAV1D_ERR(EINVAL));
  148|  11.2k|    validate_input_or_ret(s->max_frame_delay >= 0 &&
  ------------------
  |  |   52|  22.5k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 11.2k, False: 0]
  |  |  |  Branch (52:11): [True: 11.2k, 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|  11.2k|                          s->max_frame_delay <= DAV1D_MAX_FRAME_DELAY, DAV1D_ERR(EINVAL));
  150|  11.2k|    validate_input_or_ret(s->allocator.alloc_picture_callback != NULL,
  ------------------
  |  |   52|  11.2k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 11.2k]
  |  |  ------------------
  |  |   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|  11.2k|                          DAV1D_ERR(EINVAL));
  152|  11.2k|    validate_input_or_ret(s->allocator.release_picture_callback != NULL,
  ------------------
  |  |   52|  11.2k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 11.2k]
  |  |  ------------------
  |  |   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|  11.2k|                          DAV1D_ERR(EINVAL));
  154|  11.2k|    validate_input_or_ret(s->operating_point >= 0 &&
  ------------------
  |  |   52|  22.5k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 11.2k, False: 0]
  |  |  |  Branch (52:11): [True: 11.2k, 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|  11.2k|                          s->operating_point <= 31, DAV1D_ERR(EINVAL));
  156|  11.2k|    validate_input_or_ret(s->decode_frame_type >= DAV1D_DECODEFRAMETYPE_ALL &&
  ------------------
  |  |   52|  22.5k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 11.2k, False: 0]
  |  |  |  Branch (52:11): [True: 11.2k, 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|  11.2k|                          s->decode_frame_type <= DAV1D_DECODEFRAMETYPE_KEY, DAV1D_ERR(EINVAL));
  158|       |
  159|  11.2k|    pthread_attr_t thread_attr;
  160|  11.2k|    if (pthread_attr_init(&thread_attr)) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (160:9): [True: 0, False: 11.2k]
  ------------------
  161|  11.2k|    size_t stack_size = 1024 * 1024 + get_stack_size_internal(&thread_attr);
  162|       |
  163|  11.2k|    pthread_attr_setstacksize(&thread_attr, stack_size);
  164|       |
  165|  11.2k|    Dav1dContext *const c = *c_out = dav1d_alloc_aligned(ALLOC_COMMON_CTX, sizeof(*c), 64);
  ------------------
  |  |  134|  11.2k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
  166|  11.2k|    if (!c) goto error;
  ------------------
  |  Branch (166:9): [True: 0, False: 11.2k]
  ------------------
  167|  11.2k|    memset(c, 0, sizeof(*c));
  168|       |
  169|  11.2k|    c->allocator = s->allocator;
  170|  11.2k|    c->logger = s->logger;
  171|  11.2k|    c->apply_grain = s->apply_grain;
  172|  11.2k|    c->operating_point = s->operating_point;
  173|  11.2k|    c->all_layers = s->all_layers;
  174|  11.2k|    c->frame_size_limit = s->frame_size_limit;
  175|  11.2k|    c->strict_std_compliance = s->strict_std_compliance;
  176|  11.2k|    c->output_invisible_frames = s->output_invisible_frames;
  177|  11.2k|    c->inloop_filters = s->inloop_filters;
  178|  11.2k|    c->decode_frame_type = s->decode_frame_type;
  179|       |
  180|  11.2k|    dav1d_data_props_set_defaults(&c->cached_error_props);
  181|       |
  182|  11.2k|    if (dav1d_mem_pool_init(ALLOC_OBU_HDR, &c->seq_hdr_pool) ||
  ------------------
  |  |  131|  22.5k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 11.2k]
  |  |  ------------------
  ------------------
  183|  11.2k|        dav1d_mem_pool_init(ALLOC_OBU_HDR, &c->frame_hdr_pool) ||
  ------------------
  |  |  131|  22.5k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 11.2k]
  |  |  ------------------
  ------------------
  184|  11.2k|        dav1d_mem_pool_init(ALLOC_SEGMAP, &c->segmap_pool) ||
  ------------------
  |  |  131|  22.5k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 11.2k]
  |  |  ------------------
  ------------------
  185|  11.2k|        dav1d_mem_pool_init(ALLOC_REFMVS, &c->refmvs_pool) ||
  ------------------
  |  |  131|  22.5k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 11.2k]
  |  |  ------------------
  ------------------
  186|  11.2k|        dav1d_mem_pool_init(ALLOC_PIC_CTX, &c->pic_ctx_pool) ||
  ------------------
  |  |  131|  22.5k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 11.2k]
  |  |  ------------------
  ------------------
  187|  11.2k|        dav1d_mem_pool_init(ALLOC_CDF, &c->cdf_pool))
  ------------------
  |  |  131|  11.2k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 11.2k]
  |  |  ------------------
  ------------------
  188|      0|    {
  189|      0|        goto error;
  190|      0|    }
  191|       |
  192|  11.2k|    if (c->allocator.alloc_picture_callback   == dav1d_default_picture_alloc &&
  ------------------
  |  Branch (192:9): [True: 11.2k, False: 0]
  ------------------
  193|  11.2k|        c->allocator.release_picture_callback == dav1d_default_picture_release)
  ------------------
  |  Branch (193:9): [True: 11.2k, False: 0]
  ------------------
  194|  11.2k|    {
  195|  11.2k|        if (c->allocator.cookie) goto error;
  ------------------
  |  Branch (195:13): [True: 0, False: 11.2k]
  ------------------
  196|  11.2k|        if (dav1d_mem_pool_init(ALLOC_PIC, &c->picture_pool)) goto error;
  ------------------
  |  |  131|  11.2k|#define dav1d_mem_pool_init(type, pool) dav1d_mem_pool_init(pool)
  |  |  ------------------
  |  |  |  Branch (131:41): [True: 0, False: 11.2k]
  |  |  ------------------
  ------------------
  197|  11.2k|        c->allocator.cookie = c->picture_pool;
  198|  11.2k|    } else if (c->allocator.alloc_picture_callback   == dav1d_default_picture_alloc ||
  ------------------
  |  Branch (198:16): [True: 0, False: 0]
  ------------------
  199|      0|               c->allocator.release_picture_callback == dav1d_default_picture_release)
  ------------------
  |  Branch (199:16): [True: 0, False: 0]
  ------------------
  200|      0|    {
  201|      0|        goto error;
  202|      0|    }
  203|       |
  204|       |    /* On 32-bit systems extremely large frame sizes can cause overflows in
  205|       |     * dav1d_decode_frame() malloc size calculations. Prevent that from occuring
  206|       |     * by enforcing a maximum frame size limit, chosen to roughly correspond to
  207|       |     * the largest size possible to decode without exhausting virtual memory. */
  208|  11.2k|    if (sizeof(size_t) < 8 && s->frame_size_limit - 1 >= 8192 * 8192) {
  ------------------
  |  Branch (208:9): [Folded, False: 11.2k]
  |  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|  11.2k|    c->flush = &c->flush_mem;
  216|  11.2k|    atomic_init(c->flush, 0);
  217|       |
  218|  11.2k|    get_num_threads(c, s, &c->n_tc, &c->n_fc);
  219|       |
  220|  11.2k|    c->fc = dav1d_alloc_aligned(ALLOC_THREAD_CTX, sizeof(*c->fc) * c->n_fc, 32);
  ------------------
  |  |  134|  11.2k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
  221|  11.2k|    if (!c->fc) goto error;
  ------------------
  |  Branch (221:9): [True: 0, False: 11.2k]
  ------------------
  222|  11.2k|    memset(c->fc, 0, sizeof(*c->fc) * c->n_fc);
  223|       |
  224|  11.2k|    c->tc = dav1d_alloc_aligned(ALLOC_THREAD_CTX, sizeof(*c->tc) * c->n_tc, 64);
  ------------------
  |  |  134|  11.2k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
  225|  11.2k|    if (!c->tc) goto error;
  ------------------
  |  Branch (225:9): [True: 0, False: 11.2k]
  ------------------
  226|  11.2k|    memset(c->tc, 0, sizeof(*c->tc) * c->n_tc);
  227|  11.2k|    if (c->n_tc > 1) {
  ------------------
  |  Branch (227:9): [True: 0, False: 11.2k]
  ------------------
  228|      0|        if (pthread_mutex_init(&c->task_thread.lock, NULL)) goto error;
  ------------------
  |  Branch (228:13): [True: 0, False: 0]
  ------------------
  229|      0|        if (pthread_cond_init(&c->task_thread.cond, NULL)) {
  ------------------
  |  Branch (229:13): [True: 0, False: 0]
  ------------------
  230|      0|            pthread_mutex_destroy(&c->task_thread.lock);
  231|      0|            goto error;
  232|      0|        }
  233|      0|        if (pthread_cond_init(&c->task_thread.delayed_fg.cond, NULL)) {
  ------------------
  |  Branch (233:13): [True: 0, False: 0]
  ------------------
  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|      0|        c->task_thread.cur = c->n_fc;
  239|      0|        atomic_init(&c->task_thread.reset_task_cur, UINT_MAX);
  240|      0|        atomic_init(&c->task_thread.cond_signaled, 0);
  241|      0|        c->task_thread.inited = 1;
  242|      0|    }
  243|       |
  244|  11.2k|    if (c->n_fc > 1) {
  ------------------
  |  Branch (244:9): [True: 0, False: 11.2k]
  ------------------
  245|      0|        const size_t out_delayed_sz = sizeof(*c->frame_thread.out_delayed) * c->n_fc;
  246|      0|        c->frame_thread.out_delayed =
  247|      0|            dav1d_malloc(ALLOC_THREAD_CTX, out_delayed_sz);
  ------------------
  |  |  132|      0|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
  248|      0|        if (!c->frame_thread.out_delayed) goto error;
  ------------------
  |  Branch (248:13): [True: 0, False: 0]
  ------------------
  249|      0|        memset(c->frame_thread.out_delayed, 0, out_delayed_sz);
  250|      0|    }
  251|  22.5k|    for (unsigned n = 0; n < c->n_fc; n++) {
  ------------------
  |  Branch (251:26): [True: 11.2k, False: 11.2k]
  ------------------
  252|  11.2k|        Dav1dFrameContext *const f = &c->fc[n];
  253|  11.2k|        if (c->n_tc > 1) {
  ------------------
  |  Branch (253:13): [True: 0, False: 11.2k]
  ------------------
  254|      0|            if (pthread_cond_init(&f->task_thread.cond, NULL)) goto error;
  ------------------
  |  Branch (254:17): [True: 0, False: 0]
  ------------------
  255|      0|        }
  256|  11.2k|        f->c = c;
  257|  11.2k|        f->task_thread.ttd = &c->task_thread;
  258|  11.2k|        f->lf.last_sharpness = -1;
  259|  11.2k|    }
  260|       |
  261|  22.5k|    for (unsigned m = 0; m < c->n_tc; m++) {
  ------------------
  |  Branch (261:26): [True: 11.2k, False: 11.2k]
  ------------------
  262|  11.2k|        Dav1dTaskContext *const t = &c->tc[m];
  263|  11.2k|        t->f = &c->fc[0];
  264|  11.2k|        t->task_thread.ttd = &c->task_thread;
  265|  11.2k|        t->c = c;
  266|  11.2k|        memset(t->cf_16bpc, 0, sizeof(t->cf_16bpc));
  267|  11.2k|        if (c->n_tc > 1) {
  ------------------
  |  Branch (267:13): [True: 0, False: 11.2k]
  ------------------
  268|      0|            if (pthread_cond_init(&t->task_thread.td.cond, NULL)) goto error;
  ------------------
  |  Branch (268:17): [True: 0, False: 0]
  ------------------
  269|      0|            if (pthread_create(&t->task_thread.td.thread, &thread_attr, dav1d_worker_task, t)) {
  ------------------
  |  Branch (269:17): [True: 0, False: 0]
  ------------------
  270|      0|                pthread_cond_destroy(&t->task_thread.td.cond);
  271|      0|                goto error;
  272|      0|            }
  273|      0|            t->task_thread.td.inited = 1;
  274|      0|        }
  275|  11.2k|    }
  276|  11.2k|    dav1d_lf_mask_dsp_init(&c->lf_mask_dsp);
  277|  11.2k|    dav1d_pal_dsp_init(&c->pal_dsp);
  278|  11.2k|    dav1d_refmvs_dsp_init(&c->refmvs_dsp);
  279|       |
  280|  11.2k|    pthread_attr_destroy(&thread_attr);
  281|       |
  282|  11.2k|    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|  11.2k|}
dav1d_send_data:
  430|  83.0k|{
  431|  83.0k|    validate_input_or_ret(c != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  83.0k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 83.0k]
  |  |  ------------------
  |  |   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|  83.0k|    validate_input_or_ret(in != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  83.0k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 83.0k]
  |  |  ------------------
  |  |   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|  83.0k|    if (in->data) {
  ------------------
  |  Branch (434:9): [True: 83.0k, False: 0]
  ------------------
  435|  83.0k|        validate_input_or_ret(in->sz > 0 && in->sz <= SIZE_MAX / 2, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|   166k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 83.0k, False: 0]
  |  |  |  Branch (52:11): [True: 83.0k, 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|  83.0k|        c->drain = 0;
  437|  83.0k|    }
  438|  83.0k|    if (c->in.data)
  ------------------
  |  Branch (438:9): [True: 3.08k, False: 79.9k]
  ------------------
  439|  3.08k|        return DAV1D_ERR(EAGAIN);
  ------------------
  |  |   58|  3.08k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  440|  79.9k|    dav1d_data_ref(&c->in, in);
  441|       |
  442|  79.9k|    int res = gen_picture(c);
  443|  79.9k|    if (!res)
  ------------------
  |  Branch (443:9): [True: 25.0k, False: 54.8k]
  ------------------
  444|  25.0k|        dav1d_data_unref_internal(in);
  445|       |
  446|  79.9k|    return res;
  447|  83.0k|}
dav1d_get_picture:
  450|  41.0k|{
  451|  41.0k|    validate_input_or_ret(c != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  41.0k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 41.0k]
  |  |  ------------------
  |  |   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|  41.0k|    validate_input_or_ret(out != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  41.0k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 41.0k]
  |  |  ------------------
  |  |   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|  41.0k|    const int drain = c->drain;
  455|  41.0k|    c->drain = 1;
  456|       |
  457|  41.0k|    int res = gen_picture(c);
  458|  41.0k|    if (res < 0)
  ------------------
  |  Branch (458:9): [True: 2.04k, False: 39.0k]
  ------------------
  459|  2.04k|        return res;
  460|       |
  461|  39.0k|    if (c->cached_error) {
  ------------------
  |  Branch (461:9): [True: 0, False: 39.0k]
  ------------------
  462|      0|        const int res = c->cached_error;
  463|      0|        c->cached_error = 0;
  464|      0|        return res;
  465|      0|    }
  466|       |
  467|  39.0k|    if (output_picture_ready(c, c->n_fc == 1))
  ------------------
  |  Branch (467:9): [True: 22.4k, False: 16.6k]
  ------------------
  468|  22.4k|        return output_image(c, out);
  469|       |
  470|  16.6k|    if (c->n_fc > 1 && drain)
  ------------------
  |  Branch (470:9): [True: 0, False: 16.6k]
  |  Branch (470:24): [True: 0, False: 0]
  ------------------
  471|      0|        return drain_picture(c, out);
  472|       |
  473|  16.6k|    return DAV1D_ERR(EAGAIN);
  ------------------
  |  |   58|  16.6k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  474|  16.6k|}
dav1d_apply_grain:
  478|  4.47k|{
  479|  4.47k|    validate_input_or_ret(c != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  4.47k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 4.47k]
  |  |  ------------------
  |  |   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.47k|    validate_input_or_ret(out != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  4.47k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 4.47k]
  |  |  ------------------
  |  |   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.47k|    validate_input_or_ret(in != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  4.47k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 4.47k]
  |  |  ------------------
  |  |   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.47k|    if (!has_grain(in)) {
  ------------------
  |  Branch (483:9): [True: 0, False: 4.47k]
  ------------------
  484|      0|        dav1d_picture_ref(out, in);
  485|      0|        return 0;
  486|      0|    }
  487|       |
  488|  4.47k|    int res = dav1d_picture_alloc_copy(c, out, in->p.w, in);
  489|  4.47k|    if (res < 0) goto error;
  ------------------
  |  Branch (489:9): [True: 0, False: 4.47k]
  ------------------
  490|       |
  491|  4.47k|    if (c->n_tc > 1) {
  ------------------
  |  Branch (491:9): [True: 0, False: 4.47k]
  ------------------
  492|      0|        dav1d_task_delayed_fg(c, out, in);
  493|  4.47k|    } else {
  494|  4.47k|        switch (out->p.bpc) {
  495|      0|#if CONFIG_8BPC
  496|  2.10k|        case 8:
  ------------------
  |  Branch (496:9): [True: 2.10k, False: 2.36k]
  ------------------
  497|  2.10k|            dav1d_apply_grain_8bpc(&c->dsp[0].fg, out, in);
  498|  2.10k|            break;
  499|      0|#endif
  500|      0|#if CONFIG_16BPC
  501|  2.10k|        case 10:
  ------------------
  |  Branch (501:9): [True: 2.10k, False: 2.36k]
  ------------------
  502|  2.36k|        case 12:
  ------------------
  |  Branch (502:9): [True: 260, False: 4.21k]
  ------------------
  503|  2.36k|            dav1d_apply_grain_16bpc(&c->dsp[(out->p.bpc >> 1) - 4].fg, out, in);
  504|  2.36k|            break;
  505|      0|#endif
  506|      0|        default: abort();
  ------------------
  |  Branch (506:9): [True: 0, False: 4.47k]
  ------------------
  507|  4.47k|        }
  508|  4.47k|    }
  509|       |
  510|  4.47k|    return 0;
  511|       |
  512|      0|error:
  513|      0|    dav1d_picture_unref_internal(out);
  514|      0|    return res;
  515|  4.47k|}
dav1d_flush:
  517|  11.2k|void dav1d_flush(Dav1dContext *const c) {
  518|  11.2k|    dav1d_data_unref_internal(&c->in);
  519|  11.2k|    if (c->out.p.frame_hdr)
  ------------------
  |  Branch (519:9): [True: 0, False: 11.2k]
  ------------------
  520|      0|        dav1d_thread_picture_unref(&c->out);
  521|  11.2k|    if (c->cache.p.frame_hdr)
  ------------------
  |  Branch (521:9): [True: 0, False: 11.2k]
  ------------------
  522|      0|        dav1d_thread_picture_unref(&c->cache);
  523|       |
  524|  11.2k|    c->drain = 0;
  525|  11.2k|    c->cached_error = 0;
  526|       |
  527|   101k|    for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (527:21): [True: 90.3k, False: 11.2k]
  ------------------
  528|  90.3k|        if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (528:13): [True: 23.3k, False: 66.9k]
  ------------------
  529|  23.3k|            dav1d_thread_picture_unref(&c->refs[i].p);
  530|  90.3k|        dav1d_ref_dec(&c->refs[i].segmap);
  531|  90.3k|        dav1d_ref_dec(&c->refs[i].refmvs);
  532|  90.3k|        dav1d_cdf_thread_unref(&c->cdf[i]);
  533|  90.3k|    }
  534|  11.2k|    c->frame_hdr = NULL;
  535|  11.2k|    c->seq_hdr = NULL;
  536|  11.2k|    dav1d_ref_dec(&c->seq_hdr_ref);
  537|       |
  538|  11.2k|    c->mastering_display = NULL;
  539|  11.2k|    c->content_light = NULL;
  540|  11.2k|    c->itut_t35 = NULL;
  541|  11.2k|    c->n_itut_t35 = 0;
  542|  11.2k|    dav1d_ref_dec(&c->mastering_display_ref);
  543|  11.2k|    dav1d_ref_dec(&c->content_light_ref);
  544|  11.2k|    dav1d_ref_dec(&c->itut_t35_ref);
  545|       |
  546|  11.2k|    dav1d_data_props_unref_internal(&c->cached_error_props);
  547|       |
  548|  11.2k|    if (c->n_fc == 1 && c->n_tc == 1) return;
  ------------------
  |  Branch (548:9): [True: 11.2k, False: 0]
  |  Branch (548:25): [True: 11.2k, False: 0]
  ------------------
  549|  11.2k|    atomic_store_explicit(c->flush, 1, memory_order_relaxed);
  550|       |
  551|      0|    if (c->n_tc > 1) {
  ------------------
  |  Branch (551:9): [True: 0, False: 0]
  ------------------
  552|      0|        pthread_mutex_lock(&c->task_thread.lock);
  553|       |        // stop running tasks in worker threads
  554|      0|        for (unsigned i = 0; i < c->n_tc; i++) {
  ------------------
  |  Branch (554:30): [True: 0, False: 0]
  ------------------
  555|      0|            Dav1dTaskContext *const tc = &c->tc[i];
  556|      0|            while (!tc->task_thread.flushed) {
  ------------------
  |  Branch (556:20): [True: 0, False: 0]
  ------------------
  557|      0|                pthread_cond_wait(&tc->task_thread.td.cond, &c->task_thread.lock);
  558|      0|            }
  559|      0|        }
  560|      0|        for (unsigned i = 0; i < c->n_fc; i++) {
  ------------------
  |  Branch (560:30): [True: 0, False: 0]
  ------------------
  561|      0|            c->fc[i].task_thread.task_head = NULL;
  562|      0|            c->fc[i].task_thread.task_tail = NULL;
  563|      0|            c->fc[i].task_thread.task_cur_prev = NULL;
  564|      0|            atomic_init(&c->fc[i].task_thread.pending_tasks, 0);
  565|      0|        }
  566|      0|        atomic_init(&c->task_thread.first, 0);
  567|      0|        c->task_thread.cur = c->n_fc;
  568|      0|        atomic_store_explicit(&c->task_thread.reset_task_cur, UINT_MAX, memory_order_relaxed);
  569|      0|        atomic_store_explicit(&c->task_thread.cond_signaled, 0, memory_order_relaxed);
  570|      0|        pthread_mutex_unlock(&c->task_thread.lock);
  571|      0|    }
  572|       |
  573|      0|    if (c->n_fc > 1) {
  ------------------
  |  Branch (573:9): [True: 0, False: 0]
  ------------------
  574|      0|        for (unsigned n = 0, next = c->frame_thread.next; n < c->n_fc; n++, next++) {
  ------------------
  |  Branch (574:59): [True: 0, False: 0]
  ------------------
  575|      0|            if (next == c->n_fc) next = 0;
  ------------------
  |  Branch (575:17): [True: 0, False: 0]
  ------------------
  576|      0|            Dav1dFrameContext *const f = &c->fc[next];
  577|      0|            dav1d_decode_frame_exit(f, -1);
  578|      0|            f->n_tile_data = 0;
  579|      0|            f->task_thread.retval = 0;
  580|      0|            atomic_store_explicit(&f->task_thread.error, 0, memory_order_relaxed);
  581|      0|            Dav1dThreadPicture *out_delayed = &c->frame_thread.out_delayed[next];
  582|      0|            if (out_delayed->p.frame_hdr) {
  ------------------
  |  Branch (582:17): [True: 0, False: 0]
  ------------------
  583|      0|                dav1d_thread_picture_unref(out_delayed);
  584|      0|            }
  585|      0|        }
  586|      0|        c->frame_thread.next = 0;
  587|      0|    }
  588|       |    atomic_store_explicit(c->flush, 0, memory_order_relaxed);
  589|      0|}
dav1d_close:
  591|  11.2k|COLD void dav1d_close(Dav1dContext **const c_out) {
  592|  11.2k|    validate_input(c_out != NULL);
  ------------------
  |  |   59|  11.2k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|  11.2k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 11.2k]
  |  |  |  |  ------------------
  |  |  |  |   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|  11.2k|    close_internal(c_out, 1);
  597|  11.2k|}
dav1d_picture_unref:
  713|  22.4k|void dav1d_picture_unref(Dav1dPicture *const p) {
  714|  22.4k|    dav1d_picture_unref_internal(p);
  715|  22.4k|}
dav1d_data_create:
  717|  80.2k|uint8_t *dav1d_data_create(Dav1dData *const buf, const size_t sz) {
  718|  80.2k|    return dav1d_data_create_internal(buf, sz);
  719|  80.2k|}
dav1d_data_unref:
  742|  55.1k|void dav1d_data_unref(Dav1dData *const buf) {
  743|  55.1k|    dav1d_data_unref_internal(buf);
  744|  55.1k|}
lib.c:get_num_threads:
  111|  11.2k|{
  112|       |    /* ceil(sqrt(n)) */
  113|  11.2k|    static const uint8_t fc_lut[49] = {
  114|  11.2k|        1,                                     /*     1 */
  115|  11.2k|        2, 2, 2,                               /*  2- 4 */
  116|  11.2k|        3, 3, 3, 3, 3,                         /*  5- 9 */
  117|  11.2k|        4, 4, 4, 4, 4, 4, 4,                   /* 10-16 */
  118|  11.2k|        5, 5, 5, 5, 5, 5, 5, 5, 5,             /* 17-25 */
  119|  11.2k|        6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,       /* 26-36 */
  120|  11.2k|        7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, /* 37-49 */
  121|  11.2k|    };
  122|  11.2k|    *n_tc = s->n_threads ? s->n_threads :
  ------------------
  |  Branch (122:13): [True: 11.2k, False: 0]
  ------------------
  123|  11.2k|        iclip(dav1d_num_logical_processors(c), 1, DAV1D_MAX_THREADS);
  ------------------
  |  |   46|      0|#define DAV1D_MAX_THREADS 256
  ------------------
  124|  11.2k|    *n_fc = s->max_frame_delay ? umin(s->max_frame_delay, *n_tc) :
  ------------------
  |  Branch (124:13): [True: 11.2k, False: 0]
  ------------------
  125|  11.2k|            *n_tc < 50 ? fc_lut[*n_tc - 1] : 8; // min(8, ceil(sqrt(n)))
  ------------------
  |  Branch (125:13): [True: 0, False: 0]
  ------------------
  126|  11.2k|}
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|  11.2k|static COLD size_t get_stack_size_internal(const pthread_attr_t *const thread_attr) {
   94|       |    /* glibc has an issue where the size of the TLS is subtracted from the stack
   95|       |     * size instead of allocated separately. As a result the specified stack
   96|       |     * size may be insufficient when used in an application with large amounts
   97|       |     * of TLS data. The following is a workaround to compensate for that.
   98|       |     * See https://sourceware.org/bugzilla/show_bug.cgi?id=11787 */
   99|  11.2k|    size_t (*const get_minstack)(const pthread_attr_t*) =
  100|  11.2k|        dlsym(RTLD_DEFAULT, "__pthread_get_minstack");
  101|  11.2k|    if (get_minstack)
  ------------------
  |  Branch (101:9): [True: 11.2k, False: 0]
  ------------------
  102|  11.2k|        return get_minstack(thread_attr) - PTHREAD_STACK_MIN;
  103|      0|    return 0;
  104|  11.2k|}
lib.c:gen_picture:
  404|   121k|{
  405|   121k|    Dav1dData *const in = &c->in;
  406|       |
  407|   121k|    if (output_picture_ready(c, 0))
  ------------------
  |  Branch (407:9): [True: 18.4k, False: 102k]
  ------------------
  408|  18.4k|        return 0;
  409|       |
  410|   138k|    while (in->sz > 0) {
  ------------------
  |  Branch (410:12): [True: 114k, False: 23.2k]
  ------------------
  411|   114k|        const ptrdiff_t res = dav1d_parse_obus(c, in);
  412|   114k|        if (res < 0) {
  ------------------
  |  Branch (412:13): [True: 56.9k, False: 57.8k]
  ------------------
  413|  56.9k|            dav1d_data_unref_internal(in);
  414|  57.8k|        } else {
  415|  57.8k|            assert((size_t)res <= in->sz);
  ------------------
  |  Branch (415:13): [True: 57.8k, False: 0]
  ------------------
  416|  57.8k|            in->sz -= res;
  417|  57.8k|            in->data += res;
  418|  57.8k|            if (!in->sz) dav1d_data_unref_internal(in);
  ------------------
  |  Branch (418:17): [True: 23.0k, False: 34.8k]
  ------------------
  419|  57.8k|        }
  420|   114k|        if (output_picture_ready(c, 0))
  ------------------
  |  Branch (420:13): [True: 22.4k, False: 92.3k]
  ------------------
  421|  22.4k|            break;
  422|  92.3k|        if (res < 0)
  ------------------
  |  Branch (422:13): [True: 56.9k, False: 35.4k]
  ------------------
  423|  56.9k|            return (int)res;
  424|  92.3k|    }
  425|       |
  426|  45.6k|    return 0;
  427|   102k|}
lib.c:output_picture_ready:
  319|   274k|static int output_picture_ready(Dav1dContext *const c, const int drain) {
  320|   274k|    if (c->cached_error) return 1;
  ------------------
  |  Branch (320:9): [True: 0, False: 274k]
  ------------------
  321|   274k|    if (!c->all_layers && c->max_spatial_id) {
  ------------------
  |  Branch (321:9): [True: 0, False: 274k]
  |  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|   274k|    return !!c->out.p.data[0];
  338|   274k|}
lib.c:output_image:
  299|  22.4k|{
  300|  22.4k|    int res = 0;
  301|       |
  302|  22.4k|    Dav1dThreadPicture *const in = (c->all_layers || !c->max_spatial_id)
  ------------------
  |  Branch (302:37): [True: 22.4k, False: 0]
  |  Branch (302:54): [True: 0, False: 0]
  ------------------
  303|  22.4k|                                   ? &c->out : &c->cache;
  304|  22.4k|    if (!c->apply_grain || !has_grain(&in->p)) {
  ------------------
  |  Branch (304:9): [True: 0, False: 22.4k]
  |  Branch (304:28): [True: 17.9k, False: 4.47k]
  ------------------
  305|  17.9k|        dav1d_picture_move_ref(out, &in->p);
  306|  17.9k|        dav1d_thread_picture_unref(in);
  307|  17.9k|        goto end;
  308|  17.9k|    }
  309|       |
  310|  4.47k|    res = dav1d_apply_grain(c, out, &in->p);
  311|  4.47k|    dav1d_thread_picture_unref(in);
  312|  22.4k|end:
  313|  22.4k|    if (!c->all_layers && c->max_spatial_id && c->out.p.data[0]) {
  ------------------
  |  Branch (313:9): [True: 0, False: 22.4k]
  |  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|  22.4k|    return res;
  317|  4.47k|}
lib.c:has_grain:
  291|  26.9k|{
  292|  26.9k|    const Dav1dFilmGrainData *fgdata = &pic->frame_hdr->film_grain.data;
  293|  26.9k|    return fgdata->num_y_points || fgdata->num_uv_points[0] ||
  ------------------
  |  Branch (293:12): [True: 4.65k, False: 22.2k]
  |  Branch (293:36): [True: 1.23k, False: 21.0k]
  ------------------
  294|  21.0k|           fgdata->num_uv_points[1] || (fgdata->clip_to_restricted_range &&
  ------------------
  |  Branch (294:12): [True: 2.19k, False: 18.8k]
  |  Branch (294:41): [True: 1.06k, False: 17.7k]
  ------------------
  295|  1.06k|                                        fgdata->chroma_scaling_from_luma);
  ------------------
  |  Branch (295:41): [True: 864, False: 205]
  ------------------
  296|  26.9k|}
lib.c:close_internal:
  599|  11.2k|static COLD void close_internal(Dav1dContext **const c_out, int flush) {
  600|  11.2k|    Dav1dContext *const c = *c_out;
  601|  11.2k|    if (!c) return;
  ------------------
  |  Branch (601:9): [True: 0, False: 11.2k]
  ------------------
  602|       |
  603|  11.2k|    if (flush) dav1d_flush(c);
  ------------------
  |  Branch (603:9): [True: 11.2k, False: 0]
  ------------------
  604|       |
  605|  11.2k|    if (c->tc) {
  ------------------
  |  Branch (605:9): [True: 11.2k, False: 0]
  ------------------
  606|  11.2k|        struct TaskThreadData *ttd = &c->task_thread;
  607|  11.2k|        if (ttd->inited) {
  ------------------
  |  Branch (607:13): [True: 0, False: 11.2k]
  ------------------
  608|      0|            pthread_mutex_lock(&ttd->lock);
  609|      0|            for (unsigned n = 0; n < c->n_tc && c->tc[n].task_thread.td.inited; n++)
  ------------------
  |  Branch (609:34): [True: 0, False: 0]
  |  Branch (609:49): [True: 0, False: 0]
  ------------------
  610|      0|                c->tc[n].task_thread.die = 1;
  611|      0|            pthread_cond_broadcast(&ttd->cond);
  612|      0|            pthread_mutex_unlock(&ttd->lock);
  613|      0|            for (unsigned n = 0; n < c->n_tc; n++) {
  ------------------
  |  Branch (613:34): [True: 0, False: 0]
  ------------------
  614|      0|                Dav1dTaskContext *const pf = &c->tc[n];
  615|      0|                if (!pf->task_thread.td.inited) break;
  ------------------
  |  Branch (615:21): [True: 0, False: 0]
  ------------------
  616|      0|                pthread_join(pf->task_thread.td.thread, NULL);
  617|      0|                pthread_cond_destroy(&pf->task_thread.td.cond);
  618|      0|            }
  619|      0|            pthread_cond_destroy(&ttd->delayed_fg.cond);
  620|      0|            pthread_cond_destroy(&ttd->cond);
  621|      0|            pthread_mutex_destroy(&ttd->lock);
  622|      0|        }
  623|  11.2k|        dav1d_free_aligned(c->tc);
  ------------------
  |  |  136|  11.2k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  624|  11.2k|    }
  625|       |
  626|  22.5k|    for (unsigned n = 0; c->fc && n < c->n_fc; n++) {
  ------------------
  |  Branch (626:26): [True: 22.5k, False: 0]
  |  Branch (626:35): [True: 11.2k, False: 11.2k]
  ------------------
  627|  11.2k|        Dav1dFrameContext *const f = &c->fc[n];
  628|       |
  629|       |        // clean-up threading stuff
  630|  11.2k|        if (c->n_fc > 1) {
  ------------------
  |  Branch (630:13): [True: 0, False: 11.2k]
  ------------------
  631|      0|            dav1d_free(f->tile_thread.lowest_pixel_mem);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
  632|      0|            dav1d_free(f->frame_thread.b);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
  633|      0|            dav1d_free_aligned(f->frame_thread.cbi);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  634|      0|            dav1d_free_aligned(f->frame_thread.pal_idx);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  635|      0|            dav1d_free_aligned(f->frame_thread.cf);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  636|      0|            dav1d_free(f->frame_thread.tile_start_off);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
  637|      0|            dav1d_free_aligned(f->frame_thread.pal);
  ------------------
  |  |  136|      0|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  638|      0|        }
  639|  11.2k|        if (c->n_tc > 1) {
  ------------------
  |  Branch (639:13): [True: 0, False: 11.2k]
  ------------------
  640|      0|            pthread_cond_destroy(&f->task_thread.cond);
  641|      0|        }
  642|  11.2k|        dav1d_free(f->frame_thread.frame_progress);
  ------------------
  |  |  135|  11.2k|#define dav1d_free(ptr) free(ptr)
  ------------------
  643|  11.2k|        dav1d_free(f->task_thread.tasks);
  ------------------
  |  |  135|  11.2k|#define dav1d_free(ptr) free(ptr)
  ------------------
  644|  11.2k|        dav1d_free(f->task_thread.tile_tasks[0]);
  ------------------
  |  |  135|  11.2k|#define dav1d_free(ptr) free(ptr)
  ------------------
  645|  11.2k|        dav1d_free_aligned(f->ts);
  ------------------
  |  |  136|  11.2k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  646|  11.2k|        dav1d_free_aligned(f->ipred_edge[0]);
  ------------------
  |  |  136|  11.2k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  647|  11.2k|        dav1d_free_aligned(f->a);
  ------------------
  |  |  136|  11.2k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  648|  11.2k|        dav1d_free(f->tile);
  ------------------
  |  |  135|  11.2k|#define dav1d_free(ptr) free(ptr)
  ------------------
  649|  11.2k|        dav1d_free(f->lf.mask);
  ------------------
  |  |  135|  11.2k|#define dav1d_free(ptr) free(ptr)
  ------------------
  650|  11.2k|        dav1d_free_aligned(f->lf.level[0]);
  ------------------
  |  |  136|  11.2k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  651|  11.2k|        dav1d_free(f->lf.lr_mask);
  ------------------
  |  |  135|  11.2k|#define dav1d_free(ptr) free(ptr)
  ------------------
  652|  11.2k|        dav1d_free(f->lf.tx_lpf_right_edge[0]);
  ------------------
  |  |  135|  11.2k|#define dav1d_free(ptr) free(ptr)
  ------------------
  653|  11.2k|        dav1d_free(f->lf.start_of_tile_row);
  ------------------
  |  |  135|  11.2k|#define dav1d_free(ptr) free(ptr)
  ------------------
  654|  11.2k|        dav1d_free_aligned(f->rf.r);
  ------------------
  |  |  136|  11.2k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  655|  11.2k|        dav1d_free_aligned(f->lf.cdef_line_buf);
  ------------------
  |  |  136|  11.2k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  656|  11.2k|        dav1d_free_aligned(f->lf.lr_line_buf);
  ------------------
  |  |  136|  11.2k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  657|  11.2k|    }
  658|  11.2k|    dav1d_free_aligned(c->fc);
  ------------------
  |  |  136|  11.2k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  659|  11.2k|    if (c->n_fc > 1 && c->frame_thread.out_delayed) {
  ------------------
  |  Branch (659:9): [True: 0, False: 11.2k]
  |  Branch (659:24): [True: 0, False: 0]
  ------------------
  660|      0|        for (unsigned n = 0; n < c->n_fc; n++)
  ------------------
  |  Branch (660:30): [True: 0, False: 0]
  ------------------
  661|      0|            if (c->frame_thread.out_delayed[n].p.frame_hdr)
  ------------------
  |  Branch (661:17): [True: 0, False: 0]
  ------------------
  662|      0|                dav1d_thread_picture_unref(&c->frame_thread.out_delayed[n]);
  663|      0|        dav1d_free(c->frame_thread.out_delayed);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
  664|      0|    }
  665|  11.3k|    for (int n = 0; n < c->n_tile_data; n++)
  ------------------
  |  Branch (665:21): [True: 108, False: 11.2k]
  ------------------
  666|    108|        dav1d_data_unref_internal(&c->tile[n].data);
  667|  11.2k|    dav1d_free(c->tile);
  ------------------
  |  |  135|  11.2k|#define dav1d_free(ptr) free(ptr)
  ------------------
  668|   101k|    for (int n = 0; n < 8; n++) {
  ------------------
  |  Branch (668:21): [True: 90.3k, False: 11.2k]
  ------------------
  669|  90.3k|        dav1d_cdf_thread_unref(&c->cdf[n]);
  670|  90.3k|        if (c->refs[n].p.p.frame_hdr)
  ------------------
  |  Branch (670:13): [True: 0, False: 90.3k]
  ------------------
  671|      0|            dav1d_thread_picture_unref(&c->refs[n].p);
  672|  90.3k|        dav1d_ref_dec(&c->refs[n].refmvs);
  673|  90.3k|        dav1d_ref_dec(&c->refs[n].segmap);
  674|  90.3k|    }
  675|  11.2k|    dav1d_ref_dec(&c->seq_hdr_ref);
  676|  11.2k|    dav1d_ref_dec(&c->frame_hdr_ref);
  677|       |
  678|  11.2k|    dav1d_ref_dec(&c->mastering_display_ref);
  679|  11.2k|    dav1d_ref_dec(&c->content_light_ref);
  680|  11.2k|    dav1d_ref_dec(&c->itut_t35_ref);
  681|       |
  682|  11.2k|    dav1d_mem_pool_end(c->seq_hdr_pool);
  683|  11.2k|    dav1d_mem_pool_end(c->frame_hdr_pool);
  684|  11.2k|    dav1d_mem_pool_end(c->segmap_pool);
  685|  11.2k|    dav1d_mem_pool_end(c->refmvs_pool);
  686|  11.2k|    dav1d_mem_pool_end(c->cdf_pool);
  687|  11.2k|    dav1d_mem_pool_end(c->picture_pool);
  688|  11.2k|    dav1d_mem_pool_end(c->pic_ctx_pool);
  689|       |
  690|  11.2k|    dav1d_freep_aligned(c_out);
  691|  11.2k|}

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

dav1d_loop_restoration_dsp_init_8bpc:
 1361|  3.82k|{
 1362|  3.82k|    c->wiener[0] = c->wiener[1] = wiener_c;
 1363|  3.82k|    c->sgr[0] = sgr_5x5_c;
 1364|  3.82k|    c->sgr[1] = sgr_3x3_c;
 1365|  3.82k|    c->sgr[2] = sgr_mix_c;
 1366|       |
 1367|  3.82k|#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|  3.82k|#endif
 1377|  3.82k|#endif
 1378|  3.82k|}
looprestoration_tmpl.c:sgr_5x5_c:
  824|  5.52k|{
  825|  5.52k|    ALIGN_STK_16(int32_t, sumsq_buf, BUF_STRIDE * 5 + 16,);
  ------------------
  |  |  100|  5.52k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  5.52k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  826|  5.52k|    ALIGN_STK_16(coef, sum_buf, BUF_STRIDE * 5 + 16,);
  ------------------
  |  |  100|  5.52k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  5.52k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  827|  5.52k|    int32_t *sumsq_ptrs[5], *sumsq_rows[5];
  828|  5.52k|    coef *sum_ptrs[5], *sum_rows[5];
  829|  33.1k|    for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (829:21): [True: 27.6k, False: 5.52k]
  ------------------
  830|  27.6k|        sumsq_rows[i] = &sumsq_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  27.6k|#define BUF_STRIDE (384 + 16)
  ------------------
  831|  27.6k|        sum_rows[i] = &sum_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  27.6k|#define BUF_STRIDE (384 + 16)
  ------------------
  832|  27.6k|    }
  833|       |
  834|  5.52k|    ALIGN_STK_16(int32_t, A_buf, BUF_STRIDE * 2 + 16,);
  ------------------
  |  |  100|  5.52k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  5.52k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  835|  5.52k|    ALIGN_STK_16(coef, B_buf, BUF_STRIDE * 2 + 16,);
  ------------------
  |  |  100|  5.52k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  5.52k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  836|  5.52k|    int32_t *A_ptrs[2];
  837|  5.52k|    coef *B_ptrs[2];
  838|  16.5k|    for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (838:21): [True: 11.0k, False: 5.52k]
  ------------------
  839|  11.0k|        A_ptrs[i] = &A_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  11.0k|#define BUF_STRIDE (384 + 16)
  ------------------
  840|  11.0k|        B_ptrs[i] = &B_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  11.0k|#define BUF_STRIDE (384 + 16)
  ------------------
  841|  11.0k|    }
  842|  5.52k|    const pixel *src = dst;
  843|  5.52k|    const pixel *lpf_bottom = lpf + 6*PXSTRIDE(stride);
  ------------------
  |  |   53|  5.52k|#define PXSTRIDE(x) (x)
  ------------------
  844|       |
  845|  5.52k|    if (edges & LR_HAVE_TOP) {
  ------------------
  |  Branch (845:9): [True: 2.83k, False: 2.68k]
  ------------------
  846|  2.83k|        sumsq_ptrs[0] = sumsq_rows[0];
  847|  2.83k|        sumsq_ptrs[1] = sumsq_rows[0];
  848|  2.83k|        sumsq_ptrs[2] = sumsq_rows[1];
  849|  2.83k|        sumsq_ptrs[3] = sumsq_rows[2];
  850|  2.83k|        sumsq_ptrs[4] = sumsq_rows[3];
  851|  2.83k|        sum_ptrs[0] = sum_rows[0];
  852|  2.83k|        sum_ptrs[1] = sum_rows[0];
  853|  2.83k|        sum_ptrs[2] = sum_rows[1];
  854|  2.83k|        sum_ptrs[3] = sum_rows[2];
  855|  2.83k|        sum_ptrs[4] = sum_rows[3];
  856|       |
  857|  2.83k|        sgr_box5_row_h(sumsq_rows[0], sum_rows[0], NULL, lpf, w, edges);
  858|  2.83k|        lpf += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.83k|#define PXSTRIDE(x) (x)
  ------------------
  859|  2.83k|        sgr_box5_row_h(sumsq_rows[1], sum_rows[1], NULL, lpf, w, edges);
  860|       |
  861|  2.83k|        sgr_box5_row_h(sumsq_rows[2], sum_rows[2], left, src, w, edges);
  862|  2.83k|        left++;
  863|  2.83k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.83k|#define PXSTRIDE(x) (x)
  ------------------
  864|       |
  865|  2.83k|        if (--h <= 0)
  ------------------
  |  Branch (865:13): [True: 283, False: 2.54k]
  ------------------
  866|    283|            goto vert_1;
  867|       |
  868|  2.54k|        sgr_box5_row_h(sumsq_rows[3], sum_rows[3], left, src, w, edges);
  869|  2.54k|        left++;
  870|  2.54k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.54k|#define PXSTRIDE(x) (x)
  ------------------
  871|  2.54k|        sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
  872|  2.54k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.54k|#define BITDEPTH_MAX 0xff
  ------------------
  873|  2.54k|        rotate(A_ptrs, B_ptrs, 2);
  874|       |
  875|  2.54k|        if (--h <= 0)
  ------------------
  |  Branch (875:13): [True: 335, False: 2.21k]
  ------------------
  876|    335|            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|  2.21k|        sumsq_ptrs[3] = sumsq_rows[4];
  881|  2.21k|        sum_ptrs[3] = sum_rows[4];
  882|  2.68k|    } else {
  883|  2.68k|        sumsq_ptrs[0] = sumsq_rows[0];
  884|  2.68k|        sumsq_ptrs[1] = sumsq_rows[0];
  885|  2.68k|        sumsq_ptrs[2] = sumsq_rows[0];
  886|  2.68k|        sumsq_ptrs[3] = sumsq_rows[0];
  887|  2.68k|        sumsq_ptrs[4] = sumsq_rows[0];
  888|  2.68k|        sum_ptrs[0] = sum_rows[0];
  889|  2.68k|        sum_ptrs[1] = sum_rows[0];
  890|  2.68k|        sum_ptrs[2] = sum_rows[0];
  891|  2.68k|        sum_ptrs[3] = sum_rows[0];
  892|  2.68k|        sum_ptrs[4] = sum_rows[0];
  893|       |
  894|  2.68k|        sgr_box5_row_h(sumsq_rows[0], sum_rows[0], left, src, w, edges);
  895|  2.68k|        left++;
  896|  2.68k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.68k|#define PXSTRIDE(x) (x)
  ------------------
  897|       |
  898|  2.68k|        if (--h <= 0)
  ------------------
  |  Branch (898:13): [True: 343, False: 2.34k]
  ------------------
  899|    343|            goto vert_1;
  900|       |
  901|  2.34k|        sumsq_ptrs[4] = sumsq_rows[1];
  902|  2.34k|        sum_ptrs[4] = sum_rows[1];
  903|       |
  904|  2.34k|        sgr_box5_row_h(sumsq_rows[1], sum_rows[1], left, src, w, edges);
  905|  2.34k|        left++;
  906|  2.34k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.34k|#define PXSTRIDE(x) (x)
  ------------------
  907|       |
  908|  2.34k|        sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
  909|  2.34k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.34k|#define BITDEPTH_MAX 0xff
  ------------------
  910|  2.34k|        rotate(A_ptrs, B_ptrs, 2);
  911|       |
  912|  2.34k|        if (--h <= 0)
  ------------------
  |  Branch (912:13): [True: 306, False: 2.03k]
  ------------------
  913|    306|            goto vert_2;
  914|       |
  915|  2.03k|        sumsq_ptrs[3] = sumsq_rows[2];
  916|  2.03k|        sumsq_ptrs[4] = sumsq_rows[3];
  917|  2.03k|        sum_ptrs[3] = sum_rows[2];
  918|  2.03k|        sum_ptrs[4] = sum_rows[3];
  919|       |
  920|  2.03k|        sgr_box5_row_h(sumsq_rows[2], sum_rows[2], left, src, w, edges);
  921|  2.03k|        left++;
  922|  2.03k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.03k|#define PXSTRIDE(x) (x)
  ------------------
  923|       |
  924|  2.03k|        if (--h <= 0)
  ------------------
  |  Branch (924:13): [True: 275, False: 1.76k]
  ------------------
  925|    275|            goto odd;
  926|       |
  927|  1.76k|        sgr_box5_row_h(sumsq_rows[3], sum_rows[3], left, src, w, edges);
  928|  1.76k|        left++;
  929|  1.76k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  1.76k|#define PXSTRIDE(x) (x)
  ------------------
  930|       |
  931|  1.76k|        sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
  932|  1.76k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.76k|#define BITDEPTH_MAX 0xff
  ------------------
  933|  1.76k|        sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
  934|  1.76k|                    w, 2, params->sgr.w0 HIGHBD_TAIL_SUFFIX);
  935|       |
  936|  1.76k|        if (--h <= 0)
  ------------------
  |  Branch (936:13): [True: 288, False: 1.47k]
  ------------------
  937|    288|            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.47k|        sumsq_ptrs[3] = sumsq_rows[4];
  942|  1.47k|        sum_ptrs[3] = sum_rows[4];
  943|  1.47k|    }
  944|       |
  945|  92.2k|    do {
  946|  92.2k|        sgr_box5_row_h(sumsq_ptrs[3], sum_ptrs[3], left, src, w, edges);
  947|  92.2k|        left++;
  948|  92.2k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  92.2k|#define PXSTRIDE(x) (x)
  ------------------
  949|       |
  950|  92.2k|        if (--h <= 0)
  ------------------
  |  Branch (950:13): [True: 394, False: 91.8k]
  ------------------
  951|    394|            goto odd;
  952|       |
  953|  91.8k|        sgr_box5_row_h(sumsq_ptrs[4], sum_ptrs[4], left, src, w, edges);
  954|  91.8k|        left++;
  955|  91.8k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  91.8k|#define PXSTRIDE(x) (x)
  ------------------
  956|       |
  957|  91.8k|        sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
  958|  91.8k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  91.8k|#define BITDEPTH_MAX 0xff
  ------------------
  959|  91.8k|        sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
  960|  91.8k|                    w, 2, params->sgr.w0 HIGHBD_TAIL_SUFFIX);
  961|  91.8k|    } while (--h > 0);
  ------------------
  |  Branch (961:14): [True: 88.5k, False: 3.29k]
  ------------------
  962|       |
  963|  3.29k|    if (!(edges & LR_HAVE_BOTTOM))
  ------------------
  |  Branch (963:9): [True: 348, False: 2.94k]
  ------------------
  964|    348|        goto vert_2;
  965|       |
  966|  2.94k|    sgr_box5_row_h(sumsq_ptrs[3], sum_ptrs[3], NULL, lpf_bottom, w, edges);
  967|  2.94k|    lpf_bottom += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.94k|#define PXSTRIDE(x) (x)
  ------------------
  968|  2.94k|    sgr_box5_row_h(sumsq_ptrs[4], sum_ptrs[4], NULL, lpf_bottom, w, edges);
  969|       |
  970|  4.22k|output_2:
  971|  4.22k|    sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
  972|  4.22k|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  4.22k|#define BITDEPTH_MAX 0xff
  ------------------
  973|  4.22k|    sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
  974|  4.22k|                w, 2, params->sgr.w0 HIGHBD_TAIL_SUFFIX);
  975|  4.22k|    return;
  976|       |
  977|  1.27k|vert_2:
  978|       |    // Duplicate the last row twice more
  979|  1.27k|    sumsq_ptrs[3] = sumsq_ptrs[2];
  980|  1.27k|    sumsq_ptrs[4] = sumsq_ptrs[2];
  981|  1.27k|    sum_ptrs[3] = sum_ptrs[2];
  982|  1.27k|    sum_ptrs[4] = sum_ptrs[2];
  983|  1.27k|    goto output_2;
  984|       |
  985|    669|odd:
  986|       |    // Copy the last row as padding once
  987|    669|    sumsq_ptrs[4] = sumsq_ptrs[3];
  988|    669|    sum_ptrs[4] = sum_ptrs[3];
  989|       |
  990|    669|    sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
  991|    669|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|    669|#define BITDEPTH_MAX 0xff
  ------------------
  992|    669|    sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
  993|    669|                w, 2, params->sgr.w0 HIGHBD_TAIL_SUFFIX);
  994|       |
  995|  1.29k|output_1:
  996|       |    // Duplicate the last row twice more
  997|  1.29k|    sumsq_ptrs[3] = sumsq_ptrs[2];
  998|  1.29k|    sumsq_ptrs[4] = sumsq_ptrs[2];
  999|  1.29k|    sum_ptrs[3] = sum_ptrs[2];
 1000|  1.29k|    sum_ptrs[4] = sum_ptrs[2];
 1001|       |
 1002|  1.29k|    sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
 1003|  1.29k|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.29k|#define BITDEPTH_MAX 0xff
  ------------------
 1004|       |    // Output only one row
 1005|  1.29k|    sgr_finish2(&dst, stride, A_ptrs, B_ptrs,
 1006|  1.29k|                w, 1, params->sgr.w0 HIGHBD_TAIL_SUFFIX);
 1007|  1.29k|    return;
 1008|       |
 1009|    626|vert_1:
 1010|       |    // Copy the last row as padding once
 1011|    626|    sumsq_ptrs[4] = sumsq_ptrs[3];
 1012|    626|    sum_ptrs[4] = sum_ptrs[3];
 1013|       |
 1014|    626|    sgr_box5_vert(sumsq_ptrs, sum_ptrs, A_ptrs[1], B_ptrs[1],
 1015|    626|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|    626|#define BITDEPTH_MAX 0xff
  ------------------
 1016|    626|    rotate(A_ptrs, B_ptrs, 2);
 1017|       |
 1018|    626|    goto output_1;
 1019|    669|}
looprestoration_tmpl.c:sgr_box5_row_h:
  435|   408k|{
  436|   408k|    sumsq++;
  437|   408k|    sum++;
  438|   408k|    int a = edges & LR_HAVE_LEFT ? (left ? left[0][1] : src[-3]) : src[0];
  ------------------
  |  Branch (438:13): [True: 330k, False: 77.8k]
  |  Branch (438:37): [True: 313k, False: 17.5k]
  ------------------
  439|   408k|    int b = edges & LR_HAVE_LEFT ? (left ? left[0][2] : src[-2]) : src[0];
  ------------------
  |  Branch (439:13): [True: 330k, False: 77.8k]
  |  Branch (439:37): [True: 313k, False: 17.5k]
  ------------------
  440|   408k|    int c = edges & LR_HAVE_LEFT ? (left ? left[0][3] : src[-1]) : src[0];
  ------------------
  |  Branch (440:13): [True: 330k, False: 77.8k]
  |  Branch (440:37): [True: 313k, False: 17.5k]
  ------------------
  441|   408k|    int d = src[0];
  442|  47.5M|    for (int x = -1; x < w + 1; x++) {
  ------------------
  |  Branch (442:22): [True: 47.1M, False: 408k]
  ------------------
  443|  47.1M|        int e = (x + 2 < w || (edges & LR_HAVE_RIGHT)) ? src[x + 2] : src[w - 1];
  ------------------
  |  Branch (443:18): [True: 45.9M, False: 1.22M]
  |  Branch (443:31): [True: 987k, False: 238k]
  ------------------
  444|  47.1M|        sum[x] = a + b + c + d + e;
  445|  47.1M|        sumsq[x] = a * a + b * b + c * c + d * d + e * e;
  446|  47.1M|        a = b;
  447|  47.1M|        b = c;
  448|  47.1M|        c = d;
  449|  47.1M|        d = e;
  450|  47.1M|    }
  451|   408k|}
looprestoration_tmpl.c:sgr_box5_vert:
  531|   205k|{
  532|   205k|    sgr_box5_row_v(sumsq, sum, sumsq_out, sum_out, w);
  533|   205k|    sgr_calc_row_ab(sumsq_out, sum_out, w, s, bitdepth_max, 25, 164);
  534|   205k|    rotate5_x2(sumsq, sum);
  535|   205k|}
looprestoration_tmpl.c:sgr_box5_row_v:
  482|   205k|{
  483|  23.7M|    for (int x = 0; x < w + 2; x++) {
  ------------------
  |  Branch (483:21): [True: 23.5M, False: 205k]
  ------------------
  484|  23.5M|        int sq_a = sumsq[0][x];
  485|  23.5M|        int sq_b = sumsq[1][x];
  486|  23.5M|        int sq_c = sumsq[2][x];
  487|  23.5M|        int sq_d = sumsq[3][x];
  488|  23.5M|        int sq_e = sumsq[4][x];
  489|  23.5M|        int s_a = sum[0][x];
  490|  23.5M|        int s_b = sum[1][x];
  491|  23.5M|        int s_c = sum[2][x];
  492|  23.5M|        int s_d = sum[3][x];
  493|  23.5M|        int s_e = sum[4][x];
  494|  23.5M|        sumsq_out[x] = sq_a + sq_b + sq_c + sq_d + sq_e;
  495|  23.5M|        sum_out[x] = s_a + s_b + s_c + s_d + s_e;
  496|  23.5M|    }
  497|   205k|}
looprestoration_tmpl.c:sgr_calc_row_ab:
  501|   512k|{
  502|   512k|    const int bitdepth_min_8 = bitdepth_from_max(bitdepth_max) - 8;
  ------------------
  |  |   58|   512k|#define bitdepth_from_max(x) 8
  ------------------
  503|  56.1M|    for (int i = 0; i < w + 2; i++) {
  ------------------
  |  Branch (503:21): [True: 55.6M, False: 512k]
  ------------------
  504|  55.6M|        const int a =
  505|  55.6M|            (AA[i] + ((1 << (2 * bitdepth_min_8)) >> 1)) >> (2 * bitdepth_min_8);
  506|  55.6M|        const int b =
  507|  55.6M|            (BB[i] + ((1 << bitdepth_min_8) >> 1)) >> bitdepth_min_8;
  508|       |
  509|  55.6M|        const unsigned p = imax(a * n - b * b, 0);
  510|  55.6M|        const unsigned z = (p * s + (1 << 19)) >> 20;
  511|  55.6M|        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|  55.6M|        AA[i] = (x * BB[i] * sgr_one_by_x + (1 << 11)) >> 12;
  515|  55.6M|        BB[i] = x;
  516|  55.6M|    }
  517|   512k|}
looprestoration_tmpl.c:rotate5_x2:
  402|   205k|{
  403|   205k|    int32_t *tmp32[2];
  404|   205k|    coef *tmpc[2];
  405|   205k|    memcpy(tmp32, sumsq_ptrs, 2 * sizeof(int32_t*));
  406|   205k|    memcpy(tmpc, sum_ptrs, 2 * sizeof(coef*));
  407|   205k|    memmove(&sumsq_ptrs[0], &sumsq_ptrs[2], 3 * sizeof(int32_t*));
  408|   205k|    memmove(&sum_ptrs[0], &sum_ptrs[2], 3 * sizeof(coef*));
  409|   205k|    memcpy(&sumsq_ptrs[3], tmp32, 2 * sizeof(int32_t*));
  410|   205k|    memcpy(&sum_ptrs[3], tmpc, 2 * sizeof(coef*));
  411|   205k|}
looprestoration_tmpl.c:rotate:
  390|   821k|{
  391|   821k|    int32_t *tmp32 = sumsq_ptrs[0];
  392|   821k|    coef *tmpc = sum_ptrs[0];
  393|  2.46M|    for (int i = 0; i < n - 1; i++) {
  ------------------
  |  Branch (393:21): [True: 1.63M, False: 821k]
  ------------------
  394|  1.63M|        sumsq_ptrs[i] = sumsq_ptrs[i + 1];
  395|  1.63M|        sum_ptrs[i] = sum_ptrs[i + 1];
  396|  1.63M|    }
  397|   821k|    sumsq_ptrs[n - 1] = tmp32;
  398|   821k|    sum_ptrs[n - 1] = tmpc;
  399|   821k|}
looprestoration_tmpl.c:sgr_finish2:
  639|  99.8k|{
  640|  99.8k|    ALIGN_STK_16(coef, tmp, 2*FILTER_OUT_STRIDE,);
  ------------------
  |  |  100|  99.8k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  99.8k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  641|       |
  642|  99.8k|    sgr_finish_filter2(tmp, *dst, stride, A_ptrs, B_ptrs, w, h);
  643|  99.8k|    sgr_weighted_row1(*dst, tmp, w, w1 HIGHBD_TAIL_SUFFIX);
  644|  99.8k|    *dst += PXSTRIDE(stride);
  ------------------
  |  |   53|  99.8k|#define PXSTRIDE(x) (x)
  ------------------
  645|  99.8k|    if (h > 1) {
  ------------------
  |  Branch (645:9): [True: 98.5k, False: 1.29k]
  ------------------
  646|  98.5k|        sgr_weighted_row1(*dst, tmp + FILTER_OUT_STRIDE, w, w1 HIGHBD_TAIL_SUFFIX);
  ------------------
  |  |  566|  98.5k|#define FILTER_OUT_STRIDE (384)
  ------------------
  647|  98.5k|        *dst += PXSTRIDE(stride);
  ------------------
  |  |   53|  98.5k|#define PXSTRIDE(x) (x)
  ------------------
  648|  98.5k|    }
  649|  99.8k|    rotate(A_ptrs, B_ptrs, 2);
  650|  99.8k|}
looprestoration_tmpl.c:sgr_finish_filter2:
  573|   194k|{
  574|   194k|#define SIX_NEIGHBORS(P, i)\
  575|   194k|    ((P[0][i]     + P[1][i]) * 6 +   \
  576|   194k|     (P[0][i - 1] + P[1][i - 1] +    \
  577|   194k|      P[0][i + 1] + P[1][i + 1]) * 5)
  578|  22.2M|    for (int i = 0; i < w; i++) {
  ------------------
  |  Branch (578:21): [True: 22.0M, False: 194k]
  ------------------
  579|  22.0M|        const int a = SIX_NEIGHBORS(B_ptrs, i + 1);
  ------------------
  |  |  575|  22.0M|    ((P[0][i]     + P[1][i]) * 6 +   \
  |  |  576|  22.0M|     (P[0][i - 1] + P[1][i - 1] +    \
  |  |  577|  22.0M|      P[0][i + 1] + P[1][i + 1]) * 5)
  ------------------
  580|  22.0M|        const int b = SIX_NEIGHBORS(A_ptrs, i + 1);
  ------------------
  |  |  575|  22.0M|    ((P[0][i]     + P[1][i]) * 6 +   \
  |  |  576|  22.0M|     (P[0][i - 1] + P[1][i - 1] +    \
  |  |  577|  22.0M|      P[0][i + 1] + P[1][i + 1]) * 5)
  ------------------
  581|  22.0M|        tmp[i] = (b - a * src[i] + (1 << 8)) >> 9;
  582|  22.0M|    }
  583|   194k|    if (h <= 1)
  ------------------
  |  Branch (583:9): [True: 2.88k, False: 191k]
  ------------------
  584|  2.88k|        return;
  585|   191k|    tmp += FILTER_OUT_STRIDE;
  ------------------
  |  |  566|   191k|#define FILTER_OUT_STRIDE (384)
  ------------------
  586|   191k|    src += PXSTRIDE(src_stride);
  ------------------
  |  |   53|   191k|#define PXSTRIDE(x) (x)
  ------------------
  587|   191k|    const int32_t *A = &A_ptrs[1][1];
  588|   191k|    const coef *B = &B_ptrs[1][1];
  589|  21.9M|    for (int i = 0; i < w; i++) {
  ------------------
  |  Branch (589:21): [True: 21.7M, False: 191k]
  ------------------
  590|  21.7M|        const int a = B[i] * 6 + (B[i - 1] + B[i + 1]) * 5;
  591|  21.7M|        const int b = A[i] * 6 + (A[i - 1] + A[i + 1]) * 5;
  592|  21.7M|        tmp[i] = (b - a * src[i] + (1 << 7)) >> 8;
  593|  21.7M|    }
  594|   191k|#undef SIX_NEIGHBORS
  595|   191k|}
looprestoration_tmpl.c:sgr_weighted_row1:
  599|   299k|{
  600|  35.5M|    for (int i = 0; i < w; i++) {
  ------------------
  |  Branch (600:21): [True: 35.2M, False: 299k]
  ------------------
  601|  35.2M|        const int v = w1 * t1[i];
  602|  35.2M|        dst[i] = iclip_pixel(dst[i] + ((v + (1 << 10)) >> 11));
  ------------------
  |  |   49|  35.2M|#define iclip_pixel iclip_u8
  ------------------
  603|  35.2M|    }
  604|   299k|}
looprestoration_tmpl.c:sgr_3x3_c:
  678|  3.30k|{
  679|  3.30k|#define BUF_STRIDE (384 + 16)
  680|  3.30k|    ALIGN_STK_16(int32_t, sumsq_buf, BUF_STRIDE * 3 + 16,);
  ------------------
  |  |  100|  3.30k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  3.30k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  681|  3.30k|    ALIGN_STK_16(coef, sum_buf, BUF_STRIDE * 3 + 16,);
  ------------------
  |  |  100|  3.30k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  3.30k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  682|  3.30k|    int32_t *sumsq_ptrs[3], *sumsq_rows[3];
  683|  3.30k|    coef *sum_ptrs[3], *sum_rows[3];
  684|  13.2k|    for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (684:21): [True: 9.92k, False: 3.30k]
  ------------------
  685|  9.92k|        sumsq_rows[i] = &sumsq_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  9.92k|#define BUF_STRIDE (384 + 16)
  ------------------
  686|  9.92k|        sum_rows[i] = &sum_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  9.92k|#define BUF_STRIDE (384 + 16)
  ------------------
  687|  9.92k|    }
  688|       |
  689|  3.30k|    ALIGN_STK_16(int32_t, A_buf, BUF_STRIDE * 3 + 16,);
  ------------------
  |  |  100|  3.30k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  3.30k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  690|  3.30k|    ALIGN_STK_16(coef, B_buf, BUF_STRIDE * 3 + 16,);
  ------------------
  |  |  100|  3.30k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  3.30k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  691|  3.30k|    int32_t *A_ptrs[3];
  692|  3.30k|    coef *B_ptrs[3];
  693|  13.2k|    for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (693:21): [True: 9.92k, False: 3.30k]
  ------------------
  694|  9.92k|        A_ptrs[i] = &A_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  9.92k|#define BUF_STRIDE (384 + 16)
  ------------------
  695|  9.92k|        B_ptrs[i] = &B_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  9.92k|#define BUF_STRIDE (384 + 16)
  ------------------
  696|  9.92k|    }
  697|  3.30k|    const pixel *src = dst;
  698|  3.30k|    const pixel *lpf_bottom = lpf + 6*PXSTRIDE(stride);
  ------------------
  |  |   53|  3.30k|#define PXSTRIDE(x) (x)
  ------------------
  699|       |
  700|  3.30k|    if (edges & LR_HAVE_TOP) {
  ------------------
  |  Branch (700:9): [True: 1.56k, False: 1.74k]
  ------------------
  701|  1.56k|        sumsq_ptrs[0] = sumsq_rows[0];
  702|  1.56k|        sumsq_ptrs[1] = sumsq_rows[1];
  703|  1.56k|        sumsq_ptrs[2] = sumsq_rows[2];
  704|  1.56k|        sum_ptrs[0] = sum_rows[0];
  705|  1.56k|        sum_ptrs[1] = sum_rows[1];
  706|  1.56k|        sum_ptrs[2] = sum_rows[2];
  707|       |
  708|  1.56k|        sgr_box3_row_h(sumsq_rows[0], sum_rows[0], NULL, lpf, w, edges);
  709|  1.56k|        lpf += PXSTRIDE(stride);
  ------------------
  |  |   53|  1.56k|#define PXSTRIDE(x) (x)
  ------------------
  710|  1.56k|        sgr_box3_row_h(sumsq_rows[1], sum_rows[1], NULL, lpf, w, edges);
  711|       |
  712|  1.56k|        sgr_box3_hv(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  713|  1.56k|                    left, src, w, params->sgr.s1, edges, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.56k|#define BITDEPTH_MAX 0xff
  ------------------
  714|  1.56k|        left++;
  715|  1.56k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  1.56k|#define PXSTRIDE(x) (x)
  ------------------
  716|  1.56k|        rotate(A_ptrs, B_ptrs, 3);
  717|       |
  718|  1.56k|        if (--h <= 0)
  ------------------
  |  Branch (718:13): [True: 406, False: 1.15k]
  ------------------
  719|    406|            goto vert_1;
  720|       |
  721|  1.15k|        sgr_box3_hv(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  722|  1.15k|                    left, src, w, params->sgr.s1, edges, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.15k|#define BITDEPTH_MAX 0xff
  ------------------
  723|  1.15k|        left++;
  724|  1.15k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  1.15k|#define PXSTRIDE(x) (x)
  ------------------
  725|  1.15k|        rotate(A_ptrs, B_ptrs, 3);
  726|       |
  727|  1.15k|        if (--h <= 0)
  ------------------
  |  Branch (727:13): [True: 154, False: 1.00k]
  ------------------
  728|    154|            goto vert_2;
  729|  1.74k|    } else {
  730|  1.74k|        sumsq_ptrs[0] = sumsq_rows[0];
  731|  1.74k|        sumsq_ptrs[1] = sumsq_rows[0];
  732|  1.74k|        sumsq_ptrs[2] = sumsq_rows[0];
  733|  1.74k|        sum_ptrs[0] = sum_rows[0];
  734|  1.74k|        sum_ptrs[1] = sum_rows[0];
  735|  1.74k|        sum_ptrs[2] = sum_rows[0];
  736|       |
  737|  1.74k|        sgr_box3_row_h(sumsq_rows[0], sum_rows[0], left, src, w, edges);
  738|  1.74k|        left++;
  739|  1.74k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  1.74k|#define PXSTRIDE(x) (x)
  ------------------
  740|       |
  741|  1.74k|        sgr_box3_vert(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  742|  1.74k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.74k|#define BITDEPTH_MAX 0xff
  ------------------
  743|  1.74k|        rotate(A_ptrs, B_ptrs, 3);
  744|       |
  745|  1.74k|        if (--h <= 0)
  ------------------
  |  Branch (745:13): [True: 291, False: 1.45k]
  ------------------
  746|    291|            goto vert_1;
  747|       |
  748|  1.45k|        sumsq_ptrs[2] = sumsq_rows[1];
  749|  1.45k|        sum_ptrs[2] = sum_rows[1];
  750|       |
  751|  1.45k|        sgr_box3_hv(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  752|  1.45k|                    left, src, w, params->sgr.s1, edges, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.45k|#define BITDEPTH_MAX 0xff
  ------------------
  753|  1.45k|        left++;
  754|  1.45k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  1.45k|#define PXSTRIDE(x) (x)
  ------------------
  755|  1.45k|        rotate(A_ptrs, B_ptrs, 3);
  756|       |
  757|  1.45k|        if (--h <= 0)
  ------------------
  |  Branch (757:13): [True: 167, False: 1.28k]
  ------------------
  758|    167|            goto vert_2;
  759|       |
  760|  1.28k|        sumsq_ptrs[2] = sumsq_rows[2];
  761|  1.28k|        sum_ptrs[2] = sum_rows[2];
  762|  1.28k|    }
  763|       |
  764|  95.1k|    do {
  765|  95.1k|        sgr_box3_hv(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  766|  95.1k|                    left, src, w, params->sgr.s1, edges, BITDEPTH_MAX);
  ------------------
  |  |   59|  95.1k|#define BITDEPTH_MAX 0xff
  ------------------
  767|  95.1k|        left++;
  768|  95.1k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  95.1k|#define PXSTRIDE(x) (x)
  ------------------
  769|       |
  770|  95.1k|        sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
  771|  95.1k|                    w, params->sgr.w1 HIGHBD_TAIL_SUFFIX);
  772|  95.1k|    } while (--h > 0);
  ------------------
  |  Branch (772:14): [True: 92.8k, False: 2.28k]
  ------------------
  773|       |
  774|  2.28k|    if (!(edges & LR_HAVE_BOTTOM))
  ------------------
  |  Branch (774:9): [True: 637, False: 1.65k]
  ------------------
  775|    637|        goto vert_2;
  776|       |
  777|  1.65k|    sgr_box3_hv(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  778|  1.65k|                NULL, lpf_bottom, w, params->sgr.s1, edges, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.65k|#define BITDEPTH_MAX 0xff
  ------------------
  779|  1.65k|    lpf_bottom += PXSTRIDE(stride);
  ------------------
  |  |   53|  1.65k|#define PXSTRIDE(x) (x)
  ------------------
  780|       |
  781|  1.65k|    sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
  782|  1.65k|                w, params->sgr.w1 HIGHBD_TAIL_SUFFIX);
  783|       |
  784|  1.65k|    sgr_box3_hv(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  785|  1.65k|                NULL, lpf_bottom, w, params->sgr.s1, edges, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.65k|#define BITDEPTH_MAX 0xff
  ------------------
  786|       |
  787|  1.65k|    sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
  788|  1.65k|                w, params->sgr.w1 HIGHBD_TAIL_SUFFIX);
  789|  1.65k|    return;
  790|       |
  791|    958|vert_2:
  792|    958|    sumsq_ptrs[2] = sumsq_ptrs[1];
  793|    958|    sum_ptrs[2] = sum_ptrs[1];
  794|    958|    sgr_box3_vert(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  795|    958|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|    958|#define BITDEPTH_MAX 0xff
  ------------------
  796|       |
  797|    958|    sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
  798|    958|                w, params->sgr.w1 HIGHBD_TAIL_SUFFIX);
  799|       |
  800|  1.65k|output_1:
  801|  1.65k|    sumsq_ptrs[2] = sumsq_ptrs[1];
  802|  1.65k|    sum_ptrs[2] = sum_ptrs[1];
  803|  1.65k|    sgr_box3_vert(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  804|  1.65k|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.65k|#define BITDEPTH_MAX 0xff
  ------------------
  805|       |
  806|  1.65k|    sgr_finish1(&dst, stride, A_ptrs, B_ptrs,
  807|  1.65k|                w, params->sgr.w1 HIGHBD_TAIL_SUFFIX);
  808|  1.65k|    return;
  809|       |
  810|    697|vert_1:
  811|    697|    sumsq_ptrs[2] = sumsq_ptrs[1];
  812|    697|    sum_ptrs[2] = sum_ptrs[1];
  813|    697|    sgr_box3_vert(sumsq_ptrs, sum_ptrs, A_ptrs[2], B_ptrs[2],
  814|    697|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|    697|#define BITDEPTH_MAX 0xff
  ------------------
  815|    697|    rotate(A_ptrs, B_ptrs, 3);
  816|    697|    goto output_1;
  817|    958|}
looprestoration_tmpl.c:sgr_box3_row_h:
  417|   306k|{
  418|   306k|    sumsq++;
  419|   306k|    sum++;
  420|   306k|    int a = edges & LR_HAVE_LEFT ? (left ? left[0][2] : src[-2]) : src[0];
  ------------------
  |  Branch (420:13): [True: 244k, False: 61.5k]
  |  Branch (420:37): [True: 231k, False: 13.3k]
  ------------------
  421|   306k|    int b = edges & LR_HAVE_LEFT ? (left ? left[0][3] : src[-1]) : src[0];
  ------------------
  |  Branch (421:13): [True: 244k, False: 61.5k]
  |  Branch (421:37): [True: 231k, False: 13.3k]
  ------------------
  422|  32.4M|    for (int x = -1; x < w + 1; x++) {
  ------------------
  |  Branch (422:22): [True: 32.1M, False: 306k]
  ------------------
  423|  32.1M|        int c = (x + 1 < w || (edges & LR_HAVE_RIGHT)) ? src[x + 1] : src[w - 1];
  ------------------
  |  Branch (423:18): [True: 31.5M, False: 612k]
  |  Branch (423:31): [True: 473k, False: 139k]
  ------------------
  424|  32.1M|        sum[x] = a + b + c;
  425|  32.1M|        sumsq[x] = a * a + b * b + c * c;
  426|  32.1M|        a = b;
  427|  32.1M|        b = c;
  428|  32.1M|    }
  429|   306k|}
looprestoration_tmpl.c:sgr_box3_hv:
  544|   102k|{
  545|   102k|    sgr_box3_row_h(sumsq[2], sum[2], left, src, w, edges);
  546|   102k|    sgr_box3_vert(sumsq, sum, AA, BB, w, s, bitdepth_max);
  547|   102k|}
looprestoration_tmpl.c:sgr_box3_vert:
  522|   307k|{
  523|   307k|    sgr_box3_row_v(sumsq, sum, sumsq_out, sum_out, w);
  524|   307k|    sgr_calc_row_ab(sumsq_out, sum_out, w, s, bitdepth_max, 9, 455);
  525|   307k|    rotate(sumsq, sum, 3);
  526|   307k|}
looprestoration_tmpl.c:sgr_box3_row_v:
  466|   307k|{
  467|  32.3M|    for (int x = 0; x < w + 2; x++) {
  ------------------
  |  Branch (467:21): [True: 32.0M, False: 307k]
  ------------------
  468|  32.0M|        int sq_a = sumsq[0][x];
  469|  32.0M|        int sq_b = sumsq[1][x];
  470|  32.0M|        int sq_c = sumsq[2][x];
  471|  32.0M|        int s_a = sum[0][x];
  472|  32.0M|        int s_b = sum[1][x];
  473|  32.0M|        int s_c = sum[2][x];
  474|  32.0M|        sumsq_out[x] = sq_a + sq_b + sq_c;
  475|  32.0M|        sum_out[x] = s_a + s_b + s_c;
  476|  32.0M|    }
  477|   307k|}
looprestoration_tmpl.c:sgr_finish1:
  625|   101k|{
  626|       |    // Only one single row, no stride needed
  627|   101k|    ALIGN_STK_16(coef, tmp, 384,);
  ------------------
  |  |  100|   101k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|   101k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  628|       |
  629|   101k|    sgr_finish_filter_row1(tmp, *dst, A_ptrs, B_ptrs, w);
  630|   101k|    sgr_weighted_row1(*dst, tmp, w, w1 HIGHBD_TAIL_SUFFIX);
  631|   101k|    *dst += PXSTRIDE(stride);
  ------------------
  |  |   53|   101k|#define PXSTRIDE(x) (x)
  ------------------
  632|   101k|    rotate(A_ptrs, B_ptrs, 3);
  633|   101k|}
looprestoration_tmpl.c:sgr_finish_filter_row1:
  553|   288k|{
  554|   288k|#define EIGHT_NEIGHBORS(P, i)\
  555|   288k|    ((P[1][i] + P[1][i - 1] + P[1][i + 1] + P[0][i] + P[2][i]) * 4 + \
  556|   288k|     (P[0][i - 1] + P[2][i - 1] +                           \
  557|   288k|      P[0][i + 1] + P[2][i + 1]) * 3)
  558|  30.0M|    for (int i = 0; i < w; i++) {
  ------------------
  |  Branch (558:21): [True: 29.7M, False: 288k]
  ------------------
  559|  29.7M|        const int a = EIGHT_NEIGHBORS(B_ptrs, i + 1);
  ------------------
  |  |  555|  29.7M|    ((P[1][i] + P[1][i - 1] + P[1][i + 1] + P[0][i] + P[2][i]) * 4 + \
  |  |  556|  29.7M|     (P[0][i - 1] + P[2][i - 1] +                           \
  |  |  557|  29.7M|      P[0][i + 1] + P[2][i + 1]) * 3)
  ------------------
  560|  29.7M|        const int b = EIGHT_NEIGHBORS(A_ptrs, i + 1);
  ------------------
  |  |  555|  29.7M|    ((P[1][i] + P[1][i - 1] + P[1][i + 1] + P[0][i] + P[2][i]) * 4 + \
  |  |  556|  29.7M|     (P[0][i - 1] + P[2][i - 1] +                           \
  |  |  557|  29.7M|      P[0][i + 1] + P[2][i + 1]) * 3)
  ------------------
  561|  29.7M|        tmp[i] = (b - a * src[i] + (1 << 8)) >> 9;
  562|  29.7M|    }
  563|   288k|#undef EIGHT_NEIGHBORS
  564|   288k|}
looprestoration_tmpl.c:sgr_mix_c:
 1026|  6.08k|{
 1027|  6.08k|    ALIGN_STK_16(int32_t, sumsq5_buf, BUF_STRIDE * 5 + 16,);
  ------------------
  |  |  100|  6.08k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  6.08k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1028|  6.08k|    ALIGN_STK_16(coef, sum5_buf, BUF_STRIDE * 5 + 16,);
  ------------------
  |  |  100|  6.08k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  6.08k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1029|  6.08k|    int32_t *sumsq5_ptrs[5], *sumsq5_rows[5];
 1030|  6.08k|    coef *sum5_ptrs[5], *sum5_rows[5];
 1031|  36.5k|    for (int i = 0; i < 5; i++) {
  ------------------
  |  Branch (1031:21): [True: 30.4k, False: 6.08k]
  ------------------
 1032|  30.4k|        sumsq5_rows[i] = &sumsq5_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  30.4k|#define BUF_STRIDE (384 + 16)
  ------------------
 1033|  30.4k|        sum5_rows[i] = &sum5_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  30.4k|#define BUF_STRIDE (384 + 16)
  ------------------
 1034|  30.4k|    }
 1035|  6.08k|    ALIGN_STK_16(int32_t, sumsq3_buf, BUF_STRIDE * 3 + 16,);
  ------------------
  |  |  100|  6.08k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  6.08k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1036|  6.08k|    ALIGN_STK_16(coef, sum3_buf, BUF_STRIDE * 3 + 16,);
  ------------------
  |  |  100|  6.08k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  6.08k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1037|  6.08k|    int32_t *sumsq3_ptrs[3], *sumsq3_rows[3];
 1038|  6.08k|    coef *sum3_ptrs[3], *sum3_rows[3];
 1039|  24.3k|    for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (1039:21): [True: 18.2k, False: 6.08k]
  ------------------
 1040|  18.2k|        sumsq3_rows[i] = &sumsq3_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  18.2k|#define BUF_STRIDE (384 + 16)
  ------------------
 1041|  18.2k|        sum3_rows[i] = &sum3_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  18.2k|#define BUF_STRIDE (384 + 16)
  ------------------
 1042|  18.2k|    }
 1043|       |
 1044|  6.08k|    ALIGN_STK_16(int32_t, A5_buf, BUF_STRIDE * 2 + 16,);
  ------------------
  |  |  100|  6.08k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  6.08k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1045|  6.08k|    ALIGN_STK_16(coef, B5_buf, BUF_STRIDE * 2 + 16,);
  ------------------
  |  |  100|  6.08k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  6.08k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1046|  6.08k|    int32_t *A5_ptrs[2];
 1047|  6.08k|    coef *B5_ptrs[2];
 1048|  18.2k|    for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1048:21): [True: 12.1k, False: 6.08k]
  ------------------
 1049|  12.1k|        A5_ptrs[i] = &A5_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  12.1k|#define BUF_STRIDE (384 + 16)
  ------------------
 1050|  12.1k|        B5_ptrs[i] = &B5_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  12.1k|#define BUF_STRIDE (384 + 16)
  ------------------
 1051|  12.1k|    }
 1052|  6.08k|    ALIGN_STK_16(int32_t, A3_buf, BUF_STRIDE * 4 + 16,);
  ------------------
  |  |  100|  6.08k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  6.08k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1053|  6.08k|    ALIGN_STK_16(coef, B3_buf, BUF_STRIDE * 4 + 16,);
  ------------------
  |  |  100|  6.08k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  6.08k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
 1054|  6.08k|    int32_t *A3_ptrs[4];
 1055|  6.08k|    coef *B3_ptrs[4];
 1056|  30.4k|    for (int i = 0; i < 4; i++) {
  ------------------
  |  Branch (1056:21): [True: 24.3k, False: 6.08k]
  ------------------
 1057|  24.3k|        A3_ptrs[i] = &A3_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  24.3k|#define BUF_STRIDE (384 + 16)
  ------------------
 1058|  24.3k|        B3_ptrs[i] = &B3_buf[i * BUF_STRIDE];
  ------------------
  |  |  679|  24.3k|#define BUF_STRIDE (384 + 16)
  ------------------
 1059|  24.3k|    }
 1060|  6.08k|    const pixel *src = dst;
 1061|  6.08k|    const pixel *lpf_bottom = lpf + 6*PXSTRIDE(stride);
  ------------------
  |  |   53|  6.08k|#define PXSTRIDE(x) (x)
  ------------------
 1062|       |
 1063|  6.08k|    if (edges & LR_HAVE_TOP) {
  ------------------
  |  Branch (1063:9): [True: 2.75k, False: 3.33k]
  ------------------
 1064|  2.75k|        sumsq5_ptrs[0] = sumsq5_rows[0];
 1065|  2.75k|        sumsq5_ptrs[1] = sumsq5_rows[0];
 1066|  2.75k|        sumsq5_ptrs[2] = sumsq5_rows[1];
 1067|  2.75k|        sumsq5_ptrs[3] = sumsq5_rows[2];
 1068|  2.75k|        sumsq5_ptrs[4] = sumsq5_rows[3];
 1069|  2.75k|        sum5_ptrs[0] = sum5_rows[0];
 1070|  2.75k|        sum5_ptrs[1] = sum5_rows[0];
 1071|  2.75k|        sum5_ptrs[2] = sum5_rows[1];
 1072|  2.75k|        sum5_ptrs[3] = sum5_rows[2];
 1073|  2.75k|        sum5_ptrs[4] = sum5_rows[3];
 1074|       |
 1075|  2.75k|        sumsq3_ptrs[0] = sumsq3_rows[0];
 1076|  2.75k|        sumsq3_ptrs[1] = sumsq3_rows[1];
 1077|  2.75k|        sumsq3_ptrs[2] = sumsq3_rows[2];
 1078|  2.75k|        sum3_ptrs[0] = sum3_rows[0];
 1079|  2.75k|        sum3_ptrs[1] = sum3_rows[1];
 1080|  2.75k|        sum3_ptrs[2] = sum3_rows[2];
 1081|       |
 1082|  2.75k|        sgr_box35_row_h(sumsq3_rows[0], sum3_rows[0],
 1083|  2.75k|                        sumsq5_rows[0], sum5_rows[0],
 1084|  2.75k|                        NULL, lpf, w, edges);
 1085|  2.75k|        lpf += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.75k|#define PXSTRIDE(x) (x)
  ------------------
 1086|  2.75k|        sgr_box35_row_h(sumsq3_rows[1], sum3_rows[1],
 1087|  2.75k|                        sumsq5_rows[1], sum5_rows[1],
 1088|  2.75k|                        NULL, lpf, w, edges);
 1089|       |
 1090|  2.75k|        sgr_box35_row_h(sumsq3_rows[2], sum3_rows[2],
 1091|  2.75k|                        sumsq5_rows[2], sum5_rows[2],
 1092|  2.75k|                        left, src, w, edges);
 1093|  2.75k|        left++;
 1094|  2.75k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.75k|#define PXSTRIDE(x) (x)
  ------------------
 1095|       |
 1096|  2.75k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1097|  2.75k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.75k|#define BITDEPTH_MAX 0xff
  ------------------
 1098|  2.75k|        rotate(A3_ptrs, B3_ptrs, 4);
 1099|       |
 1100|  2.75k|        if (--h <= 0)
  ------------------
  |  Branch (1100:13): [True: 564, False: 2.19k]
  ------------------
 1101|    564|            goto vert_1;
 1102|       |
 1103|  2.19k|        sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
 1104|  2.19k|                        sumsq5_rows[3], sum5_rows[3],
 1105|  2.19k|                        left, src, w, edges);
 1106|  2.19k|        left++;
 1107|  2.19k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.19k|#define PXSTRIDE(x) (x)
  ------------------
 1108|  2.19k|        sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1109|  2.19k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.19k|#define BITDEPTH_MAX 0xff
  ------------------
 1110|  2.19k|        rotate(A5_ptrs, B5_ptrs, 2);
 1111|  2.19k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1112|  2.19k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.19k|#define BITDEPTH_MAX 0xff
  ------------------
 1113|  2.19k|        rotate(A3_ptrs, B3_ptrs, 4);
 1114|       |
 1115|  2.19k|        if (--h <= 0)
  ------------------
  |  Branch (1115:13): [True: 372, False: 1.81k]
  ------------------
 1116|    372|            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|  1.81k|        sumsq5_ptrs[3] = sumsq5_rows[4];
 1121|  1.81k|        sum5_ptrs[3] = sum5_rows[4];
 1122|  3.33k|    } else {
 1123|  3.33k|        sumsq5_ptrs[0] = sumsq5_rows[0];
 1124|  3.33k|        sumsq5_ptrs[1] = sumsq5_rows[0];
 1125|  3.33k|        sumsq5_ptrs[2] = sumsq5_rows[0];
 1126|  3.33k|        sumsq5_ptrs[3] = sumsq5_rows[0];
 1127|  3.33k|        sumsq5_ptrs[4] = sumsq5_rows[0];
 1128|  3.33k|        sum5_ptrs[0] = sum5_rows[0];
 1129|  3.33k|        sum5_ptrs[1] = sum5_rows[0];
 1130|  3.33k|        sum5_ptrs[2] = sum5_rows[0];
 1131|  3.33k|        sum5_ptrs[3] = sum5_rows[0];
 1132|  3.33k|        sum5_ptrs[4] = sum5_rows[0];
 1133|       |
 1134|  3.33k|        sumsq3_ptrs[0] = sumsq3_rows[0];
 1135|  3.33k|        sumsq3_ptrs[1] = sumsq3_rows[0];
 1136|  3.33k|        sumsq3_ptrs[2] = sumsq3_rows[0];
 1137|  3.33k|        sum3_ptrs[0] = sum3_rows[0];
 1138|  3.33k|        sum3_ptrs[1] = sum3_rows[0];
 1139|  3.33k|        sum3_ptrs[2] = sum3_rows[0];
 1140|       |
 1141|  3.33k|        sgr_box35_row_h(sumsq3_rows[0], sum3_rows[0],
 1142|  3.33k|                        sumsq5_rows[0], sum5_rows[0],
 1143|  3.33k|                        left, src, w, edges);
 1144|  3.33k|        left++;
 1145|  3.33k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  3.33k|#define PXSTRIDE(x) (x)
  ------------------
 1146|       |
 1147|  3.33k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1148|  3.33k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  3.33k|#define BITDEPTH_MAX 0xff
  ------------------
 1149|  3.33k|        rotate(A3_ptrs, B3_ptrs, 4);
 1150|       |
 1151|  3.33k|        if (--h <= 0)
  ------------------
  |  Branch (1151:13): [True: 381, False: 2.95k]
  ------------------
 1152|    381|            goto vert_1;
 1153|       |
 1154|  2.95k|        sumsq5_ptrs[4] = sumsq5_rows[1];
 1155|  2.95k|        sum5_ptrs[4] = sum5_rows[1];
 1156|       |
 1157|  2.95k|        sumsq3_ptrs[2] = sumsq3_rows[1];
 1158|  2.95k|        sum3_ptrs[2] = sum3_rows[1];
 1159|       |
 1160|  2.95k|        sgr_box35_row_h(sumsq3_rows[1], sum3_rows[1],
 1161|  2.95k|                        sumsq5_rows[1], sum5_rows[1],
 1162|  2.95k|                        left, src, w, edges);
 1163|  2.95k|        left++;
 1164|  2.95k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.95k|#define PXSTRIDE(x) (x)
  ------------------
 1165|       |
 1166|  2.95k|        sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1167|  2.95k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.95k|#define BITDEPTH_MAX 0xff
  ------------------
 1168|  2.95k|        rotate(A5_ptrs, B5_ptrs, 2);
 1169|  2.95k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1170|  2.95k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.95k|#define BITDEPTH_MAX 0xff
  ------------------
 1171|  2.95k|        rotate(A3_ptrs, B3_ptrs, 4);
 1172|       |
 1173|  2.95k|        if (--h <= 0)
  ------------------
  |  Branch (1173:13): [True: 280, False: 2.67k]
  ------------------
 1174|    280|            goto vert_2;
 1175|       |
 1176|  2.67k|        sumsq5_ptrs[3] = sumsq5_rows[2];
 1177|  2.67k|        sumsq5_ptrs[4] = sumsq5_rows[3];
 1178|  2.67k|        sum5_ptrs[3] = sum5_rows[2];
 1179|  2.67k|        sum5_ptrs[4] = sum5_rows[3];
 1180|       |
 1181|  2.67k|        sumsq3_ptrs[2] = sumsq3_rows[2];
 1182|  2.67k|        sum3_ptrs[2] = sum3_rows[2];
 1183|       |
 1184|  2.67k|        sgr_box35_row_h(sumsq3_rows[2], sum3_rows[2],
 1185|  2.67k|                        sumsq5_rows[2], sum5_rows[2],
 1186|  2.67k|                        left, src, w, edges);
 1187|  2.67k|        left++;
 1188|  2.67k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.67k|#define PXSTRIDE(x) (x)
  ------------------
 1189|       |
 1190|  2.67k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1191|  2.67k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.67k|#define BITDEPTH_MAX 0xff
  ------------------
 1192|  2.67k|        rotate(A3_ptrs, B3_ptrs, 4);
 1193|       |
 1194|  2.67k|        if (--h <= 0)
  ------------------
  |  Branch (1194:13): [True: 245, False: 2.42k]
  ------------------
 1195|    245|            goto odd;
 1196|       |
 1197|  2.42k|        sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
 1198|  2.42k|                        sumsq5_rows[3], sum5_rows[3],
 1199|  2.42k|                        left, src, w, edges);
 1200|  2.42k|        left++;
 1201|  2.42k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.42k|#define PXSTRIDE(x) (x)
  ------------------
 1202|       |
 1203|  2.42k|        sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1204|  2.42k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.42k|#define BITDEPTH_MAX 0xff
  ------------------
 1205|  2.42k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1206|  2.42k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.42k|#define BITDEPTH_MAX 0xff
  ------------------
 1207|  2.42k|        sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
 1208|  2.42k|                       w, 2, params->sgr.w0, params->sgr.w1
 1209|  2.42k|                       HIGHBD_TAIL_SUFFIX);
 1210|       |
 1211|  2.42k|        if (--h <= 0)
  ------------------
  |  Branch (1211:13): [True: 283, False: 2.14k]
  ------------------
 1212|    283|            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|  2.14k|        sumsq5_ptrs[3] = sumsq5_rows[4];
 1217|  2.14k|        sum5_ptrs[3] = sum5_rows[4];
 1218|  2.14k|    }
 1219|       |
 1220|  85.6k|    do {
 1221|  85.6k|        sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
 1222|  85.6k|                        sumsq5_ptrs[3], sum5_ptrs[3],
 1223|  85.6k|                        left, src, w, edges);
 1224|  85.6k|        left++;
 1225|  85.6k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  85.6k|#define PXSTRIDE(x) (x)
  ------------------
 1226|       |
 1227|  85.6k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1228|  85.6k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  85.6k|#define BITDEPTH_MAX 0xff
  ------------------
 1229|  85.6k|        rotate(A3_ptrs, B3_ptrs, 4);
 1230|       |
 1231|  85.6k|        if (--h <= 0)
  ------------------
  |  Branch (1231:13): [True: 398, False: 85.2k]
  ------------------
 1232|    398|            goto odd;
 1233|       |
 1234|  85.2k|        sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
 1235|  85.2k|                        sumsq5_ptrs[4], sum5_ptrs[4],
 1236|  85.2k|                        left, src, w, edges);
 1237|  85.2k|        left++;
 1238|  85.2k|        src += PXSTRIDE(stride);
  ------------------
  |  |   53|  85.2k|#define PXSTRIDE(x) (x)
  ------------------
 1239|       |
 1240|  85.2k|        sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1241|  85.2k|                      w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  85.2k|#define BITDEPTH_MAX 0xff
  ------------------
 1242|  85.2k|        sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1243|  85.2k|                      w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  85.2k|#define BITDEPTH_MAX 0xff
  ------------------
 1244|  85.2k|        sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
 1245|  85.2k|                       w, 2, params->sgr.w0, params->sgr.w1
 1246|  85.2k|                       HIGHBD_TAIL_SUFFIX);
 1247|  85.2k|    } while (--h > 0);
  ------------------
  |  Branch (1247:14): [True: 81.6k, False: 3.56k]
  ------------------
 1248|       |
 1249|  3.56k|    if (!(edges & LR_HAVE_BOTTOM))
  ------------------
  |  Branch (1249:9): [True: 574, False: 2.99k]
  ------------------
 1250|    574|        goto vert_2;
 1251|       |
 1252|  2.99k|    sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
 1253|  2.99k|                    sumsq5_ptrs[3], sum5_ptrs[3],
 1254|  2.99k|                    NULL, lpf_bottom, w, edges);
 1255|  2.99k|    lpf_bottom += PXSTRIDE(stride);
  ------------------
  |  |   53|  2.99k|#define PXSTRIDE(x) (x)
  ------------------
 1256|  2.99k|    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1257|  2.99k|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  2.99k|#define BITDEPTH_MAX 0xff
  ------------------
 1258|  2.99k|    rotate(A3_ptrs, B3_ptrs, 4);
 1259|       |
 1260|  2.99k|    sgr_box35_row_h(sumsq3_ptrs[2], sum3_ptrs[2],
 1261|  2.99k|                    sumsq5_ptrs[4], sum5_ptrs[4],
 1262|  2.99k|                    NULL, lpf_bottom, w, edges);
 1263|       |
 1264|  4.50k|output_2:
 1265|  4.50k|    sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1266|  4.50k|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  4.50k|#define BITDEPTH_MAX 0xff
  ------------------
 1267|  4.50k|    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1268|  4.50k|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  4.50k|#define BITDEPTH_MAX 0xff
  ------------------
 1269|  4.50k|    sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
 1270|  4.50k|                   w, 2, params->sgr.w0, params->sgr.w1
 1271|  4.50k|                   HIGHBD_TAIL_SUFFIX);
 1272|  4.50k|    return;
 1273|       |
 1274|  1.50k|vert_2:
 1275|       |    // Duplicate the last row twice more
 1276|  1.50k|    sumsq5_ptrs[3] = sumsq5_ptrs[2];
 1277|  1.50k|    sumsq5_ptrs[4] = sumsq5_ptrs[2];
 1278|  1.50k|    sum5_ptrs[3] = sum5_ptrs[2];
 1279|  1.50k|    sum5_ptrs[4] = sum5_ptrs[2];
 1280|       |
 1281|  1.50k|    sumsq3_ptrs[2] = sumsq3_ptrs[1];
 1282|  1.50k|    sum3_ptrs[2] = sum3_ptrs[1];
 1283|  1.50k|    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1284|  1.50k|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.50k|#define BITDEPTH_MAX 0xff
  ------------------
 1285|  1.50k|    rotate(A3_ptrs, B3_ptrs, 4);
 1286|       |
 1287|  1.50k|    sumsq3_ptrs[2] = sumsq3_ptrs[1];
 1288|  1.50k|    sum3_ptrs[2] = sum3_ptrs[1];
 1289|       |
 1290|  1.50k|    goto output_2;
 1291|       |
 1292|    643|odd:
 1293|       |    // Copy the last row as padding once
 1294|    643|    sumsq5_ptrs[4] = sumsq5_ptrs[3];
 1295|    643|    sum5_ptrs[4] = sum5_ptrs[3];
 1296|       |
 1297|    643|    sumsq3_ptrs[2] = sumsq3_ptrs[1];
 1298|    643|    sum3_ptrs[2] = sum3_ptrs[1];
 1299|       |
 1300|    643|    sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1301|    643|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|    643|#define BITDEPTH_MAX 0xff
  ------------------
 1302|    643|    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1303|    643|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|    643|#define BITDEPTH_MAX 0xff
  ------------------
 1304|    643|    sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
 1305|    643|                   w, 2, params->sgr.w0, params->sgr.w1
 1306|    643|                   HIGHBD_TAIL_SUFFIX);
 1307|       |
 1308|  1.58k|output_1:
 1309|       |    // Duplicate the last row twice more
 1310|  1.58k|    sumsq5_ptrs[3] = sumsq5_ptrs[2];
 1311|  1.58k|    sumsq5_ptrs[4] = sumsq5_ptrs[2];
 1312|  1.58k|    sum5_ptrs[3] = sum5_ptrs[2];
 1313|  1.58k|    sum5_ptrs[4] = sum5_ptrs[2];
 1314|       |
 1315|  1.58k|    sumsq3_ptrs[2] = sumsq3_ptrs[1];
 1316|  1.58k|    sum3_ptrs[2] = sum3_ptrs[1];
 1317|       |
 1318|  1.58k|    sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1319|  1.58k|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.58k|#define BITDEPTH_MAX 0xff
  ------------------
 1320|  1.58k|    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1321|  1.58k|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|  1.58k|#define BITDEPTH_MAX 0xff
  ------------------
 1322|  1.58k|    rotate(A3_ptrs, B3_ptrs, 4);
 1323|       |    // Output only one row
 1324|  1.58k|    sgr_finish_mix(&dst, stride, A5_ptrs, B5_ptrs, A3_ptrs, B3_ptrs,
 1325|  1.58k|                   w, 1, params->sgr.w0, params->sgr.w1
 1326|  1.58k|                   HIGHBD_TAIL_SUFFIX);
 1327|  1.58k|    return;
 1328|       |
 1329|    945|vert_1:
 1330|       |    // Copy the last row as padding once
 1331|    945|    sumsq5_ptrs[4] = sumsq5_ptrs[3];
 1332|    945|    sum5_ptrs[4] = sum5_ptrs[3];
 1333|       |
 1334|    945|    sumsq3_ptrs[2] = sumsq3_ptrs[1];
 1335|    945|    sum3_ptrs[2] = sum3_ptrs[1];
 1336|       |
 1337|    945|    sgr_box5_vert(sumsq5_ptrs, sum5_ptrs, A5_ptrs[1], B5_ptrs[1],
 1338|    945|                  w, params->sgr.s0, BITDEPTH_MAX);
  ------------------
  |  |   59|    945|#define BITDEPTH_MAX 0xff
  ------------------
 1339|    945|    rotate(A5_ptrs, B5_ptrs, 2);
 1340|    945|    sgr_box3_vert(sumsq3_ptrs, sum3_ptrs, A3_ptrs[3], B3_ptrs[3],
 1341|    945|                  w, params->sgr.s1, BITDEPTH_MAX);
  ------------------
  |  |   59|    945|#define BITDEPTH_MAX 0xff
  ------------------
 1342|    945|    rotate(A3_ptrs, B3_ptrs, 4);
 1343|       |
 1344|    945|    goto output_1;
 1345|    643|}
looprestoration_tmpl.c:sgr_box35_row_h:
  458|   198k|{
  459|   198k|    sgr_box3_row_h(sumsq3, sum3, left, src, w, edges);
  460|   198k|    sgr_box5_row_h(sumsq5, sum5, left, src, w, edges);
  461|   198k|}
looprestoration_tmpl.c:sgr_finish_mix:
  657|  94.4k|{
  658|  94.4k|    ALIGN_STK_16(coef, tmp5, 2*FILTER_OUT_STRIDE,);
  ------------------
  |  |  100|  94.4k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  94.4k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  659|  94.4k|    ALIGN_STK_16(coef, tmp3, 2*FILTER_OUT_STRIDE,);
  ------------------
  |  |  100|  94.4k|    ALIGN(type var[sz1d]sznd, ALIGN_16_VAL)
  |  |  ------------------
  |  |  |  |   86|  94.4k|    line __attribute__((aligned(align)))
  |  |  ------------------
  ------------------
  660|       |
  661|  94.4k|    sgr_finish_filter2(tmp5, *dst, stride, A5_ptrs, B5_ptrs, w, h);
  662|  94.4k|    sgr_finish_filter_row1(tmp3, *dst, A3_ptrs, B3_ptrs, w);
  663|  94.4k|    if (h > 1)
  ------------------
  |  Branch (663:9): [True: 92.8k, False: 1.58k]
  ------------------
  664|  92.8k|        sgr_finish_filter_row1(tmp3 + FILTER_OUT_STRIDE, *dst + PXSTRIDE(stride),
  ------------------
  |  |  566|  92.8k|#define FILTER_OUT_STRIDE (384)
  ------------------
                      sgr_finish_filter_row1(tmp3 + FILTER_OUT_STRIDE, *dst + PXSTRIDE(stride),
  ------------------
  |  |   53|  92.8k|#define PXSTRIDE(x) (x)
  ------------------
  665|  92.8k|                               &A3_ptrs[1], &B3_ptrs[1], w);
  666|  94.4k|    sgr_weighted2(*dst, stride, tmp5, tmp3, w, h, w0, w1 HIGHBD_TAIL_SUFFIX);
  667|  94.4k|    *dst += h*PXSTRIDE(stride);
  ------------------
  |  |   53|  94.4k|#define PXSTRIDE(x) (x)
  ------------------
  668|  94.4k|    rotate(A5_ptrs, B5_ptrs, 2);
  669|  94.4k|    rotate(A3_ptrs, B3_ptrs, 4);
  670|  94.4k|}
looprestoration_tmpl.c:sgr_weighted2:
  610|  94.4k|{
  611|   281k|    for (int j = 0; j < h; j++) {
  ------------------
  |  Branch (611:21): [True: 187k, False: 94.4k]
  ------------------
  612|  19.3M|        for (int i = 0; i < w; i++) {
  ------------------
  |  Branch (612:25): [True: 19.1M, False: 187k]
  ------------------
  613|  19.1M|            const int v = w0 * t1[i] + w1 * t2[i];
  614|  19.1M|            dst[i] = iclip_pixel(dst[i] + ((v + (1 << 10)) >> 11));
  ------------------
  |  |   49|  19.1M|#define iclip_pixel iclip_u8
  ------------------
  615|  19.1M|        }
  616|   187k|        dst += PXSTRIDE(dst_stride);
  ------------------
  |  |   53|   187k|#define PXSTRIDE(x) (x)
  ------------------
  617|   187k|        t1 += FILTER_OUT_STRIDE;
  ------------------
  |  |  566|   187k|#define FILTER_OUT_STRIDE (384)
  ------------------
  618|   187k|        t2 += FILTER_OUT_STRIDE;
  ------------------
  |  |  566|   187k|#define FILTER_OUT_STRIDE (384)
  ------------------
  619|   187k|    }
  620|  94.4k|}
dav1d_loop_restoration_dsp_init_16bpc:
 1361|  5.54k|{
 1362|  5.54k|    c->wiener[0] = c->wiener[1] = wiener_c;
 1363|  5.54k|    c->sgr[0] = sgr_5x5_c;
 1364|  5.54k|    c->sgr[1] = sgr_3x3_c;
 1365|  5.54k|    c->sgr[2] = sgr_mix_c;
 1366|       |
 1367|  5.54k|#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.54k|#endif
 1377|  5.54k|#endif
 1378|  5.54k|}

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

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

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

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

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

decode.c:dav1d_msac_decode_bools:
   94|   569k|static inline unsigned dav1d_msac_decode_bools(MsacContext *const s, unsigned n) {
   95|   569k|    unsigned v = 0;
   96|  1.28M|    while (n--)
  ------------------
  |  Branch (96:12): [True: 710k, False: 569k]
  ------------------
   97|   710k|        v = (v << 1) | dav1d_msac_decode_bool_equi(s);
  ------------------
  |  |   53|   710k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
   98|   569k|    return v;
   99|   569k|}
decode.c:dav1d_msac_decode_uniform:
  101|  89.8k|static inline int dav1d_msac_decode_uniform(MsacContext *const s, const unsigned n) {
  102|  89.8k|    assert(n > 0);
  ------------------
  |  Branch (102:5): [True: 89.8k, False: 0]
  ------------------
  103|  89.8k|    const int l = ulog2(n) + 1;
  104|  89.8k|    assert(l > 1);
  ------------------
  |  Branch (104:5): [True: 89.8k, False: 0]
  ------------------
  105|  89.8k|    const unsigned m = (1 << l) - n;
  106|  89.8k|    const unsigned v = dav1d_msac_decode_bools(s, l - 1);
  107|  89.8k|    return v < m ? v : (v << 1) - m + dav1d_msac_decode_bool_equi(s);
  ------------------
  |  |   53|  23.3k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (107:12): [True: 66.4k, False: 23.3k]
  ------------------
  108|  89.8k|}
msac.c:dav1d_msac_decode_bools:
   94|   119k|static inline unsigned dav1d_msac_decode_bools(MsacContext *const s, unsigned n) {
   95|   119k|    unsigned v = 0;
   96|   540k|    while (n--)
  ------------------
  |  Branch (96:12): [True: 421k, False: 119k]
  ------------------
   97|   421k|        v = (v << 1) | dav1d_msac_decode_bool_equi(s);
  ------------------
  |  |   53|   421k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
   98|   119k|    return v;
   99|   119k|}
recon_tmpl.c:dav1d_msac_decode_bools:
   94|  3.34M|static inline unsigned dav1d_msac_decode_bools(MsacContext *const s, unsigned n) {
   95|  3.34M|    unsigned v = 0;
   96|  12.7M|    while (n--)
  ------------------
  |  Branch (96:12): [True: 9.38M, False: 3.34M]
  ------------------
   97|  9.38M|        v = (v << 1) | dav1d_msac_decode_bool_equi(s);
  ------------------
  |  |   53|  9.38M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
   98|  3.34M|    return v;
   99|  3.34M|}

dav1d_parse_sequence_header:
  304|  15.2k|{
  305|  15.2k|    validate_input_or_ret(out != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  15.2k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 15.2k]
  |  |  ------------------
  |  |   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|  15.2k|    validate_input_or_ret(ptr != NULL, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  15.2k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:9): [True: 0, False: 15.2k]
  |  |  ------------------
  |  |   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|  15.2k|    validate_input_or_ret(sz > 0 && sz <= SIZE_MAX / 2, DAV1D_ERR(EINVAL));
  ------------------
  |  |   52|  30.4k|    if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (52:11): [True: 15.2k, False: 0]
  |  |  |  Branch (52:11): [True: 15.2k, 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|  15.2k|    GetBits gb;
  310|  15.2k|    dav1d_init_get_bits(&gb, ptr, sz);
  311|  15.2k|    int res = DAV1D_ERR(ENOENT);
  ------------------
  |  |   58|  15.2k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  312|       |
  313|  31.4k|    do {
  314|  31.4k|        dav1d_get_bit(&gb); // obu_forbidden_bit
  315|  31.4k|        const enum Dav1dObuType type = dav1d_get_bits(&gb, 4);
  316|  31.4k|        const int has_extension = dav1d_get_bit(&gb);
  317|  31.4k|        const int has_length_field = dav1d_get_bit(&gb);
  318|  31.4k|        dav1d_get_bits(&gb, 1 + 8 * has_extension); // ignore
  319|       |
  320|  31.4k|        const uint8_t *obu_end = gb.ptr_end;
  321|  31.4k|        if (has_length_field) {
  ------------------
  |  Branch (321:13): [True: 18.7k, False: 12.7k]
  ------------------
  322|  18.7k|            const size_t len = dav1d_get_uleb128(&gb);
  323|  18.7k|            if (len > (size_t)(obu_end - gb.ptr)) return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|    314|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (323:17): [True: 314, False: 18.4k]
  ------------------
  324|  18.4k|            obu_end = gb.ptr + len;
  325|  18.4k|        }
  326|       |
  327|  31.1k|        if (type == DAV1D_OBU_SEQ_HDR) {
  ------------------
  |  Branch (327:13): [True: 14.3k, False: 16.8k]
  ------------------
  328|  14.3k|            if ((res = parse_seq_hdr(out, &gb, 0)) < 0) return res;
  ------------------
  |  Branch (328:17): [True: 2.61k, False: 11.7k]
  ------------------
  329|  11.7k|            if (gb.ptr > obu_end) return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|    334|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (329:17): [True: 334, False: 11.3k]
  ------------------
  330|  11.3k|            dav1d_bytealign_get_bits(&gb);
  331|  11.3k|        }
  332|       |
  333|  28.1k|        if (gb.error) return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|    741|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (333:13): [True: 741, False: 27.4k]
  ------------------
  334|  28.1k|        assert(gb.state == 0 && gb.bits_left == 0);
  ------------------
  |  Branch (334:9): [True: 27.4k, False: 0]
  |  Branch (334:9): [True: 27.4k, False: 0]
  ------------------
  335|  27.4k|        gb.ptr = obu_end;
  336|  27.4k|    } while (gb.ptr < gb.ptr_end);
  ------------------
  |  Branch (336:14): [True: 16.2k, False: 11.2k]
  ------------------
  337|       |
  338|  11.2k|    return res;
  339|  15.2k|}
dav1d_parse_obus:
 1179|   114k|ptrdiff_t dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) {
 1180|   114k|    GetBits gb;
 1181|   114k|    int res;
 1182|       |
 1183|   114k|    dav1d_init_get_bits(&gb, in->data, in->sz);
 1184|       |
 1185|       |    // obu header
 1186|   114k|    const int obu_forbidden_bit = dav1d_get_bit(&gb);
 1187|   114k|    if (c->strict_std_compliance && obu_forbidden_bit) goto error;
  ------------------
  |  Branch (1187:9): [True: 0, False: 114k]
  |  Branch (1187:37): [True: 0, False: 0]
  ------------------
 1188|   114k|    const enum Dav1dObuType type = dav1d_get_bits(&gb, 4);
 1189|   114k|    const int has_extension = dav1d_get_bit(&gb);
 1190|   114k|    const int has_length_field = dav1d_get_bit(&gb);
 1191|   114k|    dav1d_get_bit(&gb); // reserved
 1192|       |
 1193|   114k|    int temporal_id = 0, spatial_id = 0;
 1194|   114k|    if (has_extension) {
  ------------------
  |  Branch (1194:9): [True: 3.82k, False: 110k]
  ------------------
 1195|  3.82k|        temporal_id = dav1d_get_bits(&gb, 3);
 1196|  3.82k|        spatial_id = dav1d_get_bits(&gb, 2);
 1197|  3.82k|        dav1d_get_bits(&gb, 3); // reserved
 1198|  3.82k|    }
 1199|       |
 1200|   114k|    if (has_length_field) {
  ------------------
  |  Branch (1200:9): [True: 39.1k, False: 75.6k]
  ------------------
 1201|  39.1k|        const size_t len = dav1d_get_uleb128(&gb);
 1202|  39.1k|        if (len > (size_t)(gb.ptr_end - gb.ptr)) goto error;
  ------------------
  |  Branch (1202:13): [True: 744, False: 38.3k]
  ------------------
 1203|  38.3k|        gb.ptr_end = gb.ptr + len;
 1204|  38.3k|    }
 1205|   114k|    if (gb.error) goto error;
  ------------------
  |  Branch (1205:9): [True: 588, False: 113k]
  ------------------
 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|   114k|    assert(gb.bits_left == 0);
  ------------------
  |  Branch (1210:5): [True: 113k, False: 0]
  ------------------
 1211|       |
 1212|       |    // skip obu not belonging to the selected temporal/spatial layer
 1213|   113k|    if (type != DAV1D_OBU_SEQ_HDR && type != DAV1D_OBU_TD &&
  ------------------
  |  Branch (1213:9): [True: 89.1k, False: 24.2k]
  |  Branch (1213:38): [True: 87.0k, False: 2.13k]
  ------------------
 1214|  87.0k|        has_extension && c->operating_point_idc != 0)
  ------------------
  |  Branch (1214:9): [True: 2.93k, False: 84.1k]
  |  Branch (1214:26): [True: 863, False: 2.07k]
  ------------------
 1215|    863|    {
 1216|    863|        const int in_temporal_layer = (c->operating_point_idc >> temporal_id) & 1;
 1217|    863|        const int in_spatial_layer = (c->operating_point_idc >> (spatial_id + 8)) & 1;
 1218|    863|        if (!in_temporal_layer || !in_spatial_layer)
  ------------------
  |  Branch (1218:13): [True: 262, False: 601]
  |  Branch (1218:35): [True: 220, False: 381]
  ------------------
 1219|    482|            return gb.ptr_end - gb.ptr_start;
 1220|    863|    }
 1221|       |
 1222|   112k|    switch (type) {
 1223|  24.2k|    case DAV1D_OBU_SEQ_HDR: {
  ------------------
  |  Branch (1223:5): [True: 24.2k, False: 88.7k]
  ------------------
 1224|  24.2k|        Dav1dRef *ref = dav1d_ref_create_using_pool(c->seq_hdr_pool,
 1225|  24.2k|                                                    sizeof(Dav1dSequenceHeader));
 1226|  24.2k|        if (!ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (1226:13): [True: 0, False: 24.2k]
  ------------------
 1227|  24.2k|        Dav1dSequenceHeader *seq_hdr = ref->data;
 1228|  24.2k|        if ((res = parse_seq_hdr(seq_hdr, &gb, c->strict_std_compliance)) < 0) {
  ------------------
  |  Branch (1228:13): [True: 3.32k, False: 20.9k]
  ------------------
 1229|  3.32k|            dav1d_log(c, "Error parsing sequence header\n");
  ------------------
  |  |   44|  3.32k|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 3.32k]
  |  |  ------------------
  ------------------
 1230|  3.32k|            dav1d_ref_dec(&ref);
 1231|  3.32k|            goto error;
 1232|  3.32k|        }
 1233|       |
 1234|  20.9k|        const int op_idx =
 1235|  20.9k|            c->operating_point < seq_hdr->num_operating_points ? c->operating_point : 0;
  ------------------
  |  Branch (1235:13): [True: 20.9k, False: 0]
  ------------------
 1236|  20.9k|        c->operating_point_idc = seq_hdr->operating_points[op_idx].idc;
 1237|  20.9k|        const unsigned spatial_mask = c->operating_point_idc >> 8;
 1238|  20.9k|        c->max_spatial_id = spatial_mask ? ulog2(spatial_mask) : 0;
  ------------------
  |  Branch (1238:29): [True: 5.04k, False: 15.9k]
  ------------------
 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|  20.9k|        if (!c->seq_hdr) {
  ------------------
  |  Branch (1244:13): [True: 10.8k, False: 10.1k]
  ------------------
 1245|  10.8k|            c->frame_hdr = NULL;
 1246|  10.8k|            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|  10.8k|        } else if (memcmp(seq_hdr, c->seq_hdr, offsetof(Dav1dSequenceHeader, operating_parameter_info))) {
  ------------------
  |  Branch (1249:20): [True: 4.38k, False: 5.73k]
  ------------------
 1250|  4.38k|            c->frame_hdr = NULL;
 1251|  4.38k|            c->mastering_display = NULL;
 1252|  4.38k|            c->content_light = NULL;
 1253|  4.38k|            dav1d_ref_dec(&c->mastering_display_ref);
 1254|  4.38k|            dav1d_ref_dec(&c->content_light_ref);
 1255|  39.4k|            for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (1255:29): [True: 35.0k, False: 4.38k]
  ------------------
 1256|  35.0k|                if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (1256:21): [True: 3.97k, False: 31.1k]
  ------------------
 1257|  3.97k|                    dav1d_thread_picture_unref(&c->refs[i].p);
 1258|  35.0k|                dav1d_ref_dec(&c->refs[i].segmap);
 1259|  35.0k|                dav1d_ref_dec(&c->refs[i].refmvs);
 1260|  35.0k|                dav1d_cdf_thread_unref(&c->cdf[i]);
 1261|  35.0k|            }
 1262|  4.38k|            c->frame_flags |= PICTURE_FLAG_NEW_SEQUENCE;
 1263|       |        // If operating_parameter_info changed, signal it
 1264|  5.73k|        } else if (memcmp(seq_hdr->operating_parameter_info, c->seq_hdr->operating_parameter_info,
  ------------------
  |  Branch (1264:20): [True: 293, False: 5.44k]
  ------------------
 1265|  5.73k|                          sizeof(seq_hdr->operating_parameter_info)))
 1266|    293|        {
 1267|    293|            c->frame_flags |= PICTURE_FLAG_NEW_OP_PARAMS_INFO;
 1268|    293|        }
 1269|  20.9k|        dav1d_ref_dec(&c->seq_hdr_ref);
 1270|  20.9k|        c->seq_hdr_ref = ref;
 1271|  20.9k|        c->seq_hdr = seq_hdr;
 1272|  20.9k|        break;
 1273|  24.2k|    }
 1274|  1.82k|    case DAV1D_OBU_REDUNDANT_FRAME_HDR:
  ------------------
  |  Branch (1274:5): [True: 1.82k, False: 111k]
  ------------------
 1275|  1.82k|        if (c->frame_hdr) break;
  ------------------
  |  Branch (1275:13): [True: 631, False: 1.19k]
  ------------------
 1276|       |        // fall-through
 1277|  62.4k|    case DAV1D_OBU_FRAME:
  ------------------
  |  Branch (1277:5): [True: 61.2k, False: 51.7k]
  ------------------
 1278|  77.2k|    case DAV1D_OBU_FRAME_HDR:
  ------------------
  |  Branch (1278:5): [True: 14.7k, False: 98.2k]
  ------------------
 1279|  77.2k|        if (!c->seq_hdr) goto error;
  ------------------
  |  Branch (1279:13): [True: 194, False: 77.0k]
  ------------------
 1280|  77.0k|        if (!c->frame_hdr_ref) {
  ------------------
  |  Branch (1280:13): [True: 49.1k, False: 27.8k]
  ------------------
 1281|  49.1k|            c->frame_hdr_ref = dav1d_ref_create_using_pool(c->frame_hdr_pool,
 1282|  49.1k|                                                           sizeof(Dav1dFrameHeader));
 1283|  49.1k|            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: 49.1k]
  ------------------
 1284|  49.1k|        }
 1285|  77.0k|#ifndef NDEBUG
 1286|       |        // ensure that the reference is writable
 1287|  77.0k|        assert(dav1d_ref_is_writable(c->frame_hdr_ref));
  ------------------
  |  Branch (1287:9): [True: 77.0k, False: 0]
  ------------------
 1288|  77.0k|#endif
 1289|  77.0k|        c->frame_hdr = c->frame_hdr_ref->data;
 1290|  77.0k|        memset(c->frame_hdr, 0, sizeof(*c->frame_hdr));
 1291|  77.0k|        c->frame_hdr->temporal_id = temporal_id;
 1292|  77.0k|        c->frame_hdr->spatial_id = spatial_id;
 1293|  77.0k|        if ((res = parse_frame_hdr(c, &gb)) < 0) {
  ------------------
  |  Branch (1293:13): [True: 6.74k, False: 70.2k]
  ------------------
 1294|  6.74k|            c->frame_hdr = NULL;
 1295|  6.74k|            goto error;
 1296|  6.74k|        }
 1297|  72.7k|        for (int n = 0; n < c->n_tile_data; n++)
  ------------------
  |  Branch (1297:25): [True: 2.43k, False: 70.2k]
  ------------------
 1298|  2.43k|            dav1d_data_unref_internal(&c->tile[n].data);
 1299|  70.2k|        c->n_tile_data = 0;
 1300|  70.2k|        c->n_tiles = 0;
 1301|  70.2k|        if (type != DAV1D_OBU_FRAME) {
  ------------------
  |  Branch (1301:13): [True: 14.0k, False: 56.2k]
  ------------------
 1302|       |            // This is actually a frame header OBU so read the
 1303|       |            // trailing bit and check for overrun.
 1304|  14.0k|            if (check_trailing_bits(&gb, c->strict_std_compliance) < 0) {
  ------------------
  |  Branch (1304:17): [True: 5.47k, False: 8.58k]
  ------------------
 1305|  5.47k|                c->frame_hdr = NULL;
 1306|  5.47k|                goto error;
 1307|  5.47k|            }
 1308|  14.0k|        }
 1309|       |
 1310|  64.8k|        if (c->frame_size_limit && (int64_t)c->frame_hdr->width[1] *
  ------------------
  |  Branch (1310:13): [True: 64.8k, False: 0]
  |  Branch (1310:36): [True: 697, False: 64.1k]
  ------------------
 1311|  64.8k|            c->frame_hdr->height > c->frame_size_limit)
 1312|    697|        {
 1313|    697|            dav1d_log(c, "Frame size %dx%d exceeds limit %u\n", c->frame_hdr->width[1],
  ------------------
  |  |   44|    697|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 697]
  |  |  ------------------
  ------------------
 1314|    697|                      c->frame_hdr->height, c->frame_size_limit);
 1315|    697|            c->frame_hdr = NULL;
 1316|    697|            return DAV1D_ERR(ERANGE);
  ------------------
  |  |   58|    697|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 1317|    697|        }
 1318|       |
 1319|  64.1k|        if (type != DAV1D_OBU_FRAME)
  ------------------
  |  Branch (1319:13): [True: 8.58k, False: 55.5k]
  ------------------
 1320|  8.58k|            break;
 1321|       |        // OBU_FRAMEs shouldn't be signaled with show_existing_frame
 1322|  55.5k|        if (c->frame_hdr->show_existing_frame) {
  ------------------
  |  Branch (1322:13): [True: 341, False: 55.1k]
  ------------------
 1323|    341|            c->frame_hdr = NULL;
 1324|    341|            goto error;
 1325|    341|        }
 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|  55.1k|        dav1d_bytealign_get_bits(&gb);
 1331|       |        // fall-through
 1332|  56.8k|    case DAV1D_OBU_TILE_GRP: {
  ------------------
  |  Branch (1332:5): [True: 1.63k, False: 111k]
  ------------------
 1333|  56.8k|        if (!c->frame_hdr) goto error;
  ------------------
  |  Branch (1333:13): [True: 208, False: 56.6k]
  ------------------
 1334|  56.6k|        if (c->n_tile_data_alloc < c->n_tile_data + 1) {
  ------------------
  |  Branch (1334:13): [True: 9.90k, False: 46.7k]
  ------------------
 1335|  9.90k|            if ((c->n_tile_data + 1) > INT_MAX / (int)sizeof(*c->tile)) goto error;
  ------------------
  |  Branch (1335:17): [True: 0, False: 9.90k]
  ------------------
 1336|  9.90k|            struct Dav1dTileGroup *tile = dav1d_realloc(ALLOC_TILE, c->tile,
  ------------------
  |  |  133|  9.90k|#define dav1d_realloc(type, ptr, sz) realloc(ptr, sz)
  ------------------
 1337|  9.90k|                                                        (c->n_tile_data + 1) * sizeof(*c->tile));
 1338|  9.90k|            if (!tile) goto error;
  ------------------
  |  Branch (1338:17): [True: 0, False: 9.90k]
  ------------------
 1339|  9.90k|            c->tile = tile;
 1340|  9.90k|            memset(c->tile + c->n_tile_data, 0, sizeof(*c->tile));
 1341|  9.90k|            c->n_tile_data_alloc = c->n_tile_data + 1;
 1342|  9.90k|        }
 1343|  56.6k|        parse_tile_hdr(c, &gb);
 1344|       |        // Align to the next byte boundary and check for overrun.
 1345|  56.6k|        dav1d_bytealign_get_bits(&gb);
 1346|  56.6k|        if (gb.error) goto error;
  ------------------
  |  Branch (1346:13): [True: 7.72k, False: 48.8k]
  ------------------
 1347|       |
 1348|  48.8k|        dav1d_data_ref(&c->tile[c->n_tile_data].data, in);
 1349|  48.8k|        c->tile[c->n_tile_data].data.data = gb.ptr;
 1350|  48.8k|        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|  48.8k|        if (c->tile[c->n_tile_data].start > c->tile[c->n_tile_data].end ||
  ------------------
  |  Branch (1352:13): [True: 288, False: 48.6k]
  ------------------
 1353|  48.6k|            c->tile[c->n_tile_data].start != c->n_tiles)
  ------------------
  |  Branch (1353:13): [True: 576, False: 48.0k]
  ------------------
 1354|    864|        {
 1355|  1.92k|            for (int i = 0; i <= c->n_tile_data; i++)
  ------------------
  |  Branch (1355:29): [True: 1.06k, False: 864]
  ------------------
 1356|  1.06k|                dav1d_data_unref_internal(&c->tile[i].data);
 1357|    864|            c->n_tile_data = 0;
 1358|    864|            c->n_tiles = 0;
 1359|    864|            goto error;
 1360|    864|        }
 1361|  48.0k|        c->n_tiles += 1 + c->tile[c->n_tile_data].end -
 1362|  48.0k|                          c->tile[c->n_tile_data].start;
 1363|  48.0k|        c->n_tile_data++;
 1364|  48.0k|        break;
 1365|  48.8k|    }
 1366|  4.23k|    case DAV1D_OBU_METADATA: {
  ------------------
  |  Branch (1366:5): [True: 4.23k, False: 108k]
  ------------------
 1367|  4.23k|#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|  4.23k|        const enum ObuMetaType meta_type = dav1d_get_uleb128(&gb);
 1373|  4.23k|        if (gb.error) goto error;
  ------------------
  |  Branch (1373:13): [True: 294, False: 3.93k]
  ------------------
 1374|       |
 1375|  3.93k|        switch (meta_type) {
 1376|    843|        case OBU_META_HDR_CLL: {
  ------------------
  |  Branch (1376:9): [True: 843, False: 3.09k]
  ------------------
 1377|    843|            Dav1dRef *ref = dav1d_ref_create(ALLOC_OBU_META,
  ------------------
  |  |   49|    843|#define dav1d_ref_create(type, size) dav1d_ref_create(size)
  ------------------
 1378|    843|                                             sizeof(Dav1dContentLightLevel));
 1379|    843|            if (!ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (1379:17): [True: 0, False: 843]
  ------------------
 1380|    843|            Dav1dContentLightLevel *const content_light = ref->data;
 1381|       |
 1382|    843|            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|    843|            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|    843|            if (check_trailing_bits(&gb, c->strict_std_compliance) < 0) {
  ------------------
  |  Branch (1395:17): [True: 557, False: 286]
  ------------------
 1396|    557|                dav1d_ref_dec(&ref);
 1397|    557|                goto error;
 1398|    557|            }
 1399|       |
 1400|    286|            dav1d_ref_dec(&c->content_light_ref);
 1401|    286|            c->content_light = content_light;
 1402|    286|            c->content_light_ref = ref;
 1403|    286|            break;
 1404|    843|        }
 1405|    616|        case OBU_META_HDR_MDCV: {
  ------------------
  |  Branch (1405:9): [True: 616, False: 3.32k]
  ------------------
 1406|    616|            Dav1dRef *ref = dav1d_ref_create(ALLOC_OBU_META,
  ------------------
  |  |   49|    616|#define dav1d_ref_create(type, size) dav1d_ref_create(size)
  ------------------
 1407|    616|                                             sizeof(Dav1dMasteringDisplay));
 1408|    616|            if (!ref) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (1408:17): [True: 0, False: 616]
  ------------------
 1409|    616|            Dav1dMasteringDisplay *const mastering_display = ref->data;
 1410|       |
 1411|  2.46k|            for (int i = 0; i < 3; i++) {
  ------------------
  |  Branch (1411:29): [True: 1.84k, False: 616]
  ------------------
 1412|  1.84k|                mastering_display->primaries[i][0] = dav1d_get_bits(&gb, 16);
 1413|  1.84k|                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.84k|            }
 1421|    616|            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|    616|            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|    616|            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|    616|            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|    616|            if (check_trailing_bits(&gb, c->strict_std_compliance) < 0) {
  ------------------
  |  Branch (1445:17): [True: 281, False: 335]
  ------------------
 1446|    281|                dav1d_ref_dec(&ref);
 1447|    281|                goto error;
 1448|    281|            }
 1449|       |
 1450|    335|            dav1d_ref_dec(&c->mastering_display_ref);
 1451|    335|            c->mastering_display = mastering_display;
 1452|    335|            c->mastering_display_ref = ref;
 1453|    335|            break;
 1454|    616|        }
 1455|  2.07k|        case OBU_META_ITUT_T35: {
  ------------------
  |  Branch (1455:9): [True: 2.07k, False: 1.86k]
  ------------------
 1456|  2.07k|            ptrdiff_t payload_size = gb.ptr_end - gb.ptr;
 1457|       |            // Don't take into account all the trailing bits for payload_size
 1458|  2.35k|            while (payload_size > 0 && !gb.ptr[payload_size - 1])
  ------------------
  |  Branch (1458:20): [True: 1.71k, False: 644]
  |  Branch (1458:40): [True: 283, False: 1.42k]
  ------------------
 1459|    283|                payload_size--; // trailing_zero_bit x 8
 1460|  2.07k|            payload_size--; // trailing_one_bit + trailing_zero_bit x 7
 1461|       |
 1462|  2.07k|            int country_code_extension_byte = 0;
 1463|  2.07k|            const int country_code = dav1d_get_bits(&gb, 8);
 1464|  2.07k|            payload_size--;
 1465|  2.07k|            if (country_code == 0xFF) {
  ------------------
  |  Branch (1465:17): [True: 545, False: 1.52k]
  ------------------
 1466|    545|                country_code_extension_byte = dav1d_get_bits(&gb, 8);
 1467|    545|                payload_size--;
 1468|    545|            }
 1469|       |
 1470|  2.07k|            if (payload_size <= 0 || gb.ptr[payload_size] != 0x80) {
  ------------------
  |  Branch (1470:17): [True: 657, False: 1.41k]
  |  Branch (1470:38): [True: 254, False: 1.16k]
  ------------------
 1471|    911|                dav1d_log(c, "Malformed ITU-T T.35 metadata message format\n");
  ------------------
  |  |   44|    911|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 911]
  |  |  ------------------
  ------------------
 1472|    911|                break;
 1473|    911|            }
 1474|       |
 1475|  1.16k|            if ((c->n_itut_t35 + 1) > INT_MAX / (int)sizeof(*c->itut_t35)) goto error;
  ------------------
  |  Branch (1475:17): [True: 0, False: 1.16k]
  ------------------
 1476|  1.16k|            uint8_t *const payload = dav1d_malloc(ALLOC_OBU_META, payload_size);
  ------------------
  |  |  132|  1.16k|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 1477|  1.16k|            if (!payload) goto error;
  ------------------
  |  Branch (1477:17): [True: 0, False: 1.16k]
  ------------------
 1478|       |
 1479|  1.16k|            struct itut_t35_ctx_context *itut_t35_ctx = NULL;
 1480|  1.16k|            if (!c->n_itut_t35) {
  ------------------
  |  Branch (1480:17): [True: 661, False: 499]
  ------------------
 1481|    661|                assert(!c->itut_t35_ref);
  ------------------
  |  Branch (1481:17): [True: 661, False: 0]
  ------------------
 1482|    661|                itut_t35_ctx = dav1d_malloc(ALLOC_OBU_META, sizeof(struct itut_t35_ctx_context));
  ------------------
  |  |  132|    661|#define dav1d_malloc(type, sz) malloc(sz)
  ------------------
 1483|    661|                if (!itut_t35_ctx) {
  ------------------
  |  Branch (1483:21): [True: 0, False: 661]
  ------------------
 1484|      0|                    dav1d_free(payload);
  ------------------
  |  |  135|      0|#define dav1d_free(ptr) free(ptr)
  ------------------
 1485|      0|                    goto error;
 1486|      0|                }
 1487|    661|            }
 1488|       |
 1489|  1.16k|            struct Dav1dITUTT35 *itut_t35 = dav1d_realloc(ALLOC_OBU_META, c->itut_t35,
  ------------------
  |  |  133|  1.16k|#define dav1d_realloc(type, ptr, sz) realloc(ptr, sz)
  ------------------
 1490|  1.16k|                                                          (c->n_itut_t35 + 1) * sizeof(*c->itut_t35));
 1491|  1.16k|            if (!itut_t35) {
  ------------------
  |  Branch (1491:17): [True: 0, False: 1.16k]
  ------------------
 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|  1.16k|            c->itut_t35 = itut_t35;
 1497|  1.16k|            memset(c->itut_t35 + c->n_itut_t35, 0, sizeof(*c->itut_t35));
 1498|       |
 1499|  1.16k|            if (!c->n_itut_t35) {
  ------------------
  |  Branch (1499:17): [True: 661, False: 499]
  ------------------
 1500|    661|                c->itut_t35_ref = dav1d_ref_init(&itut_t35_ctx->ref, c->itut_t35,
 1501|    661|                                                 dav1d_picture_free_itut_t35, itut_t35_ctx, 0);
 1502|    661|            } else {
 1503|    499|                assert(c->itut_t35_ref &&
  ------------------
  |  Branch (1503:17): [True: 499, False: 0]
  |  Branch (1503:17): [True: 499, False: 0]
  ------------------
 1504|    499|                       atomic_load_explicit(&c->itut_t35_ref->ref_cnt, memory_order_relaxed) == 1);
 1505|    499|                itut_t35_ctx = c->itut_t35_ref->user_data;
 1506|    499|                c->itut_t35_ref->const_data = (uint8_t *)c->itut_t35;
 1507|    499|            }
 1508|  1.16k|            itut_t35_ctx->itut_t35 = c->itut_t35;
 1509|  1.16k|            itut_t35_ctx->n_itut_t35 = c->n_itut_t35 + 1;
 1510|       |
 1511|  1.16k|            Dav1dITUTT35 *const itut_t35_metadata = &c->itut_t35[c->n_itut_t35];
 1512|  1.16k|            itut_t35_metadata->payload = payload;
 1513|       |
 1514|  1.16k|            itut_t35_metadata->country_code = country_code;
 1515|  1.16k|            itut_t35_metadata->country_code_extension_byte = country_code_extension_byte;
 1516|  1.16k|            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|  1.16k|            assert(gb.bits_left == 0);
  ------------------
  |  Branch (1520:13): [True: 1.16k, False: 0]
  ------------------
 1521|  1.16k|            memcpy(itut_t35_metadata->payload, gb.ptr, payload_size);
 1522|       |
 1523|  1.16k|            c->n_itut_t35++;
 1524|  1.16k|            break;
 1525|  1.16k|        }
 1526|      1|        case OBU_META_SCALABILITY:
  ------------------
  |  Branch (1526:9): [True: 1, False: 3.93k]
  ------------------
 1527|      1|        case OBU_META_TIMECODE:
  ------------------
  |  Branch (1527:9): [True: 0, False: 3.93k]
  ------------------
 1528|       |            // ignore metadata OBUs we don't care about
 1529|      1|            break;
 1530|    408|        default:
  ------------------
  |  Branch (1530:9): [True: 408, False: 3.53k]
  ------------------
 1531|       |            // print a warning but don't fail for unknown types
 1532|    408|            if (meta_type > 31) // Types 6 to 31 are "Unregistered user private", so ignore them.
  ------------------
  |  Branch (1532:17): [True: 276, False: 132]
  ------------------
 1533|    276|                dav1d_log(c, "Unknown Metadata OBU type %d\n", meta_type);
  ------------------
  |  |   44|    276|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 276]
  |  |  ------------------
  ------------------
 1534|    408|            break;
 1535|  3.93k|        }
 1536|       |
 1537|  3.10k|        break;
 1538|  3.93k|    }
 1539|  3.10k|    case DAV1D_OBU_TD:
  ------------------
  |  Branch (1539:5): [True: 2.13k, False: 110k]
  ------------------
 1540|  2.13k|        c->frame_flags |= PICTURE_FLAG_NEW_TEMPORAL_UNIT;
 1541|  2.13k|        break;
 1542|    294|    case DAV1D_OBU_PADDING:
  ------------------
  |  Branch (1542:5): [True: 294, False: 112k]
  ------------------
 1543|       |        // ignore OBUs we don't care about
 1544|    294|        break;
 1545|  2.56k|    default:
  ------------------
  |  Branch (1545:5): [True: 2.56k, False: 110k]
  ------------------
 1546|       |        // print a warning but don't fail for unknown types
 1547|  2.56k|        dav1d_log(c, "Unknown OBU type %d of size %td\n", type, gb.ptr_end - gb.ptr);
  ------------------
  |  |   44|  2.56k|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 2.56k]
  |  |  ------------------
  ------------------
 1548|  2.56k|        break;
 1549|   112k|    }
 1550|       |
 1551|  86.2k|    if (c->seq_hdr && c->frame_hdr) {
  ------------------
  |  Branch (1551:9): [True: 85.3k, False: 938]
  |  Branch (1551:23): [True: 58.1k, False: 27.2k]
  ------------------
 1552|  58.1k|        if (c->frame_hdr->show_existing_frame) {
  ------------------
  |  Branch (1552:13): [True: 6.33k, False: 51.8k]
  ------------------
 1553|  6.33k|            if (!c->refs[c->frame_hdr->existing_frame_idx].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (1553:17): [True: 389, False: 5.94k]
  ------------------
 1554|  5.94k|            switch (c->refs[c->frame_hdr->existing_frame_idx].p.p.frame_hdr->frame_type) {
 1555|    251|            case DAV1D_FRAME_TYPE_INTER:
  ------------------
  |  Branch (1555:13): [True: 251, False: 5.69k]
  ------------------
 1556|    458|            case DAV1D_FRAME_TYPE_SWITCH:
  ------------------
  |  Branch (1556:13): [True: 207, False: 5.73k]
  ------------------
 1557|    458|                if (c->decode_frame_type > DAV1D_DECODEFRAMETYPE_REFERENCE)
  ------------------
  |  Branch (1557:21): [True: 0, False: 458]
  ------------------
 1558|      0|                    goto skip;
 1559|    458|                break;
 1560|    503|            case DAV1D_FRAME_TYPE_INTRA:
  ------------------
  |  Branch (1560:13): [True: 503, False: 5.44k]
  ------------------
 1561|    503|                if (c->decode_frame_type > DAV1D_DECODEFRAMETYPE_INTRA)
  ------------------
  |  Branch (1561:21): [True: 0, False: 503]
  ------------------
 1562|      0|                    goto skip;
 1563|       |                // fall-through
 1564|  5.48k|            default:
  ------------------
  |  Branch (1564:13): [True: 4.98k, False: 961]
  ------------------
 1565|  5.48k|                break;
 1566|  5.94k|            }
 1567|  5.94k|            if (!c->refs[c->frame_hdr->existing_frame_idx].p.p.data[0]) goto error;
  ------------------
  |  Branch (1567:17): [True: 0, False: 5.94k]
  ------------------
 1568|  5.94k|            if (c->strict_std_compliance &&
  ------------------
  |  Branch (1568:17): [True: 0, False: 5.94k]
  ------------------
 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|  5.94k|            if (c->n_fc == 1) {
  ------------------
  |  Branch (1573:17): [True: 5.94k, False: 0]
  ------------------
 1574|  5.94k|                dav1d_thread_picture_ref(&c->out,
 1575|  5.94k|                                         &c->refs[c->frame_hdr->existing_frame_idx].p);
 1576|  5.94k|                dav1d_picture_copy_props(&c->out.p,
 1577|  5.94k|                                         c->content_light, c->content_light_ref,
 1578|  5.94k|                                         c->mastering_display, c->mastering_display_ref,
 1579|  5.94k|                                         c->itut_t35, c->itut_t35_ref, c->n_itut_t35,
 1580|  5.94k|                                         &in->m);
 1581|       |                // Must be removed from the context after being attached to the frame
 1582|  5.94k|                dav1d_ref_dec(&c->itut_t35_ref);
 1583|  5.94k|                c->itut_t35 = NULL;
 1584|  5.94k|                c->n_itut_t35 = 0;
 1585|  5.94k|                c->event_flags |= dav1d_picture_get_event_flags(&c->refs[c->frame_hdr->existing_frame_idx].p);
 1586|  5.94k|            } else {
 1587|      0|                pthread_mutex_lock(&c->task_thread.lock);
 1588|       |                // need to append this to the frame output queue
 1589|      0|                const unsigned next = c->frame_thread.next++;
 1590|      0|                if (c->frame_thread.next == c->n_fc)
  ------------------
  |  Branch (1590:21): [True: 0, False: 0]
  ------------------
 1591|      0|                    c->frame_thread.next = 0;
 1592|       |
 1593|      0|                Dav1dFrameContext *const f = &c->fc[next];
 1594|      0|                while (f->n_tile_data > 0)
  ------------------
  |  Branch (1594:24): [True: 0, False: 0]
  ------------------
 1595|      0|                    pthread_cond_wait(&f->task_thread.cond,
 1596|      0|                                      &f->task_thread.ttd->lock);
 1597|      0|                Dav1dThreadPicture *const out_delayed =
 1598|      0|                    &c->frame_thread.out_delayed[next];
 1599|      0|                if (out_delayed->p.data[0] ||
  ------------------
  |  Branch (1599:21): [True: 0, False: 0]
  ------------------
 1600|      0|                    atomic_load_explicit(&f->task_thread.error, memory_order_relaxed))
  ------------------
  |  Branch (1600:21): [True: 0, False: 0]
  ------------------
 1601|      0|                {
 1602|      0|                    unsigned first = atomic_load_explicit(&c->task_thread.first,
 1603|      0|                                                          memory_order_relaxed);
 1604|      0|                    if (first + 1U < c->n_fc)
  ------------------
  |  Branch (1604:25): [True: 0, False: 0]
  ------------------
 1605|      0|                        atomic_fetch_add_explicit(&c->task_thread.first, 1U, memory_order_relaxed);
 1606|      0|                    else
 1607|      0|                        atomic_store_explicit(&c->task_thread.first, 0, memory_order_relaxed);
 1608|      0|                    atomic_compare_exchange_strong_explicit(&c->task_thread.reset_task_cur,
 1609|      0|                                                            &first, UINT_MAX,
 1610|      0|                                                            memory_order_relaxed,
 1611|      0|                                                            memory_order_relaxed);
 1612|      0|                    if (c->task_thread.cur && c->task_thread.cur < c->n_fc)
  ------------------
  |  Branch (1612:25): [True: 0, False: 0]
  |  Branch (1612:47): [True: 0, False: 0]
  ------------------
 1613|      0|                        c->task_thread.cur--;
 1614|      0|                }
 1615|      0|                const int error = f->task_thread.retval;
 1616|      0|                if (error) {
  ------------------
  |  Branch (1616:21): [True: 0, False: 0]
  ------------------
 1617|      0|                    c->cached_error = error;
 1618|      0|                    f->task_thread.retval = 0;
 1619|      0|                    dav1d_data_props_copy(&c->cached_error_props, &out_delayed->p.m);
 1620|      0|                    dav1d_thread_picture_unref(out_delayed);
 1621|      0|                } else if (out_delayed->p.data[0]) {
  ------------------
  |  Branch (1621:28): [True: 0, False: 0]
  ------------------
 1622|      0|                    const unsigned progress = atomic_load_explicit(&out_delayed->progress[1],
 1623|      0|                                                                   memory_order_relaxed);
 1624|      0|                    if ((out_delayed->visible || c->output_invisible_frames) &&
  ------------------
  |  Branch (1624:26): [True: 0, False: 0]
  |  Branch (1624:50): [True: 0, False: 0]
  ------------------
 1625|      0|                        progress != FRAME_ERROR)
  ------------------
  |  |   35|      0|#define FRAME_ERROR (UINT_MAX - 1)
  ------------------
  |  Branch (1625:25): [True: 0, False: 0]
  ------------------
 1626|      0|                    {
 1627|      0|                        dav1d_thread_picture_ref(&c->out, out_delayed);
 1628|      0|                        c->event_flags |= dav1d_picture_get_event_flags(out_delayed);
 1629|      0|                    }
 1630|      0|                    dav1d_thread_picture_unref(out_delayed);
 1631|      0|                }
 1632|      0|                dav1d_thread_picture_ref(out_delayed,
 1633|      0|                                         &c->refs[c->frame_hdr->existing_frame_idx].p);
 1634|      0|                out_delayed->visible = 1;
 1635|      0|                dav1d_picture_copy_props(&out_delayed->p,
 1636|      0|                                         c->content_light, c->content_light_ref,
 1637|      0|                                         c->mastering_display, c->mastering_display_ref,
 1638|      0|                                         c->itut_t35, c->itut_t35_ref, c->n_itut_t35,
 1639|      0|                                         &in->m);
 1640|       |                // Must be removed from the context after being attached to the frame
 1641|      0|                dav1d_ref_dec(&c->itut_t35_ref);
 1642|      0|                c->itut_t35 = NULL;
 1643|      0|                c->n_itut_t35 = 0;
 1644|       |
 1645|      0|                pthread_mutex_unlock(&c->task_thread.lock);
 1646|      0|            }
 1647|  5.94k|            if (c->refs[c->frame_hdr->existing_frame_idx].p.p.frame_hdr->frame_type == DAV1D_FRAME_TYPE_KEY) {
  ------------------
  |  Branch (1647:17): [True: 4.98k, False: 961]
  ------------------
 1648|  4.98k|                const int r = c->frame_hdr->existing_frame_idx;
 1649|  4.98k|                c->refs[r].p.showable = 0;
 1650|  44.8k|                for (int i = 0; i < 8; i++) {
  ------------------
  |  Branch (1650:33): [True: 39.8k, False: 4.98k]
  ------------------
 1651|  39.8k|                    if (i == r) continue;
  ------------------
  |  Branch (1651:25): [True: 4.98k, False: 34.8k]
  ------------------
 1652|       |
 1653|  34.8k|                    if (c->refs[i].p.p.frame_hdr)
  ------------------
  |  Branch (1653:25): [True: 34.6k, False: 206]
  ------------------
 1654|  34.6k|                        dav1d_thread_picture_unref(&c->refs[i].p);
 1655|  34.8k|                    dav1d_thread_picture_ref(&c->refs[i].p, &c->refs[r].p);
 1656|       |
 1657|  34.8k|                    dav1d_cdf_thread_unref(&c->cdf[i]);
 1658|  34.8k|                    dav1d_cdf_thread_ref(&c->cdf[i], &c->cdf[r]);
 1659|       |
 1660|  34.8k|                    dav1d_ref_dec(&c->refs[i].segmap);
 1661|  34.8k|                    c->refs[i].segmap = c->refs[r].segmap;
 1662|  34.8k|                    if (c->refs[r].segmap)
  ------------------
  |  Branch (1662:25): [True: 3.03k, False: 31.8k]
  ------------------
 1663|  3.03k|                        dav1d_ref_inc(c->refs[r].segmap);
 1664|  34.8k|                    dav1d_ref_dec(&c->refs[i].refmvs);
 1665|  34.8k|                }
 1666|  4.98k|            }
 1667|  5.94k|            c->frame_hdr = NULL;
 1668|  51.8k|        } else if (c->n_tiles == c->frame_hdr->tiling.cols * c->frame_hdr->tiling.rows) {
  ------------------
  |  Branch (1668:20): [True: 47.5k, False: 4.27k]
  ------------------
 1669|  47.5k|            switch (c->frame_hdr->frame_type) {
 1670|  15.0k|            case DAV1D_FRAME_TYPE_INTER:
  ------------------
  |  Branch (1670:13): [True: 15.0k, False: 32.5k]
  ------------------
 1671|  15.1k|            case DAV1D_FRAME_TYPE_SWITCH:
  ------------------
  |  Branch (1671:13): [True: 107, False: 47.4k]
  ------------------
 1672|  15.1k|                if (c->decode_frame_type > DAV1D_DECODEFRAMETYPE_REFERENCE ||
  ------------------
  |  Branch (1672:21): [True: 0, False: 15.1k]
  ------------------
 1673|  15.1k|                    (c->decode_frame_type == DAV1D_DECODEFRAMETYPE_REFERENCE &&
  ------------------
  |  Branch (1673:22): [True: 0, False: 15.1k]
  ------------------
 1674|      0|                     !c->frame_hdr->refresh_frame_flags))
  ------------------
  |  Branch (1674:22): [True: 0, False: 0]
  ------------------
 1675|      0|                    goto skip;
 1676|  15.1k|                break;
 1677|  15.1k|            case DAV1D_FRAME_TYPE_INTRA:
  ------------------
  |  Branch (1677:13): [True: 435, False: 47.1k]
  ------------------
 1678|    435|                if (c->decode_frame_type > DAV1D_DECODEFRAMETYPE_INTRA ||
  ------------------
  |  Branch (1678:21): [True: 0, False: 435]
  ------------------
 1679|    435|                    (c->decode_frame_type == DAV1D_DECODEFRAMETYPE_REFERENCE &&
  ------------------
  |  Branch (1679:22): [True: 0, False: 435]
  ------------------
 1680|      0|                     !c->frame_hdr->refresh_frame_flags))
  ------------------
  |  Branch (1680:22): [True: 0, False: 0]
  ------------------
 1681|      0|                    goto skip;
 1682|       |                // fall-through
 1683|  32.4k|            default:
  ------------------
  |  Branch (1683:13): [True: 31.9k, False: 15.5k]
  ------------------
 1684|  32.4k|                break;
 1685|  47.5k|            }
 1686|  47.5k|            if (!c->n_tile_data)
  ------------------
  |  Branch (1686:17): [True: 0, False: 47.5k]
  ------------------
 1687|      0|                goto error;
 1688|  47.5k|            if ((res = dav1d_submit_frame(c)) < 0)
  ------------------
  |  Branch (1688:17): [True: 28.5k, False: 19.0k]
  ------------------
 1689|  28.5k|                return res;
 1690|  47.5k|            assert(!c->n_tile_data);
  ------------------
  |  Branch (1690:13): [True: 19.0k, False: 0]
  ------------------
 1691|  19.0k|            c->frame_hdr = NULL;
 1692|  19.0k|            c->n_tiles = 0;
 1693|  19.0k|        }
 1694|  58.1k|    }
 1695|       |
 1696|  57.3k|    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|  27.7k|error:
 1719|  27.7k|    dav1d_data_props_copy(&c->cached_error_props, &in->m);
 1720|  27.7k|    dav1d_log(c, gb.error ? "Overrun in OBU bit buffer\n" :
  ------------------
  |  |   44|  27.7k|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 27.7k]
  |  |  ------------------
  ------------------
 1721|  27.7k|                            "Error parsing OBU data\n");
 1722|  27.7k|    return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|  27.7k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 1723|  86.2k|}
obu.c:parse_seq_hdr:
   75|  38.5k|{
   76|  38.5k|#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|  38.5k|    memset(hdr, 0, sizeof(*hdr));
   83|  38.5k|    hdr->profile = dav1d_get_bits(gb, 3);
   84|  38.5k|    if (hdr->profile > 2) goto error;
  ------------------
  |  Branch (84:9): [True: 856, False: 37.7k]
  ------------------
   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|  37.7k|    hdr->still_picture = dav1d_get_bit(gb);
   91|  37.7k|    hdr->reduced_still_picture_header = dav1d_get_bit(gb);
   92|  37.7k|    if (hdr->reduced_still_picture_header && !hdr->still_picture) goto error;
  ------------------
  |  Branch (92:9): [True: 25.0k, False: 12.6k]
  |  Branch (92:46): [True: 361, False: 24.7k]
  ------------------
   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|  37.3k|    if (hdr->reduced_still_picture_header) {
  ------------------
  |  Branch (98:9): [True: 24.7k, False: 12.6k]
  ------------------
   99|  24.7k|        hdr->num_operating_points = 1;
  100|  24.7k|        hdr->operating_points[0].major_level = dav1d_get_bits(gb, 3);
  101|  24.7k|        hdr->operating_points[0].minor_level = dav1d_get_bits(gb, 2);
  102|  24.7k|        hdr->operating_points[0].initial_display_delay = 10;
  103|  24.7k|    } else {
  104|  12.6k|        hdr->timing_info_present = dav1d_get_bit(gb);
  105|  12.6k|        if (hdr->timing_info_present) {
  ------------------
  |  Branch (105:13): [True: 2.39k, False: 10.2k]
  ------------------
  106|  2.39k|            hdr->num_units_in_tick = dav1d_get_bits(gb, 32);
  107|  2.39k|            hdr->time_scale = dav1d_get_bits(gb, 32);
  108|  2.39k|            if (strict_std_compliance && (!hdr->num_units_in_tick || !hdr->time_scale))
  ------------------
  |  Branch (108:17): [True: 0, False: 2.39k]
  |  Branch (108:43): [True: 0, False: 0]
  |  Branch (108:70): [True: 0, False: 0]
  ------------------
  109|      0|                goto error;
  110|  2.39k|            hdr->equal_picture_interval = dav1d_get_bit(gb);
  111|  2.39k|            if (hdr->equal_picture_interval) {
  ------------------
  |  Branch (111:17): [True: 1.27k, False: 1.11k]
  ------------------
  112|  1.27k|                const unsigned num_ticks_per_picture = dav1d_get_vlc(gb);
  113|  1.27k|                if (num_ticks_per_picture == UINT32_MAX)
  ------------------
  |  Branch (113:21): [True: 202, False: 1.07k]
  ------------------
  114|    202|                    goto error;
  115|  1.07k|                hdr->num_ticks_per_picture = num_ticks_per_picture + 1;
  116|  1.07k|            }
  117|       |
  118|  2.19k|            hdr->decoder_model_info_present = dav1d_get_bit(gb);
  119|  2.19k|            if (hdr->decoder_model_info_present) {
  ------------------
  |  Branch (119:17): [True: 1.34k, False: 848]
  ------------------
  120|  1.34k|                hdr->encoder_decoder_buffer_delay_length = dav1d_get_bits(gb, 5) + 1;
  121|  1.34k|                hdr->num_units_in_decoding_tick = dav1d_get_bits(gb, 32);
  122|  1.34k|                if (strict_std_compliance && !hdr->num_units_in_decoding_tick)
  ------------------
  |  Branch (122:21): [True: 0, False: 1.34k]
  |  Branch (122:46): [True: 0, False: 0]
  ------------------
  123|      0|                    goto error;
  124|  1.34k|                hdr->buffer_removal_delay_length = dav1d_get_bits(gb, 5) + 1;
  125|  1.34k|                hdr->frame_presentation_delay_length = dav1d_get_bits(gb, 5) + 1;
  126|  1.34k|            }
  127|  2.19k|        }
  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|  12.4k|        hdr->display_model_info_present = dav1d_get_bit(gb);
  134|  12.4k|        hdr->num_operating_points = dav1d_get_bits(gb, 5) + 1;
  135|  30.6k|        for (int i = 0; i < hdr->num_operating_points; i++) {
  ------------------
  |  Branch (135:25): [True: 19.1k, False: 11.5k]
  ------------------
  136|  19.1k|            struct Dav1dSequenceHeaderOperatingPoint *const op =
  137|  19.1k|                &hdr->operating_points[i];
  138|  19.1k|            op->idc = dav1d_get_bits(gb, 12);
  139|  19.1k|            if (op->idc && (!(op->idc & 0xff) || !(op->idc & 0xf00)))
  ------------------
  |  Branch (139:17): [True: 14.0k, False: 5.12k]
  |  Branch (139:29): [True: 578, False: 13.4k]
  |  Branch (139:50): [True: 327, False: 13.1k]
  ------------------
  140|    905|                goto error;
  141|  18.2k|            op->major_level = 2 + dav1d_get_bits(gb, 3);
  142|  18.2k|            op->minor_level = dav1d_get_bits(gb, 2);
  143|  18.2k|            if (op->major_level > 3)
  ------------------
  |  Branch (143:17): [True: 6.03k, False: 12.2k]
  ------------------
  144|  6.03k|                op->tier = dav1d_get_bit(gb);
  145|  18.2k|            if (hdr->decoder_model_info_present) {
  ------------------
  |  Branch (145:17): [True: 4.43k, False: 13.8k]
  ------------------
  146|  4.43k|                op->decoder_model_param_present = dav1d_get_bit(gb);
  147|  4.43k|                if (op->decoder_model_param_present) {
  ------------------
  |  Branch (147:21): [True: 3.34k, False: 1.08k]
  ------------------
  148|  3.34k|                    struct Dav1dSequenceHeaderOperatingParameterInfo *const opi =
  149|  3.34k|                        &hdr->operating_parameter_info[i];
  150|  3.34k|                    opi->decoder_buffer_delay =
  151|  3.34k|                        dav1d_get_bits(gb, hdr->encoder_decoder_buffer_delay_length);
  152|  3.34k|                    opi->encoder_buffer_delay =
  153|  3.34k|                        dav1d_get_bits(gb, hdr->encoder_decoder_buffer_delay_length);
  154|  3.34k|                    opi->low_delay_mode = dav1d_get_bit(gb);
  155|  3.34k|                }
  156|  4.43k|            }
  157|  18.2k|            if (hdr->display_model_info_present)
  ------------------
  |  Branch (157:17): [True: 5.45k, False: 12.7k]
  ------------------
  158|  5.45k|                op->display_model_param_present = dav1d_get_bit(gb);
  159|  18.2k|            op->initial_display_delay =
  160|  18.2k|                op->display_model_param_present ? dav1d_get_bits(gb, 4) + 1 : 10;
  ------------------
  |  Branch (160:17): [True: 3.16k, False: 15.0k]
  ------------------
  161|  18.2k|        }
  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|  12.4k|    }
  167|       |
  168|  36.2k|    hdr->width_n_bits = dav1d_get_bits(gb, 4) + 1;
  169|  36.2k|    hdr->height_n_bits = dav1d_get_bits(gb, 4) + 1;
  170|  36.2k|    hdr->max_width = dav1d_get_bits(gb, hdr->width_n_bits) + 1;
  171|  36.2k|    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|  36.2k|    if (!hdr->reduced_still_picture_header) {
  ------------------
  |  Branch (176:9): [True: 11.5k, False: 24.7k]
  ------------------
  177|  11.5k|        hdr->frame_id_numbers_present = dav1d_get_bit(gb);
  178|  11.5k|        if (hdr->frame_id_numbers_present) {
  ------------------
  |  Branch (178:13): [True: 1.27k, False: 10.2k]
  ------------------
  179|  1.27k|            hdr->delta_frame_id_n_bits = dav1d_get_bits(gb, 4) + 2;
  180|  1.27k|            hdr->frame_id_n_bits = dav1d_get_bits(gb, 3) + hdr->delta_frame_id_n_bits + 1;
  181|  1.27k|        }
  182|  11.5k|    }
  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|  36.2k|    hdr->sb128 = dav1d_get_bit(gb);
  189|  36.2k|    hdr->filter_intra = dav1d_get_bit(gb);
  190|  36.2k|    hdr->intra_edge_filter = dav1d_get_bit(gb);
  191|  36.2k|    if (hdr->reduced_still_picture_header) {
  ------------------
  |  Branch (191:9): [True: 24.7k, False: 11.5k]
  ------------------
  192|  24.7k|        hdr->screen_content_tools = DAV1D_ADAPTIVE;
  193|  24.7k|        hdr->force_integer_mv = DAV1D_ADAPTIVE;
  194|  24.7k|    } else {
  195|  11.5k|        hdr->inter_intra = dav1d_get_bit(gb);
  196|  11.5k|        hdr->masked_compound = dav1d_get_bit(gb);
  197|  11.5k|        hdr->warped_motion = dav1d_get_bit(gb);
  198|  11.5k|        hdr->dual_filter = dav1d_get_bit(gb);
  199|  11.5k|        hdr->order_hint = dav1d_get_bit(gb);
  200|  11.5k|        if (hdr->order_hint) {
  ------------------
  |  Branch (200:13): [True: 7.65k, False: 3.87k]
  ------------------
  201|  7.65k|            hdr->jnt_comp = dav1d_get_bit(gb);
  202|  7.65k|            hdr->ref_frame_mvs = dav1d_get_bit(gb);
  203|  7.65k|        }
  204|  11.5k|        hdr->screen_content_tools = dav1d_get_bit(gb) ? DAV1D_ADAPTIVE : dav1d_get_bit(gb);
  ------------------
  |  Branch (204:37): [True: 4.73k, False: 6.79k]
  ------------------
  205|       |    #if DEBUG_SEQ_HDR
  206|       |        printf("SEQHDR: post-screentools: off=%u\n",
  207|       |               dav1d_get_bits_pos(gb) - init_bit_pos);
  208|       |    #endif
  209|  11.5k|        hdr->force_integer_mv = hdr->screen_content_tools ?
  ------------------
  |  Branch (209:33): [True: 8.12k, False: 3.40k]
  ------------------
  210|  8.12k|                                dav1d_get_bit(gb) ? DAV1D_ADAPTIVE : dav1d_get_bit(gb) : 2;
  ------------------
  |  Branch (210:33): [True: 2.31k, False: 5.81k]
  ------------------
  211|  11.5k|        if (hdr->order_hint)
  ------------------
  |  Branch (211:13): [True: 7.65k, False: 3.87k]
  ------------------
  212|  7.65k|            hdr->order_hint_n_bits = dav1d_get_bits(gb, 3) + 1;
  213|  11.5k|    }
  214|  36.2k|    hdr->super_res = dav1d_get_bit(gb);
  215|  36.2k|    hdr->cdef = dav1d_get_bit(gb);
  216|  36.2k|    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|  36.2k|    hdr->hbd = dav1d_get_bit(gb);
  223|  36.2k|    if (hdr->profile == 2 && hdr->hbd)
  ------------------
  |  Branch (223:9): [True: 14.1k, False: 22.0k]
  |  Branch (223:30): [True: 9.79k, False: 4.40k]
  ------------------
  224|  9.79k|        hdr->hbd += dav1d_get_bit(gb);
  225|  36.2k|    if (hdr->profile != 1)
  ------------------
  |  Branch (225:9): [True: 26.8k, False: 9.39k]
  ------------------
  226|  26.8k|        hdr->monochrome = dav1d_get_bit(gb);
  227|  36.2k|    hdr->color_description_present = dav1d_get_bit(gb);
  228|  36.2k|    if (hdr->color_description_present) {
  ------------------
  |  Branch (228:9): [True: 4.34k, False: 31.9k]
  ------------------
  229|  4.34k|        hdr->pri = dav1d_get_bits(gb, 8);
  230|  4.34k|        hdr->trc = dav1d_get_bits(gb, 8);
  231|  4.34k|        hdr->mtrx = dav1d_get_bits(gb, 8);
  232|  31.9k|    } else {
  233|  31.9k|        hdr->pri = DAV1D_COLOR_PRI_UNKNOWN;
  234|  31.9k|        hdr->trc = DAV1D_TRC_UNKNOWN;
  235|  31.9k|        hdr->mtrx = DAV1D_MC_UNKNOWN;
  236|  31.9k|    }
  237|  36.2k|    if (hdr->monochrome) {
  ------------------
  |  Branch (237:9): [True: 13.3k, False: 22.9k]
  ------------------
  238|  13.3k|        hdr->color_range = dav1d_get_bit(gb);
  239|  13.3k|        hdr->layout = DAV1D_PIXEL_LAYOUT_I400;
  240|  13.3k|        hdr->ss_hor = hdr->ss_ver = 1;
  241|  13.3k|        hdr->chr = DAV1D_CHR_UNKNOWN;
  242|  22.9k|    } else if (hdr->pri == DAV1D_COLOR_PRI_BT709 &&
  ------------------
  |  Branch (242:16): [True: 3.02k, False: 19.8k]
  ------------------
  243|  3.02k|               hdr->trc == DAV1D_TRC_SRGB &&
  ------------------
  |  Branch (243:16): [True: 2.01k, False: 1.01k]
  ------------------
  244|  2.01k|               hdr->mtrx == DAV1D_MC_IDENTITY)
  ------------------
  |  Branch (244:16): [True: 1.76k, False: 251]
  ------------------
  245|  1.76k|    {
  246|  1.76k|        hdr->layout = DAV1D_PIXEL_LAYOUT_I444;
  247|  1.76k|        hdr->color_range = 1;
  248|  1.76k|        if (hdr->profile != 1 && !(hdr->profile == 2 && hdr->hbd == 2))
  ------------------
  |  Branch (248:13): [True: 1.43k, False: 326]
  |  Branch (248:36): [True: 261, False: 1.17k]
  |  Branch (248:57): [True: 66, False: 195]
  ------------------
  249|  1.36k|            goto error;
  250|  21.1k|    } else {
  251|  21.1k|        hdr->color_range = dav1d_get_bit(gb);
  252|  21.1k|        switch (hdr->profile) {
  ------------------
  |  Branch (252:17): [True: 21.1k, False: 0]
  ------------------
  253|  6.25k|        case 0: hdr->layout = DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (253:9): [True: 6.25k, False: 14.9k]
  ------------------
  254|  6.25k|                hdr->ss_hor = hdr->ss_ver = 1;
  255|  6.25k|                break;
  256|  9.07k|        case 1: hdr->layout = DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (256:9): [True: 9.07k, False: 12.0k]
  ------------------
  257|  9.07k|                break;
  258|  5.83k|        case 2:
  ------------------
  |  Branch (258:9): [True: 5.83k, False: 15.3k]
  ------------------
  259|  5.83k|            if (hdr->hbd == 2) {
  ------------------
  |  Branch (259:17): [True: 2.84k, False: 2.98k]
  ------------------
  260|  2.84k|                hdr->ss_hor = dav1d_get_bit(gb);
  261|  2.84k|                if (hdr->ss_hor)
  ------------------
  |  Branch (261:21): [True: 1.09k, False: 1.74k]
  ------------------
  262|  1.09k|                    hdr->ss_ver = dav1d_get_bit(gb);
  263|  2.84k|            } else
  264|  2.98k|                hdr->ss_hor = 1;
  265|  5.83k|            hdr->layout = hdr->ss_hor ?
  ------------------
  |  Branch (265:27): [True: 4.08k, False: 1.74k]
  ------------------
  266|  4.08k|                          hdr->ss_ver ? DAV1D_PIXEL_LAYOUT_I420 :
  ------------------
  |  Branch (266:27): [True: 621, False: 3.46k]
  ------------------
  267|  4.08k|                                        DAV1D_PIXEL_LAYOUT_I422 :
  268|  5.83k|                                        DAV1D_PIXEL_LAYOUT_I444;
  269|  5.83k|            break;
  270|  21.1k|        }
  271|  21.1k|        hdr->chr = (hdr->ss_hor & hdr->ss_ver) ?
  ------------------
  |  Branch (271:20): [True: 6.87k, False: 14.2k]
  ------------------
  272|  14.2k|                   dav1d_get_bits(gb, 2) : DAV1D_CHR_UNKNOWN;
  273|  21.1k|    }
  274|  34.8k|    if (strict_std_compliance &&
  ------------------
  |  Branch (274:9): [True: 0, False: 34.8k]
  ------------------
  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|  34.8k|    if (!hdr->monochrome)
  ------------------
  |  Branch (279:9): [True: 21.5k, False: 13.3k]
  ------------------
  280|  21.5k|        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|  34.8k|    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|  34.8k|    return check_trailing_bits(gb, strict_std_compliance);
  297|       |
  298|  3.69k|error:
  299|  3.69k|    return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|  3.69k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  300|  34.8k|}
obu.c:parse_frame_hdr:
  419|  77.0k|static int parse_frame_hdr(Dav1dContext *const c, GetBits *const gb) {
  420|  77.0k|#define DEBUG_FRAME_HDR 0
  421|       |
  422|       |#if DEBUG_FRAME_HDR
  423|       |    const uint8_t *const init_ptr = gb->ptr;
  424|       |#endif
  425|  77.0k|    const Dav1dSequenceHeader *const seqhdr = c->seq_hdr;
  426|  77.0k|    Dav1dFrameHeader *const hdr = c->frame_hdr;
  427|       |
  428|  77.0k|    if (!seqhdr->reduced_still_picture_header)
  ------------------
  |  Branch (428:9): [True: 41.2k, False: 35.7k]
  ------------------
  429|  41.2k|        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|  77.0k|    if (hdr->show_existing_frame) {
  ------------------
  |  Branch (434:9): [True: 7.13k, False: 69.8k]
  ------------------
  435|  7.13k|        hdr->existing_frame_idx = dav1d_get_bits(gb, 3);
  436|  7.13k|        if (seqhdr->decoder_model_info_present && !seqhdr->equal_picture_interval)
  ------------------
  |  Branch (436:13): [True: 548, False: 6.58k]
  |  Branch (436:51): [True: 196, False: 352]
  ------------------
  437|    196|            hdr->frame_presentation_delay = dav1d_get_bits(gb, seqhdr->frame_presentation_delay_length);
  438|  7.13k|        if (seqhdr->frame_id_numbers_present) {
  ------------------
  |  Branch (438:13): [True: 1.89k, False: 5.23k]
  ------------------
  439|  1.89k|            hdr->frame_id = dav1d_get_bits(gb, seqhdr->frame_id_n_bits);
  440|  1.89k|            Dav1dFrameHeader *const ref_frame_hdr = c->refs[hdr->existing_frame_idx].p.p.frame_hdr;
  441|  1.89k|            if (!ref_frame_hdr || ref_frame_hdr->frame_id != hdr->frame_id) goto error;
  ------------------
  |  Branch (441:17): [True: 260, False: 1.63k]
  |  Branch (441:35): [True: 202, False: 1.43k]
  ------------------
  442|  1.89k|        }
  443|  6.67k|        return 0;
  444|  7.13k|    }
  445|       |
  446|  69.8k|    if (seqhdr->reduced_still_picture_header) {
  ------------------
  |  Branch (446:9): [True: 35.7k, False: 34.1k]
  ------------------
  447|  35.7k|        hdr->frame_type = DAV1D_FRAME_TYPE_KEY;
  448|  35.7k|        hdr->show_frame = 1;
  449|  35.7k|    } else {
  450|  34.1k|        hdr->frame_type = dav1d_get_bits(gb, 2);
  451|  34.1k|        hdr->show_frame = dav1d_get_bit(gb);
  452|  34.1k|    }
  453|  69.8k|    if (hdr->show_frame) {
  ------------------
  |  Branch (453:9): [True: 60.5k, False: 9.39k]
  ------------------
  454|  60.5k|        if (seqhdr->decoder_model_info_present && !seqhdr->equal_picture_interval)
  ------------------
  |  Branch (454:13): [True: 1.27k, False: 59.2k]
  |  Branch (454:51): [True: 1.00k, False: 276]
  ------------------
  455|  1.00k|            hdr->frame_presentation_delay = dav1d_get_bits(gb, seqhdr->frame_presentation_delay_length);
  456|  60.5k|        hdr->showable_frame = hdr->frame_type != DAV1D_FRAME_TYPE_KEY;
  457|  60.5k|    } else
  458|  9.39k|        hdr->showable_frame = dav1d_get_bit(gb);
  459|  69.8k|    hdr->error_resilient_mode =
  460|  69.8k|        (hdr->frame_type == DAV1D_FRAME_TYPE_KEY && hdr->show_frame) ||
  ------------------
  |  Branch (460:10): [True: 44.1k, False: 25.7k]
  |  Branch (460:53): [True: 42.8k, False: 1.30k]
  ------------------
  461|  27.0k|        hdr->frame_type == DAV1D_FRAME_TYPE_SWITCH ||
  ------------------
  |  Branch (461:9): [True: 2.33k, False: 24.7k]
  ------------------
  462|  24.7k|        seqhdr->reduced_still_picture_header || dav1d_get_bit(gb);
  ------------------
  |  Branch (462:9): [True: 0, False: 24.7k]
  |  Branch (462:49): [True: 2.50k, False: 22.2k]
  ------------------
  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|  69.8k|    hdr->disable_cdf_update = dav1d_get_bit(gb);
  468|  69.8k|    hdr->allow_screen_content_tools = seqhdr->screen_content_tools == DAV1D_ADAPTIVE ?
  ------------------
  |  Branch (468:39): [True: 47.6k, False: 22.2k]
  ------------------
  469|  47.6k|                                      dav1d_get_bit(gb) : seqhdr->screen_content_tools;
  470|  69.8k|    if (hdr->allow_screen_content_tools)
  ------------------
  |  Branch (470:9): [True: 45.2k, False: 24.6k]
  ------------------
  471|  45.2k|        hdr->force_integer_mv = seqhdr->force_integer_mv == DAV1D_ADAPTIVE ?
  ------------------
  |  Branch (471:33): [True: 28.4k, False: 16.8k]
  ------------------
  472|  28.4k|                                dav1d_get_bit(gb) : seqhdr->force_integer_mv;
  473|       |
  474|  69.8k|    if (IS_KEY_OR_INTRA(hdr))
  ------------------
  |  |   43|  69.8k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  69.8k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 45.7k, False: 24.1k]
  |  |  ------------------
  ------------------
  475|  45.7k|        hdr->force_integer_mv = 1;
  476|       |
  477|  69.8k|    if (seqhdr->frame_id_numbers_present)
  ------------------
  |  Branch (477:9): [True: 1.41k, False: 68.4k]
  ------------------
  478|  1.41k|        hdr->frame_id = dav1d_get_bits(gb, seqhdr->frame_id_n_bits);
  479|       |
  480|  69.8k|    if (!seqhdr->reduced_still_picture_header)
  ------------------
  |  Branch (480:9): [True: 34.1k, False: 35.7k]
  ------------------
  481|  34.1k|        hdr->frame_size_override = hdr->frame_type == DAV1D_FRAME_TYPE_SWITCH ? 1 : dav1d_get_bit(gb);
  ------------------
  |  Branch (481:36): [True: 2.33k, False: 31.8k]
  ------------------
  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|  69.8k|    if (seqhdr->order_hint)
  ------------------
  |  Branch (486:9): [True: 24.6k, False: 45.2k]
  ------------------
  487|  24.6k|        hdr->frame_offset = dav1d_get_bits(gb, seqhdr->order_hint_n_bits);
  488|  69.8k|    hdr->primary_ref_frame = !hdr->error_resilient_mode && IS_INTER_OR_SWITCH(hdr) ?
  ------------------
  |  |   36|  22.2k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 20.9k, False: 1.28k]
  |  |  ------------------
  ------------------
  |  Branch (488:30): [True: 22.2k, False: 47.6k]
  ------------------
  489|  48.9k|                             dav1d_get_bits(gb, 3) : DAV1D_PRIMARY_REF_NONE;
  ------------------
  |  |   45|   118k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  490|       |
  491|  69.8k|    if (seqhdr->decoder_model_info_present) {
  ------------------
  |  Branch (491:9): [True: 1.29k, False: 68.6k]
  ------------------
  492|  1.29k|        hdr->buffer_removal_time_present = dav1d_get_bit(gb);
  493|  1.29k|        if (hdr->buffer_removal_time_present) {
  ------------------
  |  Branch (493:13): [True: 513, False: 782]
  ------------------
  494|  3.83k|            for (int i = 0; i < c->seq_hdr->num_operating_points; i++) {
  ------------------
  |  Branch (494:29): [True: 3.32k, False: 513]
  ------------------
  495|  3.32k|                const struct Dav1dSequenceHeaderOperatingPoint *const seqop = &seqhdr->operating_points[i];
  496|  3.32k|                struct Dav1dFrameHeaderOperatingPoint *const op = &hdr->operating_points[i];
  497|  3.32k|                if (seqop->decoder_model_param_present) {
  ------------------
  |  Branch (497:21): [True: 2.70k, False: 621]
  ------------------
  498|  2.70k|                    int in_temporal_layer = (seqop->idc >> hdr->temporal_id) & 1;
  499|  2.70k|                    int in_spatial_layer  = (seqop->idc >> (hdr->spatial_id + 8)) & 1;
  500|  2.70k|                    if (!seqop->idc || (in_temporal_layer && in_spatial_layer))
  ------------------
  |  Branch (500:25): [True: 292, False: 2.40k]
  |  Branch (500:41): [True: 1.94k, False: 468]
  |  Branch (500:62): [True: 1.33k, False: 602]
  ------------------
  501|  1.63k|                        op->buffer_removal_time = dav1d_get_bits(gb, seqhdr->buffer_removal_delay_length);
  502|  2.70k|                }
  503|  3.32k|            }
  504|    513|        }
  505|  1.29k|    }
  506|       |
  507|  69.8k|    if (IS_KEY_OR_INTRA(hdr)) {
  ------------------
  |  |   43|  69.8k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  69.8k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 45.7k, False: 24.1k]
  |  |  ------------------
  ------------------
  508|  45.7k|        hdr->refresh_frame_flags = (hdr->frame_type == DAV1D_FRAME_TYPE_KEY &&
  ------------------
  |  Branch (508:37): [True: 44.1k, False: 1.60k]
  ------------------
  509|  44.1k|                                    hdr->show_frame) ? 0xff : dav1d_get_bits(gb, 8);
  ------------------
  |  Branch (509:37): [True: 42.8k, False: 1.30k]
  ------------------
  510|  45.7k|        if (hdr->refresh_frame_flags != 0xff && hdr->error_resilient_mode && seqhdr->order_hint)
  ------------------
  |  Branch (510:13): [True: 2.84k, False: 42.8k]
  |  Branch (510:49): [True: 1.58k, False: 1.25k]
  |  Branch (510:78): [True: 932, False: 656]
  ------------------
  511|  8.38k|            for (int i = 0; i < 8; i++)
  ------------------
  |  Branch (511:29): [True: 7.45k, False: 932]
  ------------------
  512|  7.45k|                dav1d_get_bits(gb, seqhdr->order_hint_n_bits);
  513|  45.7k|        if (c->strict_std_compliance &&
  ------------------
  |  Branch (513:13): [True: 0, False: 45.7k]
  ------------------
  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|  45.7k|        if (read_frame_size(c, gb, 0) < 0) goto error;
  ------------------
  |  Branch (518:13): [True: 637, False: 45.0k]
  ------------------
  519|  45.0k|        if (hdr->allow_screen_content_tools && !hdr->super_res.enabled)
  ------------------
  |  Branch (519:13): [True: 29.3k, False: 15.7k]
  |  Branch (519:48): [True: 27.7k, False: 1.63k]
  ------------------
  520|  27.7k|            hdr->allow_intrabc = dav1d_get_bit(gb);
  521|  45.0k|    } else {
  522|  24.1k|        hdr->refresh_frame_flags = hdr->frame_type == DAV1D_FRAME_TYPE_SWITCH ? 0xff :
  ------------------
  |  Branch (522:36): [True: 2.33k, False: 21.8k]
  ------------------
  523|  24.1k|                                   dav1d_get_bits(gb, 8);
  524|  24.1k|        if (hdr->error_resilient_mode && seqhdr->order_hint)
  ------------------
  |  Branch (524:13): [True: 3.22k, False: 20.9k]
  |  Branch (524:42): [True: 2.44k, False: 779]
  ------------------
  525|  21.9k|            for (int i = 0; i < 8; i++)
  ------------------
  |  Branch (525:29): [True: 19.5k, False: 2.44k]
  ------------------
  526|  19.5k|                dav1d_get_bits(gb, seqhdr->order_hint_n_bits);
  527|  24.1k|        if (seqhdr->order_hint) {
  ------------------
  |  Branch (527:13): [True: 19.7k, False: 4.45k]
  ------------------
  528|  19.7k|            hdr->frame_ref_short_signaling = dav1d_get_bit(gb);
  529|  19.7k|            if (hdr->frame_ref_short_signaling) {
  ------------------
  |  Branch (529:17): [True: 13.2k, False: 6.48k]
  ------------------
  530|  13.2k|                hdr->refidx[0] = dav1d_get_bits(gb, 3);
  531|  13.2k|                hdr->refidx[1] = hdr->refidx[2] = -1;
  532|  13.2k|                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|  13.2k|                int frame_offset_mem[8+1];
  537|  13.2k|                int *const frame_offset = &frame_offset_mem[1];
  538|  13.2k|                int earliest_ref = -1;
  539|   116k|                for (int i = 0, earliest_offset = INT_MAX; i < 8; i++) {
  ------------------
  |  Branch (539:60): [True: 104k, False: 12.7k]
  ------------------
  540|   104k|                    const Dav1dFrameHeader *const refhdr = c->refs[i].p.p.frame_hdr;
  541|   104k|                    if (!refhdr) goto error;
  ------------------
  |  Branch (541:25): [True: 523, False: 103k]
  ------------------
  542|   103k|                    const int diff = get_poc_diff(seqhdr->order_hint_n_bits,
  543|   103k|                                                  refhdr->frame_offset,
  544|   103k|                                                  hdr->frame_offset);
  545|   103k|                    frame_offset[i] = diff;
  546|   103k|                    if (diff < earliest_offset) {
  ------------------
  |  Branch (546:25): [True: 16.4k, False: 87.2k]
  ------------------
  547|  16.4k|                        earliest_offset = diff;
  548|  16.4k|                        earliest_ref = i;
  549|  16.4k|                    }
  550|   103k|                }
  551|  12.7k|                frame_offset[hdr->refidx[0]] = INT_MIN; // = reference frame is used
  552|  12.7k|                frame_offset[hdr->refidx[3]] = INT_MIN;
  553|  12.7k|                assert(earliest_ref >= 0);
  ------------------
  |  Branch (553:17): [True: 12.7k, False: 0]
  ------------------
  554|       |
  555|  12.7k|                int refidx = -1;
  556|   114k|                for (int i = 0, latest_offset = 0; i < 8; i++) {
  ------------------
  |  Branch (556:52): [True: 101k, False: 12.7k]
  ------------------
  557|   101k|                    const int hint = frame_offset[i];
  558|   101k|                    if (hint >= latest_offset) {
  ------------------
  |  Branch (558:25): [True: 59.0k, False: 42.7k]
  ------------------
  559|  59.0k|                        latest_offset = hint;
  560|  59.0k|                        refidx = i;
  561|  59.0k|                    }
  562|   101k|                }
  563|  12.7k|                frame_offset[refidx] = INT_MIN;
  564|  12.7k|                hdr->refidx[6] = refidx;
  565|       |
  566|  38.1k|                for (int i = 4; i < 6; i++) {
  ------------------
  |  Branch (566:33): [True: 25.4k, False: 12.7k]
  ------------------
  567|       |                    /* Unsigned compares to handle negative values. */
  568|  25.4k|                    unsigned earliest_offset = UINT8_MAX;
  569|  25.4k|                    refidx = -1;
  570|   229k|                    for (int j = 0; j < 8; j++) {
  ------------------
  |  Branch (570:37): [True: 203k, False: 25.4k]
  ------------------
  571|   203k|                        const unsigned hint = frame_offset[j];
  572|   203k|                        if (hint < earliest_offset) {
  ------------------
  |  Branch (572:29): [True: 23.7k, False: 179k]
  ------------------
  573|  23.7k|                            earliest_offset = hint;
  574|  23.7k|                            refidx = j;
  575|  23.7k|                        }
  576|   203k|                    }
  577|  25.4k|                    frame_offset[refidx] = INT_MIN;
  578|  25.4k|                    hdr->refidx[i] = refidx;
  579|  25.4k|                }
  580|       |
  581|  89.0k|                for (int i = 1; i < 7; i++) {
  ------------------
  |  Branch (581:33): [True: 76.3k, False: 12.7k]
  ------------------
  582|  76.3k|                    refidx = hdr->refidx[i];
  583|  76.3k|                    if (refidx < 0) {
  ------------------
  |  Branch (583:25): [True: 30.0k, False: 46.2k]
  ------------------
  584|  30.0k|                        unsigned latest_offset = ~UINT8_MAX;
  585|   270k|                        for (int j = 0; j < 8; j++) {
  ------------------
  |  Branch (585:41): [True: 240k, False: 30.0k]
  ------------------
  586|   240k|                            const unsigned hint = frame_offset[j];
  587|   240k|                            if (hint >= latest_offset) {
  ------------------
  |  Branch (587:33): [True: 37.0k, False: 203k]
  ------------------
  588|  37.0k|                                latest_offset = hint;
  589|  37.0k|                                refidx = j;
  590|  37.0k|                            }
  591|   240k|                        }
  592|  30.0k|                        frame_offset[refidx] = INT_MIN;
  593|  30.0k|                        hdr->refidx[i] = refidx >= 0 ? refidx : earliest_ref;
  ------------------
  |  Branch (593:42): [True: 11.6k, False: 18.4k]
  ------------------
  594|  30.0k|                    }
  595|  76.3k|                }
  596|  12.7k|            }
  597|  19.7k|        }
  598|   184k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (598:25): [True: 161k, False: 22.9k]
  ------------------
  599|   161k|            if (!hdr->frame_ref_short_signaling)
  ------------------
  |  Branch (599:17): [True: 72.0k, False: 89.0k]
  ------------------
  600|  72.0k|                hdr->refidx[i] = dav1d_get_bits(gb, 3);
  601|   161k|            if (seqhdr->frame_id_numbers_present) {
  ------------------
  |  Branch (601:17): [True: 977, False: 160k]
  ------------------
  602|    977|                const unsigned delta_ref_frame_id = dav1d_get_bits(gb, seqhdr->delta_frame_id_n_bits) + 1;
  603|    977|                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|    977|                Dav1dFrameHeader *const ref_frame_hdr = c->refs[hdr->refidx[i]].p.p.frame_hdr;
  605|    977|                if (!ref_frame_hdr || ref_frame_hdr->frame_id != ref_frame_id) goto error;
  ------------------
  |  Branch (605:21): [True: 555, False: 422]
  |  Branch (605:39): [True: 205, False: 217]
  ------------------
  606|    977|            }
  607|   161k|        }
  608|  22.9k|        const int use_ref = !hdr->error_resilient_mode &&
  ------------------
  |  Branch (608:29): [True: 20.3k, False: 2.57k]
  ------------------
  609|  20.3k|                            hdr->frame_size_override;
  ------------------
  |  Branch (609:29): [True: 11.8k, False: 8.52k]
  ------------------
  610|  22.9k|        if (read_frame_size(c, gb, use_ref) < 0) goto error;
  ------------------
  |  Branch (610:13): [True: 594, False: 22.3k]
  ------------------
  611|  22.3k|        if (!hdr->force_integer_mv)
  ------------------
  |  Branch (611:13): [True: 12.6k, False: 9.70k]
  ------------------
  612|  12.6k|            hdr->hp = dav1d_get_bit(gb);
  613|  22.3k|        hdr->subpel_filter_mode = dav1d_get_bit(gb) ? DAV1D_FILTER_SWITCHABLE :
  ------------------
  |  Branch (613:35): [True: 3.83k, False: 18.4k]
  ------------------
  614|  22.3k|                                                      dav1d_get_bits(gb, 2);
  615|  22.3k|        hdr->switchable_motion_mode = dav1d_get_bit(gb);
  616|  22.3k|        if (!hdr->error_resilient_mode && seqhdr->ref_frame_mvs &&
  ------------------
  |  Branch (616:13): [True: 19.7k, False: 2.52k]
  |  Branch (616:43): [True: 13.4k, False: 6.33k]
  ------------------
  617|  13.4k|            seqhdr->order_hint && IS_INTER_OR_SWITCH(hdr))
  ------------------
  |  |   36|  13.4k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 13.4k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (617:13): [True: 13.4k, False: 0]
  ------------------
  618|  13.4k|        {
  619|  13.4k|            hdr->use_ref_frame_mvs = dav1d_get_bit(gb);
  620|  13.4k|        }
  621|  22.3k|    }
  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|  67.3k|    if (!seqhdr->reduced_still_picture_header && !hdr->disable_cdf_update)
  ------------------
  |  Branch (627:9): [True: 31.6k, False: 35.7k]
  |  Branch (627:50): [True: 25.4k, False: 6.16k]
  ------------------
  628|  25.4k|        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|  67.3k|    hdr->tiling.uniform = dav1d_get_bit(gb);
  636|  67.3k|    const int sbsz_min1 = (64 << seqhdr->sb128) - 1;
  637|  67.3k|    const int sbsz_log2 = 6 + seqhdr->sb128;
  638|  67.3k|    const int sbw = (hdr->width[0] + sbsz_min1) >> sbsz_log2;
  639|  67.3k|    const int sbh = (hdr->height + sbsz_min1) >> sbsz_log2;
  640|  67.3k|    const int max_tile_width_sb = 4096 >> sbsz_log2;
  641|  67.3k|    const int max_tile_area_sb = 4096 * 2304 >> (2 * sbsz_log2);
  642|  67.3k|    hdr->tiling.min_log2_cols = tile_log2(max_tile_width_sb, sbw);
  643|  67.3k|    hdr->tiling.max_log2_cols = tile_log2(1, imin(sbw, DAV1D_MAX_TILE_COLS));
  ------------------
  |  |   41|  67.3k|#define DAV1D_MAX_TILE_COLS 64
  ------------------
  644|  67.3k|    hdr->tiling.max_log2_rows = tile_log2(1, imin(sbh, DAV1D_MAX_TILE_ROWS));
  ------------------
  |  |   42|  67.3k|#define DAV1D_MAX_TILE_ROWS 64
  ------------------
  645|  67.3k|    const int min_log2_tiles = imax(tile_log2(max_tile_area_sb, sbw * sbh),
  646|  67.3k|                              hdr->tiling.min_log2_cols);
  647|  67.3k|    if (hdr->tiling.uniform) {
  ------------------
  |  Branch (647:9): [True: 43.4k, False: 23.9k]
  ------------------
  648|  43.4k|        for (hdr->tiling.log2_cols = hdr->tiling.min_log2_cols;
  649|  45.9k|             hdr->tiling.log2_cols < hdr->tiling.max_log2_cols && dav1d_get_bit(gb);
  ------------------
  |  Branch (649:14): [True: 21.0k, False: 24.8k]
  |  Branch (649:67): [True: 2.50k, False: 18.5k]
  ------------------
  650|  43.4k|             hdr->tiling.log2_cols++) ;
  651|  43.4k|        const int tile_w = 1 + ((sbw - 1) >> hdr->tiling.log2_cols);
  652|  43.4k|        hdr->tiling.cols = 0;
  653|   105k|        for (int sbx = 0; sbx < sbw; sbx += tile_w, hdr->tiling.cols++)
  ------------------
  |  Branch (653:27): [True: 61.9k, False: 43.4k]
  ------------------
  654|  61.9k|            hdr->tiling.col_start_sb[hdr->tiling.cols] = sbx;
  655|  43.4k|        hdr->tiling.min_log2_rows =
  656|  43.4k|            imax(min_log2_tiles - hdr->tiling.log2_cols, 0);
  657|       |
  658|  43.4k|        for (hdr->tiling.log2_rows = hdr->tiling.min_log2_rows;
  659|  44.8k|             hdr->tiling.log2_rows < hdr->tiling.max_log2_rows && dav1d_get_bit(gb);
  ------------------
  |  Branch (659:14): [True: 10.1k, False: 34.6k]
  |  Branch (659:67): [True: 1.38k, False: 8.80k]
  ------------------
  660|  43.4k|             hdr->tiling.log2_rows++) ;
  661|  43.4k|        const int tile_h = 1 + ((sbh - 1) >> hdr->tiling.log2_rows);
  662|  43.4k|        hdr->tiling.rows = 0;
  663|  94.2k|        for (int sby = 0; sby < sbh; sby += tile_h, hdr->tiling.rows++)
  ------------------
  |  Branch (663:27): [True: 50.8k, False: 43.4k]
  ------------------
  664|  50.8k|            hdr->tiling.row_start_sb[hdr->tiling.rows] = sby;
  665|  43.4k|    } else {
  666|  23.9k|        hdr->tiling.cols = 0;
  667|  23.9k|        int widest_tile = 0, max_tile_area_sb = sbw * sbh;
  668|  86.0k|        for (int sbx = 0; sbx < sbw && hdr->tiling.cols < DAV1D_MAX_TILE_COLS; hdr->tiling.cols++) {
  ------------------
  |  |   41|  62.5k|#define DAV1D_MAX_TILE_COLS 64
  ------------------
  |  Branch (668:27): [True: 62.5k, False: 23.5k]
  |  Branch (668:40): [True: 62.1k, False: 450]
  ------------------
  669|  62.1k|            const int tile_width_sb = imin(sbw - sbx, max_tile_width_sb);
  670|  62.1k|            const int tile_w = (tile_width_sb > 1) ? 1 + dav1d_get_uniform(gb, tile_width_sb) : 1;
  ------------------
  |  Branch (670:32): [True: 39.3k, False: 22.7k]
  ------------------
  671|  62.1k|            hdr->tiling.col_start_sb[hdr->tiling.cols] = sbx;
  672|  62.1k|            sbx += tile_w;
  673|  62.1k|            widest_tile = imax(widest_tile, tile_w);
  674|  62.1k|        }
  675|  23.9k|        hdr->tiling.log2_cols = tile_log2(1, hdr->tiling.cols);
  676|  23.9k|        if (min_log2_tiles) max_tile_area_sb >>= min_log2_tiles + 1;
  ------------------
  |  Branch (676:13): [True: 597, False: 23.3k]
  ------------------
  677|  23.9k|        const int max_tile_height_sb = imax(max_tile_area_sb / widest_tile, 1);
  678|       |
  679|  23.9k|        hdr->tiling.rows = 0;
  680|   115k|        for (int sby = 0; sby < sbh && hdr->tiling.rows < DAV1D_MAX_TILE_ROWS; hdr->tiling.rows++) {
  ------------------
  |  |   42|  92.9k|#define DAV1D_MAX_TILE_ROWS 64
  ------------------
  |  Branch (680:27): [True: 92.9k, False: 22.9k]
  |  Branch (680:40): [True: 91.9k, False: 959]
  ------------------
  681|  91.9k|            const int tile_height_sb = imin(sbh - sby, max_tile_height_sb);
  682|  91.9k|            const int tile_h = (tile_height_sb > 1) ? 1 + dav1d_get_uniform(gb, tile_height_sb) : 1;
  ------------------
  |  Branch (682:32): [True: 69.1k, False: 22.7k]
  ------------------
  683|  91.9k|            hdr->tiling.row_start_sb[hdr->tiling.rows] = sby;
  684|  91.9k|            sby += tile_h;
  685|  91.9k|        }
  686|  23.9k|        hdr->tiling.log2_rows = tile_log2(1, hdr->tiling.rows);
  687|  23.9k|    }
  688|  67.3k|    hdr->tiling.col_start_sb[hdr->tiling.cols] = sbw;
  689|  67.3k|    hdr->tiling.row_start_sb[hdr->tiling.rows] = sbh;
  690|  67.3k|    if (hdr->tiling.log2_cols || hdr->tiling.log2_rows) {
  ------------------
  |  Branch (690:9): [True: 4.64k, False: 62.7k]
  |  Branch (690:34): [True: 2.51k, False: 60.2k]
  ------------------
  691|  7.16k|        hdr->tiling.update = dav1d_get_bits(gb, hdr->tiling.log2_cols + hdr->tiling.log2_rows);
  692|  7.16k|        if (hdr->tiling.update >= hdr->tiling.cols * hdr->tiling.rows)
  ------------------
  |  Branch (692:13): [True: 243, False: 6.92k]
  ------------------
  693|    243|            goto error;
  694|  6.92k|        hdr->tiling.n_bytes = dav1d_get_bits(gb, 2) + 1;
  695|  6.92k|    }
  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|  67.1k|    hdr->quant.yac = dav1d_get_bits(gb, 8);
  703|  67.1k|    if (dav1d_get_bit(gb))
  ------------------
  |  Branch (703:9): [True: 7.54k, False: 59.5k]
  ------------------
  704|  7.54k|        hdr->quant.ydc_delta = dav1d_get_sbits(gb, 7);
  705|  67.1k|    if (!seqhdr->monochrome) {
  ------------------
  |  Branch (705:9): [True: 39.5k, False: 27.5k]
  ------------------
  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|  39.5k|        const int diff_uv_delta = seqhdr->separate_uv_delta_q ? dav1d_get_bit(gb) : 0;
  ------------------
  |  Branch (709:35): [True: 11.6k, False: 27.8k]
  ------------------
  710|  39.5k|        if (dav1d_get_bit(gb))
  ------------------
  |  Branch (710:13): [True: 3.72k, False: 35.8k]
  ------------------
  711|  3.72k|            hdr->quant.udc_delta = dav1d_get_sbits(gb, 7);
  712|  39.5k|        if (dav1d_get_bit(gb))
  ------------------
  |  Branch (712:13): [True: 3.68k, False: 35.8k]
  ------------------
  713|  3.68k|            hdr->quant.uac_delta = dav1d_get_sbits(gb, 7);
  714|  39.5k|        if (diff_uv_delta) {
  ------------------
  |  Branch (714:13): [True: 2.95k, False: 36.6k]
  ------------------
  715|  2.95k|            if (dav1d_get_bit(gb))
  ------------------
  |  Branch (715:17): [True: 1.98k, False: 971]
  ------------------
  716|  1.98k|                hdr->quant.vdc_delta = dav1d_get_sbits(gb, 7);
  717|  2.95k|            if (dav1d_get_bit(gb))
  ------------------
  |  Branch (717:17): [True: 1.04k, False: 1.91k]
  ------------------
  718|  1.04k|                hdr->quant.vac_delta = dav1d_get_sbits(gb, 7);
  719|  36.6k|        } else {
  720|  36.6k|            hdr->quant.vdc_delta = hdr->quant.udc_delta;
  721|  36.6k|            hdr->quant.vac_delta = hdr->quant.uac_delta;
  722|  36.6k|        }
  723|  39.5k|    }
  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|  67.1k|    hdr->quant.qm = dav1d_get_bit(gb);
  729|  67.1k|    if (hdr->quant.qm) {
  ------------------
  |  Branch (729:9): [True: 9.41k, False: 57.7k]
  ------------------
  730|  9.41k|        hdr->quant.qm_y = dav1d_get_bits(gb, 4);
  731|  9.41k|        hdr->quant.qm_u = dav1d_get_bits(gb, 4);
  732|  9.41k|        hdr->quant.qm_v = seqhdr->separate_uv_delta_q ? dav1d_get_bits(gb, 4) :
  ------------------
  |  Branch (732:27): [True: 1.59k, False: 7.82k]
  ------------------
  733|  9.41k|                                                        hdr->quant.qm_u;
  734|  9.41k|    }
  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|  67.1k|    hdr->segmentation.enabled = dav1d_get_bit(gb);
  742|  67.1k|    if (hdr->segmentation.enabled) {
  ------------------
  |  Branch (742:9): [True: 12.4k, False: 54.6k]
  ------------------
  743|  12.4k|        if (hdr->primary_ref_frame == DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|  12.4k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (743:13): [True: 2.88k, False: 9.61k]
  ------------------
  744|  2.88k|            hdr->segmentation.update_map = 1;
  745|  2.88k|            hdr->segmentation.update_data = 1;
  746|  9.61k|        } else {
  747|  9.61k|            hdr->segmentation.update_map = dav1d_get_bit(gb);
  748|  9.61k|            if (hdr->segmentation.update_map)
  ------------------
  |  Branch (748:17): [True: 969, False: 8.64k]
  ------------------
  749|    969|                hdr->segmentation.temporal = dav1d_get_bit(gb);
  750|  9.61k|            hdr->segmentation.update_data = dav1d_get_bit(gb);
  751|  9.61k|        }
  752|       |
  753|  12.4k|        if (hdr->segmentation.update_data) {
  ------------------
  |  Branch (753:13): [True: 3.87k, False: 8.62k]
  ------------------
  754|  3.87k|            hdr->segmentation.seg_data.last_active_segid = -1;
  755|  34.9k|            for (int i = 0; i < DAV1D_MAX_SEGMENTS; i++) {
  ------------------
  |  |   43|  34.9k|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (755:29): [True: 31.0k, False: 3.87k]
  ------------------
  756|  31.0k|                Dav1dSegmentationData *const seg =
  757|  31.0k|                    &hdr->segmentation.seg_data.d[i];
  758|  31.0k|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (758:21): [True: 5.22k, False: 25.7k]
  ------------------
  759|  5.22k|                    seg->delta_q = dav1d_get_sbits(gb, 9);
  760|  5.22k|                    hdr->segmentation.seg_data.last_active_segid = i;
  761|  5.22k|                }
  762|  31.0k|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (762:21): [True: 3.37k, False: 27.6k]
  ------------------
  763|  3.37k|                    seg->delta_lf_y_v = dav1d_get_sbits(gb, 7);
  764|  3.37k|                    hdr->segmentation.seg_data.last_active_segid = i;
  765|  3.37k|                }
  766|  31.0k|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (766:21): [True: 4.26k, False: 26.7k]
  ------------------
  767|  4.26k|                    seg->delta_lf_y_h = dav1d_get_sbits(gb, 7);
  768|  4.26k|                    hdr->segmentation.seg_data.last_active_segid = i;
  769|  4.26k|                }
  770|  31.0k|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (770:21): [True: 3.48k, False: 27.5k]
  ------------------
  771|  3.48k|                    seg->delta_lf_u = dav1d_get_sbits(gb, 7);
  772|  3.48k|                    hdr->segmentation.seg_data.last_active_segid = i;
  773|  3.48k|                }
  774|  31.0k|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (774:21): [True: 2.65k, False: 28.3k]
  ------------------
  775|  2.65k|                    seg->delta_lf_v = dav1d_get_sbits(gb, 7);
  776|  2.65k|                    hdr->segmentation.seg_data.last_active_segid = i;
  777|  2.65k|                }
  778|  31.0k|                if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (778:21): [True: 2.83k, False: 28.1k]
  ------------------
  779|  2.83k|                    seg->ref = dav1d_get_bits(gb, 3);
  780|  2.83k|                    hdr->segmentation.seg_data.last_active_segid = i;
  781|  2.83k|                    hdr->segmentation.seg_data.preskip = 1;
  782|  28.1k|                } else {
  783|  28.1k|                    seg->ref = -1;
  784|  28.1k|                }
  785|  31.0k|                if ((seg->skip = dav1d_get_bit(gb))) {
  ------------------
  |  Branch (785:21): [True: 4.18k, False: 26.8k]
  ------------------
  786|  4.18k|                    hdr->segmentation.seg_data.last_active_segid = i;
  787|  4.18k|                    hdr->segmentation.seg_data.preskip = 1;
  788|  4.18k|                }
  789|  31.0k|                if ((seg->globalmv = dav1d_get_bit(gb))) {
  ------------------
  |  Branch (789:21): [True: 3.70k, False: 27.3k]
  ------------------
  790|  3.70k|                    hdr->segmentation.seg_data.last_active_segid = i;
  791|  3.70k|                    hdr->segmentation.seg_data.preskip = 1;
  792|  3.70k|                }
  793|  31.0k|            }
  794|  8.62k|        } else {
  795|       |            // segmentation.update_data was false so we should copy
  796|       |            // segmentation data from the reference frame.
  797|  8.62k|            assert(hdr->primary_ref_frame != DAV1D_PRIMARY_REF_NONE);
  ------------------
  |  Branch (797:13): [True: 8.62k, False: 0]
  ------------------
  798|  8.62k|            const int pri_ref = hdr->refidx[hdr->primary_ref_frame];
  799|  8.62k|            if (!c->refs[pri_ref].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (799:17): [True: 194, False: 8.42k]
  ------------------
  800|  8.42k|            hdr->segmentation.seg_data =
  801|  8.42k|                c->refs[pri_ref].p.p.frame_hdr->segmentation.seg_data;
  802|  8.42k|        }
  803|  54.6k|    } else {
  804|   491k|        for (int i = 0; i < DAV1D_MAX_SEGMENTS; i++)
  ------------------
  |  |   43|   491k|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (804:25): [True: 437k, False: 54.6k]
  ------------------
  805|   437k|            hdr->segmentation.seg_data.d[i].ref = -1;
  806|  54.6k|    }
  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|  66.9k|    if (hdr->quant.yac) {
  ------------------
  |  Branch (813:9): [True: 47.9k, False: 19.0k]
  ------------------
  814|  47.9k|        hdr->delta.q.present = dav1d_get_bit(gb);
  815|  47.9k|        if (hdr->delta.q.present) {
  ------------------
  |  Branch (815:13): [True: 8.15k, False: 39.7k]
  ------------------
  816|  8.15k|            hdr->delta.q.res_log2 = dav1d_get_bits(gb, 2);
  817|  8.15k|            if (!hdr->allow_intrabc) {
  ------------------
  |  Branch (817:17): [True: 4.58k, False: 3.57k]
  ------------------
  818|  4.58k|                hdr->delta.lf.present = dav1d_get_bit(gb);
  819|  4.58k|                if (hdr->delta.lf.present) {
  ------------------
  |  Branch (819:21): [True: 1.74k, False: 2.84k]
  ------------------
  820|  1.74k|                    hdr->delta.lf.res_log2 = dav1d_get_bits(gb, 2);
  821|  1.74k|                    hdr->delta.lf.multi = dav1d_get_bit(gb);
  822|  1.74k|                }
  823|  4.58k|            }
  824|  8.15k|        }
  825|  47.9k|    }
  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|  66.9k|    const int delta_lossless = !hdr->quant.ydc_delta && !hdr->quant.udc_delta &&
  ------------------
  |  Branch (832:32): [True: 60.3k, False: 6.64k]
  |  Branch (832:57): [True: 58.9k, False: 1.34k]
  ------------------
  833|  58.9k|        !hdr->quant.uac_delta && !hdr->quant.vdc_delta && !hdr->quant.vac_delta;
  ------------------
  |  Branch (833:9): [True: 58.0k, False: 915]
  |  Branch (833:34): [True: 57.2k, False: 781]
  |  Branch (833:59): [True: 57.1k, False: 67]
  ------------------
  834|  66.9k|    hdr->all_lossless = 1;
  835|   602k|    for (int i = 0; i < DAV1D_MAX_SEGMENTS; i++) {
  ------------------
  |  |   43|   602k|#define DAV1D_MAX_SEGMENTS 8
  ------------------
  |  Branch (835:21): [True: 535k, False: 66.9k]
  ------------------
  836|   535k|        hdr->segmentation.qidx[i] = hdr->segmentation.enabled ?
  ------------------
  |  Branch (836:37): [True: 98.4k, False: 437k]
  ------------------
  837|  98.4k|            iclip_u8(hdr->quant.yac + hdr->segmentation.seg_data.d[i].delta_q) :
  838|   535k|            hdr->quant.yac;
  839|   535k|        hdr->segmentation.lossless[i] =
  840|   535k|            !hdr->segmentation.qidx[i] && delta_lossless;
  ------------------
  |  Branch (840:13): [True: 152k, False: 382k]
  |  Branch (840:43): [True: 149k, False: 3.31k]
  ------------------
  841|   535k|        hdr->all_lossless &= hdr->segmentation.lossless[i];
  842|   535k|    }
  843|       |
  844|       |    // loopfilter
  845|  66.9k|    if (hdr->all_lossless || hdr->allow_intrabc) {
  ------------------
  |  Branch (845:9): [True: 18.3k, False: 48.6k]
  |  Branch (845:30): [True: 21.9k, False: 26.7k]
  ------------------
  846|  40.2k|        hdr->loopfilter.mode_ref_delta_enabled = 1;
  847|  40.2k|        hdr->loopfilter.mode_ref_delta_update = 1;
  848|  40.2k|        hdr->loopfilter.mode_ref_deltas = default_mode_ref_deltas;
  849|  40.2k|    } else {
  850|  26.7k|        hdr->loopfilter.level_y[0] = dav1d_get_bits(gb, 6);
  851|  26.7k|        hdr->loopfilter.level_y[1] = dav1d_get_bits(gb, 6);
  852|  26.7k|        if (!seqhdr->monochrome &&
  ------------------
  |  Branch (852:13): [True: 8.98k, False: 17.7k]
  ------------------
  853|  8.98k|            (hdr->loopfilter.level_y[0] || hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (853:14): [True: 3.46k, False: 5.51k]
  |  Branch (853:44): [True: 1.06k, False: 4.44k]
  ------------------
  854|  4.53k|        {
  855|  4.53k|            hdr->loopfilter.level_u = dav1d_get_bits(gb, 6);
  856|  4.53k|            hdr->loopfilter.level_v = dav1d_get_bits(gb, 6);
  857|  4.53k|        }
  858|  26.7k|        hdr->loopfilter.sharpness = dav1d_get_bits(gb, 3);
  859|       |
  860|  26.7k|        if (hdr->primary_ref_frame == DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|  26.7k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (860:13): [True: 14.1k, False: 12.5k]
  ------------------
  861|  14.1k|            hdr->loopfilter.mode_ref_deltas = default_mode_ref_deltas;
  862|  14.1k|        } else {
  863|  12.5k|            const int ref = hdr->refidx[hdr->primary_ref_frame];
  864|  12.5k|            if (!c->refs[ref].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (864:17): [True: 378, False: 12.1k]
  ------------------
  865|  12.1k|            hdr->loopfilter.mode_ref_deltas =
  866|  12.1k|                c->refs[ref].p.p.frame_hdr->loopfilter.mode_ref_deltas;
  867|  12.1k|        }
  868|  26.3k|        hdr->loopfilter.mode_ref_delta_enabled = dav1d_get_bit(gb);
  869|  26.3k|        if (hdr->loopfilter.mode_ref_delta_enabled) {
  ------------------
  |  Branch (869:13): [True: 13.0k, False: 13.2k]
  ------------------
  870|  13.0k|            hdr->loopfilter.mode_ref_delta_update = dav1d_get_bit(gb);
  871|  13.0k|            if (hdr->loopfilter.mode_ref_delta_update) {
  ------------------
  |  Branch (871:17): [True: 1.33k, False: 11.7k]
  ------------------
  872|  12.0k|                for (int i = 0; i < 8; i++)
  ------------------
  |  Branch (872:33): [True: 10.6k, False: 1.33k]
  ------------------
  873|  10.6k|                    if (dav1d_get_bit(gb))
  ------------------
  |  Branch (873:25): [True: 2.76k, False: 7.91k]
  ------------------
  874|  2.76k|                        hdr->loopfilter.mode_ref_deltas.ref_delta[i] =
  875|  2.76k|                            dav1d_get_sbits(gb, 7);
  876|  4.00k|                for (int i = 0; i < 2; i++)
  ------------------
  |  Branch (876:33): [True: 2.67k, False: 1.33k]
  ------------------
  877|  2.67k|                    if (dav1d_get_bit(gb))
  ------------------
  |  Branch (877:25): [True: 592, False: 2.07k]
  ------------------
  878|    592|                        hdr->loopfilter.mode_ref_deltas.mode_delta[i] =
  879|    592|                            dav1d_get_sbits(gb, 7);
  880|  1.33k|            }
  881|  13.0k|        }
  882|  26.3k|    }
  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|  66.5k|    if (!hdr->all_lossless && seqhdr->cdef && !hdr->allow_intrabc) {
  ------------------
  |  Branch (889:9): [True: 48.2k, False: 18.3k]
  |  Branch (889:31): [True: 15.7k, False: 32.5k]
  |  Branch (889:47): [True: 5.99k, False: 9.70k]
  ------------------
  890|  5.99k|        hdr->cdef.damping = dav1d_get_bits(gb, 2) + 3;
  891|  5.99k|        hdr->cdef.n_bits = dav1d_get_bits(gb, 2);
  892|  14.2k|        for (int i = 0; i < (1 << hdr->cdef.n_bits); i++) {
  ------------------
  |  Branch (892:25): [True: 8.27k, False: 5.99k]
  ------------------
  893|  8.27k|            hdr->cdef.y_strength[i] = dav1d_get_bits(gb, 6);
  894|  8.27k|            if (!seqhdr->monochrome)
  ------------------
  |  Branch (894:17): [True: 4.75k, False: 3.52k]
  ------------------
  895|  4.75k|                hdr->cdef.uv_strength[i] = dav1d_get_bits(gb, 6);
  896|  8.27k|        }
  897|  5.99k|    }
  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|  66.5k|    if ((!hdr->all_lossless || hdr->super_res.enabled) &&
  ------------------
  |  Branch (904:10): [True: 48.2k, False: 18.3k]
  |  Branch (904:32): [True: 5.55k, False: 12.7k]
  ------------------
  905|  53.8k|        seqhdr->restoration && !hdr->allow_intrabc)
  ------------------
  |  Branch (905:9): [True: 33.8k, False: 20.0k]
  |  Branch (905:32): [True: 24.9k, False: 8.89k]
  ------------------
  906|  24.9k|    {
  907|  24.9k|        hdr->restoration.type[0] = dav1d_get_bits(gb, 2);
  908|  24.9k|        if (!seqhdr->monochrome) {
  ------------------
  |  Branch (908:13): [True: 9.11k, False: 15.7k]
  ------------------
  909|  9.11k|            hdr->restoration.type[1] = dav1d_get_bits(gb, 2);
  910|  9.11k|            hdr->restoration.type[2] = dav1d_get_bits(gb, 2);
  911|  9.11k|        }
  912|       |
  913|  24.9k|        if (hdr->restoration.type[0] || hdr->restoration.type[1] ||
  ------------------
  |  Branch (913:13): [True: 17.5k, False: 7.32k]
  |  Branch (913:41): [True: 975, False: 6.35k]
  ------------------
  914|  6.35k|            hdr->restoration.type[2])
  ------------------
  |  Branch (914:13): [True: 649, False: 5.70k]
  ------------------
  915|  19.2k|        {
  916|       |            // Log2 of the restoration unit size.
  917|  19.2k|            hdr->restoration.unit_size[0] = 6 + seqhdr->sb128;
  918|  19.2k|            if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (918:17): [True: 13.3k, False: 5.87k]
  ------------------
  919|  13.3k|                hdr->restoration.unit_size[0]++;
  920|  13.3k|                if (!seqhdr->sb128)
  ------------------
  |  Branch (920:21): [True: 2.70k, False: 10.6k]
  ------------------
  921|  2.70k|                    hdr->restoration.unit_size[0] += dav1d_get_bit(gb);
  922|  13.3k|            }
  923|  19.2k|            hdr->restoration.unit_size[1] = hdr->restoration.unit_size[0];
  924|  19.2k|            if ((hdr->restoration.type[1] || hdr->restoration.type[2]) &&
  ------------------
  |  Branch (924:18): [True: 3.69k, False: 15.5k]
  |  Branch (924:46): [True: 3.16k, False: 12.3k]
  ------------------
  925|  6.86k|                seqhdr->ss_hor == 1 && seqhdr->ss_ver == 1)
  ------------------
  |  Branch (925:17): [True: 4.15k, False: 2.70k]
  |  Branch (925:40): [True: 1.46k, False: 2.69k]
  ------------------
  926|  1.46k|            {
  927|  1.46k|                hdr->restoration.unit_size[1] -= dav1d_get_bit(gb);
  928|  1.46k|            }
  929|  19.2k|        } else {
  930|  5.70k|            hdr->restoration.unit_size[0] = 8;
  931|  5.70k|        }
  932|  24.9k|    }
  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|  66.5k|    if (!hdr->all_lossless)
  ------------------
  |  Branch (938:9): [True: 48.2k, False: 18.3k]
  ------------------
  939|  48.2k|        hdr->txfm_mode = dav1d_get_bit(gb) ? DAV1D_TX_SWITCHABLE : DAV1D_TX_LARGEST;
  ------------------
  |  Branch (939:26): [True: 8.73k, False: 39.5k]
  ------------------
  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|  66.5k|    if (IS_INTER_OR_SWITCH(hdr))
  ------------------
  |  |   36|  66.5k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 21.7k, False: 44.8k]
  |  |  ------------------
  ------------------
  945|  21.7k|        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|  66.5k|    if (hdr->switchable_comp_refs && IS_INTER_OR_SWITCH(hdr) && seqhdr->order_hint) {
  ------------------
  |  |   36|  78.5k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 12.0k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (950:9): [True: 12.0k, False: 54.5k]
  |  Branch (950:65): [True: 10.7k, False: 1.26k]
  ------------------
  951|  10.7k|        const int poc = hdr->frame_offset;
  952|  10.7k|        int off_before = -1, off_after = -1;
  953|  10.7k|        int off_before_idx, off_after_idx;
  954|  83.9k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (954:25): [True: 73.4k, False: 10.4k]
  ------------------
  955|  73.4k|            if (!c->refs[hdr->refidx[i]].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (955:17): [True: 311, False: 73.1k]
  ------------------
  956|  73.1k|            const int refpoc = c->refs[hdr->refidx[i]].p.p.frame_hdr->frame_offset;
  957|       |
  958|  73.1k|            const int diff = get_poc_diff(seqhdr->order_hint_n_bits, refpoc, poc);
  959|  73.1k|            if (diff > 0) {
  ------------------
  |  Branch (959:17): [True: 12.1k, False: 60.9k]
  ------------------
  960|  12.1k|                if (off_after < 0 || get_poc_diff(seqhdr->order_hint_n_bits,
  ------------------
  |  Branch (960:21): [True: 4.78k, False: 7.41k]
  |  Branch (960:38): [True: 267, False: 7.15k]
  ------------------
  961|  7.41k|                                                  off_after, refpoc) > 0)
  962|  5.04k|                {
  963|  5.04k|                    off_after = refpoc;
  964|  5.04k|                    off_after_idx = i;
  965|  5.04k|                }
  966|  60.9k|            } else if (diff < 0 && (off_before < 0 ||
  ------------------
  |  Branch (966:24): [True: 16.8k, False: 44.0k]
  |  Branch (966:37): [True: 4.23k, False: 12.6k]
  ------------------
  967|  12.6k|                                    get_poc_diff(seqhdr->order_hint_n_bits,
  ------------------
  |  Branch (967:37): [True: 549, False: 12.0k]
  ------------------
  968|  12.6k|                                                 refpoc, off_before) > 0))
  969|  4.78k|            {
  970|  4.78k|                off_before = refpoc;
  971|  4.78k|                off_before_idx = i;
  972|  4.78k|            }
  973|  73.1k|        }
  974|       |
  975|  10.4k|        if ((off_before | off_after) >= 0) {
  ------------------
  |  Branch (975:13): [True: 1.03k, False: 9.39k]
  ------------------
  976|  1.03k|            hdr->skip_mode_refs[0] = imin(off_before_idx, off_after_idx);
  977|  1.03k|            hdr->skip_mode_refs[1] = imax(off_before_idx, off_after_idx);
  978|  1.03k|            hdr->skip_mode_allowed = 1;
  979|  9.39k|        } else if (off_before >= 0) {
  ------------------
  |  Branch (979:20): [True: 3.12k, False: 6.26k]
  ------------------
  980|  3.12k|            int off_before2 = -1;
  981|  3.12k|            int off_before2_idx;
  982|  24.9k|            for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (982:29): [True: 21.8k, False: 3.12k]
  ------------------
  983|  21.8k|                if (!c->refs[hdr->refidx[i]].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (983:21): [True: 0, False: 21.8k]
  ------------------
  984|  21.8k|                const int refpoc = c->refs[hdr->refidx[i]].p.p.frame_hdr->frame_offset;
  985|  21.8k|                if (get_poc_diff(seqhdr->order_hint_n_bits,
  ------------------
  |  Branch (985:21): [True: 5.37k, False: 16.4k]
  ------------------
  986|  21.8k|                                 refpoc, off_before) < 0) {
  987|  5.37k|                    if (off_before2 < 0 || get_poc_diff(seqhdr->order_hint_n_bits,
  ------------------
  |  Branch (987:25): [True: 1.32k, False: 4.05k]
  |  Branch (987:44): [True: 365, False: 3.68k]
  ------------------
  988|  4.05k|                                                        refpoc, off_before2) > 0)
  989|  1.68k|                    {
  990|  1.68k|                        off_before2 = refpoc;
  991|  1.68k|                        off_before2_idx = i;
  992|  1.68k|                    }
  993|  5.37k|                }
  994|  21.8k|            }
  995|       |
  996|  3.12k|            if (off_before2 >= 0) {
  ------------------
  |  Branch (996:17): [True: 1.32k, False: 1.80k]
  ------------------
  997|  1.32k|                hdr->skip_mode_refs[0] = imin(off_before_idx, off_before2_idx);
  998|  1.32k|                hdr->skip_mode_refs[1] = imax(off_before_idx, off_before2_idx);
  999|  1.32k|                hdr->skip_mode_allowed = 1;
 1000|  1.32k|            }
 1001|  3.12k|        }
 1002|  10.4k|    }
 1003|  66.2k|    if (hdr->skip_mode_allowed)
  ------------------
  |  Branch (1003:9): [True: 2.35k, False: 63.8k]
  ------------------
 1004|  2.35k|        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|  66.2k|    if (!hdr->error_resilient_mode && IS_INTER_OR_SWITCH(hdr) && seqhdr->warped_motion)
  ------------------
  |  |   36|  86.4k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 18.9k, False: 1.26k]
  |  |  ------------------
  ------------------
  |  Branch (1009:9): [True: 20.1k, False: 46.0k]
  |  Branch (1009:66): [True: 13.3k, False: 5.54k]
  ------------------
 1010|  13.3k|        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|  66.2k|    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|   530k|    for (int i = 0; i < 7; i++)
  ------------------
  |  Branch (1021:21): [True: 463k, False: 66.2k]
  ------------------
 1022|   463k|        hdr->gmv[i] = dav1d_default_wm_params;
 1023|       |
 1024|  66.2k|    if (IS_INTER_OR_SWITCH(hdr)) {
  ------------------
  |  |   36|  66.2k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (36:5): [True: 21.4k, False: 44.8k]
  |  |  ------------------
  ------------------
 1025|   170k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (1025:25): [True: 149k, False: 21.2k]
  ------------------
 1026|   149k|            hdr->gmv[i].type = !dav1d_get_bit(gb) ? DAV1D_WM_TYPE_IDENTITY :
  ------------------
  |  Branch (1026:32): [True: 140k, False: 9.09k]
  ------------------
 1027|   149k|                                dav1d_get_bit(gb) ? DAV1D_WM_TYPE_ROT_ZOOM :
  ------------------
  |  Branch (1027:33): [True: 4.84k, False: 4.25k]
  ------------------
 1028|  9.09k|                                dav1d_get_bit(gb) ? DAV1D_WM_TYPE_TRANSLATION :
  ------------------
  |  Branch (1028:33): [True: 1.94k, False: 2.30k]
  ------------------
 1029|  4.25k|                                                    DAV1D_WM_TYPE_AFFINE;
 1030|       |
 1031|   149k|            if (hdr->gmv[i].type == DAV1D_WM_TYPE_IDENTITY) continue;
  ------------------
  |  Branch (1031:17): [True: 140k, False: 9.09k]
  ------------------
 1032|       |
 1033|  9.09k|            const Dav1dWarpedMotionParams *ref_gmv;
 1034|  9.09k|            if (hdr->primary_ref_frame == DAV1D_PRIMARY_REF_NONE) {
  ------------------
  |  |   45|  9.09k|#define DAV1D_PRIMARY_REF_NONE 7
  ------------------
  |  Branch (1034:17): [True: 1.28k, False: 7.80k]
  ------------------
 1035|  1.28k|                ref_gmv = &dav1d_default_wm_params;
 1036|  7.80k|            } else {
 1037|  7.80k|                const int pri_ref = hdr->refidx[hdr->primary_ref_frame];
 1038|  7.80k|                if (!c->refs[pri_ref].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (1038:21): [True: 207, False: 7.60k]
  ------------------
 1039|  7.60k|                ref_gmv = &c->refs[pri_ref].p.p.frame_hdr->gmv[i];
 1040|  7.60k|            }
 1041|  8.88k|            int32_t *const mat = hdr->gmv[i].matrix;
 1042|  8.88k|            const int32_t *const ref_mat = ref_gmv->matrix;
 1043|  8.88k|            int bits, shift;
 1044|       |
 1045|  8.88k|            if (hdr->gmv[i].type >= DAV1D_WM_TYPE_ROT_ZOOM) {
  ------------------
  |  Branch (1045:17): [True: 6.95k, False: 1.93k]
  ------------------
 1046|  6.95k|                mat[2] = (1 << 16) + 2 *
 1047|  6.95k|                    dav1d_get_bits_subexp(gb, (ref_mat[2] - (1 << 16)) >> 1, 12);
 1048|  6.95k|                mat[3] = 2 * dav1d_get_bits_subexp(gb, ref_mat[3] >> 1, 12);
 1049|       |
 1050|  6.95k|                bits = 12;
 1051|  6.95k|                shift = 10;
 1052|  6.95k|            } else {
 1053|  1.93k|                bits = 9 - !hdr->hp;
 1054|  1.93k|                shift = 13 + !hdr->hp;
 1055|  1.93k|            }
 1056|       |
 1057|  8.88k|            if (hdr->gmv[i].type == DAV1D_WM_TYPE_AFFINE) {
  ------------------
  |  Branch (1057:17): [True: 2.11k, False: 6.77k]
  ------------------
 1058|  2.11k|                mat[4] = 2 * dav1d_get_bits_subexp(gb, ref_mat[4] >> 1, 12);
 1059|  2.11k|                mat[5] = (1 << 16) + 2 *
 1060|  2.11k|                    dav1d_get_bits_subexp(gb, (ref_mat[5] - (1 << 16)) >> 1, 12);
 1061|  6.77k|            } else {
 1062|  6.77k|                mat[4] = -mat[3];
 1063|  6.77k|                mat[5] = mat[2];
 1064|  6.77k|            }
 1065|       |
 1066|  8.88k|            mat[0] = dav1d_get_bits_subexp(gb, ref_mat[0] >> shift, bits) * (1 << shift);
 1067|  8.88k|            mat[1] = dav1d_get_bits_subexp(gb, ref_mat[1] >> shift, bits) * (1 << shift);
 1068|  8.88k|        }
 1069|  21.4k|    }
 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|  66.0k|    if (seqhdr->film_grain_present && (hdr->show_frame || hdr->showable_frame)) {
  ------------------
  |  Branch (1075:9): [True: 18.3k, False: 47.6k]
  |  Branch (1075:40): [True: 14.9k, False: 3.41k]
  |  Branch (1075:59): [True: 2.63k, False: 783]
  ------------------
 1076|  17.5k|        hdr->film_grain.present = dav1d_get_bit(gb);
 1077|  17.5k|        if (hdr->film_grain.present) {
  ------------------
  |  Branch (1077:13): [True: 5.94k, False: 11.6k]
  ------------------
 1078|  5.94k|            const unsigned seed = dav1d_get_bits(gb, 16);
 1079|  5.94k|            hdr->film_grain.update = hdr->frame_type != DAV1D_FRAME_TYPE_INTER || dav1d_get_bit(gb);
  ------------------
  |  Branch (1079:38): [True: 4.73k, False: 1.21k]
  |  Branch (1079:83): [True: 212, False: 1.00k]
  ------------------
 1080|  5.94k|            if (!hdr->film_grain.update) {
  ------------------
  |  Branch (1080:17): [True: 1.00k, False: 4.94k]
  ------------------
 1081|  1.00k|                const int refidx = dav1d_get_bits(gb, 3);
 1082|  1.00k|                int i;
 1083|  4.02k|                for (i = 0; i < 7; i++)
  ------------------
  |  Branch (1083:29): [True: 3.79k, False: 235]
  ------------------
 1084|  3.79k|                    if (hdr->refidx[i] == refidx)
  ------------------
  |  Branch (1084:25): [True: 767, False: 3.02k]
  ------------------
 1085|    767|                        break;
 1086|  1.00k|                if (i == 7 || !c->refs[refidx].p.p.frame_hdr) goto error;
  ------------------
  |  Branch (1086:21): [True: 235, False: 767]
  |  Branch (1086:31): [True: 356, False: 411]
  ------------------
 1087|    411|                hdr->film_grain.data = c->refs[refidx].p.p.frame_hdr->film_grain.data;
 1088|    411|                hdr->film_grain.data.seed = seed;
 1089|  4.94k|            } else {
 1090|  4.94k|                Dav1dFilmGrainData *const fgd = &hdr->film_grain.data;
 1091|  4.94k|                fgd->seed = seed;
 1092|       |
 1093|  4.94k|                fgd->num_y_points = dav1d_get_bits(gb, 4);
 1094|  4.94k|                if (fgd->num_y_points > 14) goto error;
  ------------------
  |  Branch (1094:21): [True: 203, False: 4.74k]
  ------------------
 1095|  7.53k|                for (int i = 0; i < fgd->num_y_points; i++) {
  ------------------
  |  Branch (1095:33): [True: 3.23k, False: 4.30k]
  ------------------
 1096|  3.23k|                    fgd->y_points[i][0] = dav1d_get_bits(gb, 8);
 1097|  3.23k|                    if (i && fgd->y_points[i - 1][0] >= fgd->y_points[i][0])
  ------------------
  |  Branch (1097:25): [True: 933, False: 2.29k]
  |  Branch (1097:30): [True: 437, False: 496]
  ------------------
 1098|    437|                        goto error;
 1099|  2.79k|                    fgd->y_points[i][1] = dav1d_get_bits(gb, 8);
 1100|  2.79k|                }
 1101|       |
 1102|  4.30k|                if (!seqhdr->monochrome)
  ------------------
  |  Branch (1102:21): [True: 3.79k, False: 505]
  ------------------
 1103|  3.79k|                    fgd->chroma_scaling_from_luma = dav1d_get_bit(gb);
 1104|  4.30k|                if (seqhdr->monochrome || fgd->chroma_scaling_from_luma ||
  ------------------
  |  Branch (1104:21): [True: 505, False: 3.79k]
  |  Branch (1104:43): [True: 1.05k, False: 2.74k]
  ------------------
 1105|  2.74k|                    (seqhdr->ss_ver == 1 && seqhdr->ss_hor == 1 && !fgd->num_y_points))
  ------------------
  |  Branch (1105:22): [True: 1.15k, False: 1.59k]
  |  Branch (1105:45): [True: 1.15k, False: 0]
  |  Branch (1105:68): [True: 215, False: 939]
  ------------------
 1106|  1.77k|                {
 1107|  1.77k|                    fgd->num_uv_points[0] = fgd->num_uv_points[1] = 0;
 1108|  5.85k|                } else for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1108:41): [True: 4.32k, False: 1.52k]
  ------------------
 1109|  4.32k|                    fgd->num_uv_points[pl] = dav1d_get_bits(gb, 4);
 1110|  4.32k|                    if (fgd->num_uv_points[pl] > 10) goto error;
  ------------------
  |  Branch (1110:25): [True: 456, False: 3.87k]
  ------------------
 1111|  5.87k|                    for (int i = 0; i < fgd->num_uv_points[pl]; i++) {
  ------------------
  |  Branch (1111:37): [True: 2.55k, False: 3.32k]
  ------------------
 1112|  2.55k|                        fgd->uv_points[pl][i][0] = dav1d_get_bits(gb, 8);
 1113|  2.55k|                        if (i && fgd->uv_points[pl][i - 1][0] >= fgd->uv_points[pl][i][0])
  ------------------
  |  Branch (1113:29): [True: 1.17k, False: 1.38k]
  |  Branch (1113:34): [True: 552, False: 624]
  ------------------
 1114|    552|                            goto error;
 1115|  2.00k|                        fgd->uv_points[pl][i][1] = dav1d_get_bits(gb, 8);
 1116|  2.00k|                    }
 1117|  3.87k|                }
 1118|       |
 1119|  3.29k|                if (seqhdr->ss_hor == 1 && seqhdr->ss_ver == 1 &&
  ------------------
  |  Branch (1119:21): [True: 2.74k, False: 554]
  |  Branch (1119:44): [True: 1.41k, False: 1.32k]
  ------------------
 1120|  1.41k|                    !!fgd->num_uv_points[0] != !!fgd->num_uv_points[1])
  ------------------
  |  Branch (1120:21): [True: 194, False: 1.22k]
  ------------------
 1121|    194|                {
 1122|    194|                    goto error;
 1123|    194|                }
 1124|       |
 1125|  3.10k|                fgd->scaling_shift = dav1d_get_bits(gb, 2) + 8;
 1126|  3.10k|                fgd->ar_coeff_lag = dav1d_get_bits(gb, 2);
 1127|  3.10k|                const int num_y_pos = 2 * fgd->ar_coeff_lag * (fgd->ar_coeff_lag + 1);
 1128|  3.10k|                if (fgd->num_y_points)
  ------------------
  |  Branch (1128:21): [True: 1.38k, False: 1.72k]
  ------------------
 1129|  8.82k|                    for (int i = 0; i < num_y_pos; i++)
  ------------------
  |  Branch (1129:37): [True: 7.44k, False: 1.38k]
  ------------------
 1130|  7.44k|                        fgd->ar_coeffs_y[i] = dav1d_get_bits(gb, 8) - 128;
 1131|  9.30k|                for (int pl = 0; pl < 2; pl++)
  ------------------
  |  Branch (1131:34): [True: 6.20k, False: 3.10k]
  ------------------
 1132|  6.20k|                    if (fgd->num_uv_points[pl] || fgd->chroma_scaling_from_luma) {
  ------------------
  |  Branch (1132:25): [True: 556, False: 5.64k]
  |  Branch (1132:51): [True: 2.10k, False: 3.54k]
  ------------------
 1133|  2.65k|                        const int num_uv_pos = num_y_pos + !!fgd->num_y_points;
 1134|  24.9k|                        for (int i = 0; i < num_uv_pos; i++)
  ------------------
  |  Branch (1134:41): [True: 22.3k, False: 2.65k]
  ------------------
 1135|  22.3k|                            fgd->ar_coeffs_uv[pl][i] = dav1d_get_bits(gb, 8) - 128;
 1136|  2.65k|                        if (!fgd->num_y_points)
  ------------------
  |  Branch (1136:29): [True: 1.44k, False: 1.21k]
  ------------------
 1137|  1.44k|                            fgd->ar_coeffs_uv[pl][num_uv_pos] = 0;
 1138|  2.65k|                    }
 1139|  3.10k|                fgd->ar_coeff_shift = dav1d_get_bits(gb, 2) + 6;
 1140|  3.10k|                fgd->grain_scale_shift = dav1d_get_bits(gb, 2);
 1141|  9.30k|                for (int pl = 0; pl < 2; pl++)
  ------------------
  |  Branch (1141:34): [True: 6.20k, False: 3.10k]
  ------------------
 1142|  6.20k|                    if (fgd->num_uv_points[pl]) {
  ------------------
  |  Branch (1142:25): [True: 556, False: 5.64k]
  ------------------
 1143|    556|                        fgd->uv_mult[pl] = dav1d_get_bits(gb, 8) - 128;
 1144|    556|                        fgd->uv_luma_mult[pl] = dav1d_get_bits(gb, 8) - 128;
 1145|    556|                        fgd->uv_offset[pl] = dav1d_get_bits(gb, 9) - 256;
 1146|    556|                    }
 1147|  3.10k|                fgd->overlap_flag = dav1d_get_bit(gb);
 1148|  3.10k|                fgd->clip_to_restricted_range = dav1d_get_bit(gb);
 1149|  3.10k|            }
 1150|  5.94k|        }
 1151|  17.5k|    }
 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|  63.6k|    return 0;
 1158|       |
 1159|  6.74k|error:
 1160|  6.74k|    dav1d_log(c, "Error parsing frame header\n");
  ------------------
  |  |   44|  6.74k|#define dav1d_log(...) do { } while(0)
  |  |  ------------------
  |  |  |  Branch (44:37): [Folded, False: 6.74k]
  |  |  ------------------
  ------------------
 1161|  6.74k|    return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|  6.74k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
 1162|  66.0k|}
obu.c:read_frame_size:
  343|  68.6k|{
  344|  68.6k|    const Dav1dSequenceHeader *const seqhdr = c->seq_hdr;
  345|  68.6k|    Dav1dFrameHeader *const hdr = c->frame_hdr;
  346|       |
  347|  68.6k|    if (use_ref) {
  ------------------
  |  Branch (347:9): [True: 11.8k, False: 56.8k]
  ------------------
  348|  26.5k|        for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (348:25): [True: 25.1k, False: 1.37k]
  ------------------
  349|  25.1k|            if (dav1d_get_bit(gb)) {
  ------------------
  |  Branch (349:17): [True: 10.4k, False: 14.7k]
  ------------------
  350|  10.4k|                const Dav1dThreadPicture *const ref =
  351|  10.4k|                    &c->refs[c->frame_hdr->refidx[i]].p;
  352|  10.4k|                if (!ref->p.frame_hdr) return -1;
  ------------------
  |  Branch (352:21): [True: 255, False: 10.1k]
  ------------------
  353|  10.1k|                hdr->width[1] = ref->p.frame_hdr->width[1];
  354|  10.1k|                hdr->height = ref->p.frame_hdr->height;
  355|  10.1k|                if (hdr->width[1] > seqhdr->max_width ||
  ------------------
  |  Branch (355:21): [True: 0, False: 10.1k]
  ------------------
  356|  10.1k|                    hdr->height > seqhdr->max_height)
  ------------------
  |  Branch (356:21): [True: 0, False: 10.1k]
  ------------------
  357|      0|                {
  358|      0|                    return -1;
  359|      0|                }
  360|  10.1k|                hdr->render_width = ref->p.frame_hdr->render_width;
  361|  10.1k|                hdr->render_height = ref->p.frame_hdr->render_height;
  362|  10.1k|                hdr->super_res.enabled = seqhdr->super_res && dav1d_get_bit(gb);
  ------------------
  |  Branch (362:42): [True: 1.25k, False: 8.92k]
  |  Branch (362:63): [True: 667, False: 589]
  ------------------
  363|  10.1k|                if (hdr->super_res.enabled) {
  ------------------
  |  Branch (363:21): [True: 667, False: 9.51k]
  ------------------
  364|    667|                    const int d = hdr->super_res.width_scale_denominator =
  365|    667|                        9 + dav1d_get_bits(gb, 3);
  366|    667|                    hdr->width[0] = imax((hdr->width[1] * 8 + (d >> 1)) / d,
  367|    667|                                         imin(16, hdr->width[1]));
  368|  9.51k|                } else {
  369|  9.51k|                    hdr->super_res.width_scale_denominator = 8;
  370|  9.51k|                    hdr->width[0] = hdr->width[1];
  371|  9.51k|                }
  372|  10.1k|                return 0;
  373|  10.1k|            }
  374|  25.1k|        }
  375|  11.8k|    }
  376|       |
  377|  58.1k|    if (hdr->frame_size_override) {
  ------------------
  |  Branch (377:9): [True: 8.80k, False: 49.3k]
  ------------------
  378|  8.80k|        hdr->width[1] = dav1d_get_bits(gb, seqhdr->width_n_bits) + 1;
  379|  8.80k|        hdr->height = dav1d_get_bits(gb, seqhdr->height_n_bits) + 1;
  380|  8.80k|        if (hdr->width[1] > seqhdr->max_width ||
  ------------------
  |  Branch (380:13): [True: 623, False: 8.18k]
  ------------------
  381|  8.18k|            hdr->height > seqhdr->max_height)
  ------------------
  |  Branch (381:13): [True: 353, False: 7.82k]
  ------------------
  382|    976|        {
  383|    976|            return -1;
  384|    976|        }
  385|  49.3k|    } else {
  386|  49.3k|        hdr->width[1] = seqhdr->max_width;
  387|  49.3k|        hdr->height = seqhdr->max_height;
  388|  49.3k|    }
  389|  57.2k|    hdr->super_res.enabled = seqhdr->super_res && dav1d_get_bit(gb);
  ------------------
  |  Branch (389:30): [True: 32.5k, False: 24.6k]
  |  Branch (389:51): [True: 8.68k, False: 23.8k]
  ------------------
  390|  57.2k|    if (hdr->super_res.enabled) {
  ------------------
  |  Branch (390:9): [True: 8.68k, False: 48.5k]
  ------------------
  391|  8.68k|        const int d = hdr->super_res.width_scale_denominator = 9 + dav1d_get_bits(gb, 3);
  392|  8.68k|        hdr->width[0] = imax((hdr->width[1] * 8 + (d >> 1)) / d, imin(16, hdr->width[1]));
  393|  48.5k|    } else {
  394|  48.5k|        hdr->super_res.width_scale_denominator = 8;
  395|  48.5k|        hdr->width[0] = hdr->width[1];
  396|  48.5k|    }
  397|  57.2k|    hdr->have_render_size = dav1d_get_bit(gb);
  398|  57.2k|    if (hdr->have_render_size) {
  ------------------
  |  Branch (398:9): [True: 2.53k, False: 54.6k]
  ------------------
  399|  2.53k|        hdr->render_width = dav1d_get_bits(gb, 16) + 1;
  400|  2.53k|        hdr->render_height = dav1d_get_bits(gb, 16) + 1;
  401|  54.6k|    } else {
  402|  54.6k|        hdr->render_width = hdr->width[1];
  403|  54.6k|        hdr->render_height = hdr->height;
  404|  54.6k|    }
  405|  57.2k|    return 0;
  406|  58.1k|}
obu.c:tile_log2:
  408|   317k|static inline int tile_log2(const int sz, const int tgt) {
  409|   317k|    int k;
  410|   470k|    for (k = 0; (sz << k) < tgt; k++) ;
  ------------------
  |  Branch (410:17): [True: 153k, False: 317k]
  ------------------
  411|   317k|    return k;
  412|   317k|}
obu.c:check_trailing_bits:
   50|  50.4k|{
   51|  50.4k|    const int trailing_one_bit = dav1d_get_bit(gb);
   52|       |
   53|  50.4k|    if (gb->error)
  ------------------
  |  Branch (53:9): [True: 8.55k, False: 41.8k]
  ------------------
   54|  8.55k|        return DAV1D_ERR(EINVAL);
  ------------------
  |  |   58|  8.55k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
   55|       |
   56|  41.8k|    if (!strict_std_compliance)
  ------------------
  |  Branch (56:9): [True: 41.8k, False: 0]
  ------------------
   57|  41.8k|        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|  56.6k|static void parse_tile_hdr(Dav1dContext *const c, GetBits *const gb) {
 1165|  56.6k|    const int n_tiles = c->frame_hdr->tiling.cols * c->frame_hdr->tiling.rows;
 1166|  56.6k|    const int have_tile_pos = n_tiles > 1 ? dav1d_get_bit(gb) : 0;
  ------------------
  |  Branch (1166:31): [True: 5.37k, False: 51.2k]
  ------------------
 1167|       |
 1168|  56.6k|    if (have_tile_pos) {
  ------------------
  |  Branch (1168:9): [True: 1.61k, False: 55.0k]
  ------------------
 1169|  1.61k|        const int n_bits = c->frame_hdr->tiling.log2_cols +
 1170|  1.61k|                           c->frame_hdr->tiling.log2_rows;
 1171|  1.61k|        c->tile[c->n_tile_data].start = dav1d_get_bits(gb, n_bits);
 1172|  1.61k|        c->tile[c->n_tile_data].end = dav1d_get_bits(gb, n_bits);
 1173|  55.0k|    } else {
 1174|  55.0k|        c->tile[c->n_tile_data].start = 0;
 1175|  55.0k|        c->tile[c->n_tile_data].end = n_tiles - 1;
 1176|  55.0k|    }
 1177|  56.6k|}

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

dav1d_default_picture_alloc:
   46|  54.4k|int dav1d_default_picture_alloc(Dav1dPicture *const p, void *const cookie) {
   47|  54.4k|    const int hbd = p->p.bpc > 8;
   48|  54.4k|    const int aligned_w = (p->p.w + 127) & ~127;
   49|  54.4k|    const int aligned_h = (p->p.h + 127) & ~127;
   50|  54.4k|    const int has_chroma = p->p.layout != DAV1D_PIXEL_LAYOUT_I400;
   51|  54.4k|    const int ss_ver = p->p.layout == DAV1D_PIXEL_LAYOUT_I420;
   52|  54.4k|    const int ss_hor = p->p.layout != DAV1D_PIXEL_LAYOUT_I444;
   53|  54.4k|    ptrdiff_t y_stride = aligned_w << hbd;
   54|  54.4k|    ptrdiff_t uv_stride = has_chroma ? y_stride >> ss_hor : 0;
  ------------------
  |  Branch (54:27): [True: 30.2k, False: 24.2k]
  ------------------
   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|  54.4k|    if (!(y_stride & 1023))
  ------------------
  |  Branch (60:9): [True: 4.92k, False: 49.5k]
  ------------------
   61|  4.92k|        y_stride += DAV1D_PICTURE_ALIGNMENT;
  ------------------
  |  |   44|  4.92k|#define DAV1D_PICTURE_ALIGNMENT 64
  ------------------
   62|  54.4k|    if (!(uv_stride & 1023) && has_chroma)
  ------------------
  |  Branch (62:9): [True: 27.1k, False: 27.3k]
  |  Branch (62:32): [True: 2.95k, False: 24.2k]
  ------------------
   63|  2.95k|        uv_stride += DAV1D_PICTURE_ALIGNMENT;
  ------------------
  |  |   44|  2.95k|#define DAV1D_PICTURE_ALIGNMENT 64
  ------------------
   64|  54.4k|    p->stride[0] = y_stride;
   65|  54.4k|    p->stride[1] = uv_stride;
   66|  54.4k|    const size_t y_sz = y_stride * aligned_h;
   67|  54.4k|    const size_t uv_sz = uv_stride * (aligned_h >> ss_ver);
   68|  54.4k|    const size_t pic_size = y_sz + 2 * uv_sz;
   69|       |
   70|  54.4k|    uint8_t *const buf = dav1d_mem_pool_pop(cookie, pic_size + DAV1D_PICTURE_ALIGNMENT);
  ------------------
  |  |   44|  54.4k|#define DAV1D_PICTURE_ALIGNMENT 64
  ------------------
   71|  54.4k|    if (!buf) return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (71:9): [True: 0, False: 54.4k]
  ------------------
   72|  54.4k|    p->allocator_data = buf;
   73|  54.4k|    p->data[0] = buf;
   74|  54.4k|    p->data[1] = has_chroma ? buf + y_sz : NULL;
  ------------------
  |  Branch (74:18): [True: 30.2k, False: 24.2k]
  ------------------
   75|  54.4k|    p->data[2] = has_chroma ? buf + y_sz + uv_sz : NULL;
  ------------------
  |  Branch (75:18): [True: 30.2k, False: 24.2k]
  ------------------
   76|       |
   77|  54.4k|    return 0;
   78|  54.4k|}
dav1d_default_picture_release:
   80|  54.4k|void dav1d_default_picture_release(Dav1dPicture *const p, void *const cookie) {
   81|  54.4k|    dav1d_mem_pool_push(cookie, p->allocator_data);
   82|  54.4k|}
dav1d_picture_free_itut_t35:
   99|    661|void dav1d_picture_free_itut_t35(const uint8_t *const data, void *const user_data) {
  100|    661|    struct itut_t35_ctx_context *itut_t35_ctx = user_data;
  101|       |
  102|  1.82k|    for (size_t i = 0; i < itut_t35_ctx->n_itut_t35; i++)
  ------------------
  |  Branch (102:24): [True: 1.16k, False: 661]
  ------------------
  103|  1.16k|        dav1d_free(itut_t35_ctx->itut_t35[i].payload);
  ------------------
  |  |  135|  1.16k|#define dav1d_free(ptr) free(ptr)
  ------------------
  104|    661|    dav1d_free(itut_t35_ctx->itut_t35);
  ------------------
  |  |  135|    661|#define dav1d_free(ptr) free(ptr)
  ------------------
  105|    661|    dav1d_free(itut_t35_ctx);
  ------------------
  |  |  135|    661|#define dav1d_free(ptr) free(ptr)
  ------------------
  106|    661|}
dav1d_picture_copy_props:
  164|  55.7k|{
  165|  55.7k|    dav1d_data_props_copy(&p->m, props);
  166|       |
  167|  55.7k|    dav1d_ref_dec(&p->content_light_ref);
  168|  55.7k|    p->content_light_ref = content_light_ref;
  169|  55.7k|    p->content_light = content_light;
  170|  55.7k|    if (content_light_ref) dav1d_ref_inc(content_light_ref);
  ------------------
  |  Branch (170:9): [True: 1.43k, False: 54.3k]
  ------------------
  171|       |
  172|  55.7k|    dav1d_ref_dec(&p->mastering_display_ref);
  173|  55.7k|    p->mastering_display_ref = mastering_display_ref;
  174|  55.7k|    p->mastering_display = mastering_display;
  175|  55.7k|    if (mastering_display_ref) dav1d_ref_inc(mastering_display_ref);
  ------------------
  |  Branch (175:9): [True: 1.15k, False: 54.5k]
  ------------------
  176|       |
  177|  55.7k|    dav1d_ref_dec(&p->itut_t35_ref);
  178|  55.7k|    p->itut_t35_ref = itut_t35_ref;
  179|  55.7k|    p->itut_t35 = itut_t35;
  180|  55.7k|    p->n_itut_t35 = n_itut_t35;
  181|  55.7k|    if (itut_t35_ref) dav1d_ref_inc(itut_t35_ref);
  ------------------
  |  Branch (181:9): [True: 1.07k, False: 54.6k]
  ------------------
  182|  55.7k|}
dav1d_thread_picture_alloc:
  186|  45.2k|{
  187|  45.2k|    Dav1dThreadPicture *const p = &f->sr_cur;
  188|       |
  189|  45.2k|    const int res = picture_alloc(c, &p->p, f->frame_hdr->width[1], f->frame_hdr->height,
  190|  45.2k|                                  f->seq_hdr, f->seq_hdr_ref,
  191|  45.2k|                                  f->frame_hdr, f->frame_hdr_ref,
  192|  45.2k|                                  bpc, &f->tile[0].data.m, &c->allocator,
  193|  45.2k|                                  (void **) &p->progress);
  194|  45.2k|    if (res) return res;
  ------------------
  |  Branch (194:9): [True: 0, False: 45.2k]
  ------------------
  195|       |
  196|       |    // Don't clear these flags from c->frame_flags if the frame is not going to be output.
  197|       |    // This way they will be added to the next visible frame too.
  198|  45.2k|    const int flags_mask = ((f->frame_hdr->show_frame || c->output_invisible_frames) &&
  ------------------
  |  Branch (198:30): [True: 40.5k, False: 4.68k]
  |  Branch (198:58): [True: 0, False: 4.68k]
  ------------------
  199|  40.5k|                            c->max_spatial_id == f->frame_hdr->spatial_id)
  ------------------
  |  Branch (199:29): [True: 35.3k, False: 5.14k]
  ------------------
  200|  45.2k|                           ? 0 : (PICTURE_FLAG_NEW_SEQUENCE | PICTURE_FLAG_NEW_OP_PARAMS_INFO);
  201|  45.2k|    p->flags = c->frame_flags;
  202|  45.2k|    c->frame_flags &= flags_mask;
  203|       |
  204|  45.2k|    p->visible = f->frame_hdr->show_frame;
  205|  45.2k|    p->showable = f->frame_hdr->showable_frame;
  206|       |
  207|  45.2k|    if (p->visible) {
  ------------------
  |  Branch (207:9): [True: 40.5k, False: 4.68k]
  ------------------
  208|       |        // Only add HDR10+ and T35 metadata when show frame flag is enabled
  209|  40.5k|        dav1d_picture_copy_props(&p->p, c->content_light, c->content_light_ref,
  210|  40.5k|                                 c->mastering_display, c->mastering_display_ref,
  211|  40.5k|                                 c->itut_t35, c->itut_t35_ref, c->n_itut_t35,
  212|  40.5k|                                 &f->tile[0].data.m);
  213|       |
  214|       |        // Must be removed from the context after being attached to the frame
  215|  40.5k|        dav1d_ref_dec(&c->itut_t35_ref);
  216|  40.5k|        c->itut_t35 = NULL;
  217|  40.5k|        c->n_itut_t35 = 0;
  218|  40.5k|    } else {
  219|  4.68k|        dav1d_data_props_copy(&p->p.m, &f->tile[0].data.m);
  220|  4.68k|    }
  221|       |
  222|  45.2k|    if (c->n_fc > 1) {
  ------------------
  |  Branch (222:9): [True: 0, False: 45.2k]
  ------------------
  223|      0|        atomic_init(&p->progress[0], 0);
  224|       |        atomic_init(&p->progress[1], 0);
  225|      0|    }
  226|  45.2k|    return res;
  227|  45.2k|}
dav1d_picture_alloc_copy:
  231|  9.26k|{
  232|  9.26k|    struct pic_ctx_context *const pic_ctx = (struct pic_ctx_context*)src->ref->const_data;
  233|  9.26k|    const int res = picture_alloc(c, dst, w, src->p.h,
  234|  9.26k|                                  src->seq_hdr, src->seq_hdr_ref,
  235|  9.26k|                                  src->frame_hdr, src->frame_hdr_ref,
  236|  9.26k|                                  src->p.bpc, &src->m, &pic_ctx->allocator,
  237|  9.26k|                                  NULL);
  238|  9.26k|    if (res) return res;
  ------------------
  |  Branch (238:9): [True: 0, False: 9.26k]
  ------------------
  239|       |
  240|  9.26k|    dav1d_picture_copy_props(dst, src->content_light, src->content_light_ref,
  241|  9.26k|                             src->mastering_display, src->mastering_display_ref,
  242|  9.26k|                             src->itut_t35, src->itut_t35_ref, src->n_itut_t35,
  243|  9.26k|                             &src->m);
  244|       |
  245|  9.26k|    return 0;
  246|  9.26k|}
dav1d_picture_ref:
  248|   515k|void dav1d_picture_ref(Dav1dPicture *const dst, const Dav1dPicture *const src) {
  249|   515k|    assert(dst != NULL);
  ------------------
  |  Branch (249:5): [True: 515k, False: 0]
  ------------------
  250|   515k|    assert(dst->data[0] == NULL);
  ------------------
  |  Branch (250:5): [True: 515k, False: 0]
  ------------------
  251|   515k|    assert(src != NULL);
  ------------------
  |  Branch (251:5): [True: 515k, False: 0]
  ------------------
  252|       |
  253|   515k|    if (src->ref) {
  ------------------
  |  Branch (253:9): [True: 515k, False: 0]
  ------------------
  254|   515k|        assert(src->data[0] != NULL);
  ------------------
  |  Branch (254:9): [True: 515k, False: 0]
  ------------------
  255|   515k|        dav1d_ref_inc(src->ref);
  256|   515k|    }
  257|   515k|    if (src->frame_hdr_ref) dav1d_ref_inc(src->frame_hdr_ref);
  ------------------
  |  Branch (257:9): [True: 515k, False: 0]
  ------------------
  258|   515k|    if (src->seq_hdr_ref) dav1d_ref_inc(src->seq_hdr_ref);
  ------------------
  |  Branch (258:9): [True: 515k, False: 0]
  ------------------
  259|   515k|    if (src->m.user_data.ref) dav1d_ref_inc(src->m.user_data.ref);
  ------------------
  |  Branch (259:9): [True: 0, False: 515k]
  ------------------
  260|   515k|    if (src->content_light_ref) dav1d_ref_inc(src->content_light_ref);
  ------------------
  |  Branch (260:9): [True: 4.76k, False: 510k]
  ------------------
  261|   515k|    if (src->mastering_display_ref) dav1d_ref_inc(src->mastering_display_ref);
  ------------------
  |  Branch (261:9): [True: 6.13k, False: 508k]
  ------------------
  262|   515k|    if (src->itut_t35_ref) dav1d_ref_inc(src->itut_t35_ref);
  ------------------
  |  Branch (262:9): [True: 2.10k, False: 512k]
  ------------------
  263|   515k|    *dst = *src;
  264|   515k|}
dav1d_picture_move_ref:
  266|  17.9k|void dav1d_picture_move_ref(Dav1dPicture *const dst, Dav1dPicture *const src) {
  267|  17.9k|    assert(dst != NULL);
  ------------------
  |  Branch (267:5): [True: 17.9k, False: 0]
  ------------------
  268|  17.9k|    assert(dst->data[0] == NULL);
  ------------------
  |  Branch (268:5): [True: 17.9k, False: 0]
  ------------------
  269|  17.9k|    assert(src != NULL);
  ------------------
  |  Branch (269:5): [True: 17.9k, False: 0]
  ------------------
  270|       |
  271|  17.9k|    if (src->ref)
  ------------------
  |  Branch (271:9): [True: 17.9k, False: 0]
  ------------------
  272|  17.9k|        assert(src->data[0] != NULL);
  ------------------
  |  Branch (272:9): [True: 17.9k, False: 0]
  ------------------
  273|       |
  274|  17.9k|    *dst = *src;
  275|  17.9k|    memset(src, 0, sizeof(*src));
  276|  17.9k|}
dav1d_thread_picture_ref:
  280|   474k|{
  281|   474k|    dav1d_picture_ref(&dst->p, &src->p);
  282|   474k|    dst->visible = src->visible;
  283|   474k|    dst->showable = src->showable;
  284|   474k|    dst->progress = src->progress;
  285|   474k|    dst->flags = src->flags;
  286|   474k|}
dav1d_picture_unref_internal:
  299|   675k|void dav1d_picture_unref_internal(Dav1dPicture *const p) {
  300|   675k|    validate_input(p != NULL);
  ------------------
  |  |   59|   675k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|   675k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 675k]
  |  |  |  |  ------------------
  |  |  |  |   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|   675k|    if (p->ref) {
  ------------------
  |  Branch (302:9): [True: 569k, False: 105k]
  ------------------
  303|   569k|        validate_input(p->data[0] != NULL);
  ------------------
  |  |   59|   569k|#define validate_input(x) validate_input_or_ret(x, )
  |  |  ------------------
  |  |  |  |   52|   569k|    if (!(x)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (52:9): [True: 0, False: 569k]
  |  |  |  |  ------------------
  |  |  |  |   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|   569k|        dav1d_ref_dec(&p->ref);
  305|   569k|    }
  306|   675k|    dav1d_ref_dec(&p->seq_hdr_ref);
  307|   675k|    dav1d_ref_dec(&p->frame_hdr_ref);
  308|   675k|    dav1d_ref_dec(&p->m.user_data.ref);
  309|   675k|    dav1d_ref_dec(&p->content_light_ref);
  310|   675k|    dav1d_ref_dec(&p->mastering_display_ref);
  311|   675k|    dav1d_ref_dec(&p->itut_t35_ref);
  312|   675k|    memset(p, 0, sizeof(*p));
  313|   675k|    dav1d_data_props_set_defaults(&p->m);
  314|   675k|}
dav1d_thread_picture_unref:
  316|   579k|void dav1d_thread_picture_unref(Dav1dThreadPicture *const p) {
  317|   579k|    dav1d_picture_unref_internal(&p->p);
  318|       |
  319|       |    p->progress = NULL;
  320|   579k|}
dav1d_picture_get_event_flags:
  322|  46.4k|enum Dav1dEventFlags dav1d_picture_get_event_flags(const Dav1dThreadPicture *const p) {
  323|  46.4k|    if (!p->flags)
  ------------------
  |  Branch (323:9): [True: 25.7k, False: 20.7k]
  ------------------
  324|  25.7k|        return 0;
  325|       |
  326|  20.7k|    enum Dav1dEventFlags flags = 0;
  327|  20.7k|    if (p->flags & PICTURE_FLAG_NEW_SEQUENCE)
  ------------------
  |  Branch (327:9): [True: 19.3k, False: 1.37k]
  ------------------
  328|  19.3k|       flags |= DAV1D_EVENT_FLAG_NEW_SEQUENCE;
  329|  20.7k|    if (p->flags & PICTURE_FLAG_NEW_OP_PARAMS_INFO)
  ------------------
  |  Branch (329:9): [True: 194, False: 20.5k]
  ------------------
  330|    194|       flags |= DAV1D_EVENT_FLAG_NEW_OP_PARAMS_INFO;
  331|       |
  332|  20.7k|    return flags;
  333|  46.4k|}
picture.c:picture_alloc:
  117|  54.4k|{
  118|  54.4k|    if (p->data[0]) {
  ------------------
  |  Branch (118:9): [True: 0, False: 54.4k]
  ------------------
  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|  54.4k|    assert(bpc > 0 && bpc <= 16);
  ------------------
  |  Branch (122:5): [True: 54.4k, False: 0]
  |  Branch (122:5): [True: 54.4k, False: 0]
  ------------------
  123|       |
  124|  54.4k|    size_t extra = c->n_fc > 1 ? sizeof(atomic_int) * 2 : 0;
  ------------------
  |  Branch (124:20): [True: 0, False: 54.4k]
  ------------------
  125|  54.4k|    struct pic_ctx_context *pic_ctx = dav1d_mem_pool_pop(c->pic_ctx_pool, extra +
  126|  54.4k|                                                         sizeof(struct pic_ctx_context));
  127|  54.4k|    if (!pic_ctx)
  ------------------
  |  Branch (127:9): [True: 0, False: 54.4k]
  ------------------
  128|      0|        return DAV1D_ERR(ENOMEM);
  ------------------
  |  |   58|      0|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  129|       |
  130|  54.4k|    p->p.w = w;
  131|  54.4k|    p->p.h = h;
  132|  54.4k|    p->seq_hdr = seq_hdr;
  133|  54.4k|    p->frame_hdr = frame_hdr;
  134|  54.4k|    p->p.layout = seq_hdr->layout;
  135|  54.4k|    p->p.bpc = bpc;
  136|  54.4k|    dav1d_data_props_set_defaults(&p->m);
  137|  54.4k|    const int res = p_allocator->alloc_picture_callback(p, p_allocator->cookie);
  138|  54.4k|    if (res < 0) {
  ------------------
  |  Branch (138:9): [True: 0, False: 54.4k]
  ------------------
  139|      0|        dav1d_mem_pool_push(c->pic_ctx_pool, pic_ctx);
  140|      0|        return res;
  141|      0|    }
  142|       |
  143|  54.4k|    pic_ctx->allocator = *p_allocator;
  144|  54.4k|    pic_ctx->pic = *p;
  145|  54.4k|    p->ref = dav1d_ref_init(&pic_ctx->ref, pic_ctx, free_buffer, c->pic_ctx_pool, 0);
  146|       |
  147|  54.4k|    p->seq_hdr_ref = seq_hdr_ref;
  148|  54.4k|    if (seq_hdr_ref) dav1d_ref_inc(seq_hdr_ref);
  ------------------
  |  Branch (148:9): [True: 54.4k, False: 0]
  ------------------
  149|       |
  150|  54.4k|    p->frame_hdr_ref = frame_hdr_ref;
  151|  54.4k|    if (frame_hdr_ref) dav1d_ref_inc(frame_hdr_ref);
  ------------------
  |  Branch (151:9): [True: 54.4k, False: 0]
  ------------------
  152|       |
  153|  54.4k|    if (extra && extra_ptr)
  ------------------
  |  Branch (153:9): [True: 0, False: 54.4k]
  |  Branch (153:18): [True: 0, False: 0]
  ------------------
  154|      0|        *extra_ptr = &pic_ctx->extra_data;
  155|       |
  156|  54.4k|    return 0;
  157|  54.4k|}
picture.c:free_buffer:
   91|  54.4k|static void free_buffer(const uint8_t *const data, void *const user_data) {
   92|  54.4k|    struct pic_ctx_context *pic_ctx = (struct pic_ctx_context*)data;
   93|       |
   94|  54.4k|    pic_ctx->allocator.release_picture_callback(&pic_ctx->pic,
   95|  54.4k|                                                pic_ctx->allocator.cookie);
   96|  54.4k|    dav1d_mem_pool_push(user_data, pic_ctx);
   97|  54.4k|}

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

dav1d_recon_b_intra_8bpc:
 1179|   932k|{
 1180|   932k|    Dav1dTileState *const ts = t->ts;
 1181|   932k|    const Dav1dFrameContext *const f = t->f;
 1182|   932k|    const Dav1dDSPContext *const dsp = f->dsp;
 1183|   932k|    const int bx4 = t->bx & 31, by4 = t->by & 31;
 1184|   932k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1185|   932k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 1186|   932k|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
 1187|   932k|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
 1188|   932k|    const int bw4 = b_dim[0], bh4 = b_dim[1];
 1189|   932k|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
 1190|   932k|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
 1191|   932k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (1191:28): [True: 663k, False: 268k]
  ------------------
 1192|   663k|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (1192:29): [True: 623k, False: 39.9k]
  |  Branch (1192:45): [True: 20.1k, False: 19.8k]
  ------------------
 1193|   643k|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (1193:29): [True: 615k, False: 28.4k]
  |  Branch (1193:45): [True: 14.2k, False: 14.1k]
  ------------------
 1194|   932k|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[b->tx];
 1195|   932k|    const TxfmInfo *const uv_t_dim = &dav1d_txfm_dimensions[b->uvtx];
 1196|       |
 1197|       |    // coefficient coding
 1198|   932k|    pixel *const edge = bitfn(t->scratch.edge) + 128;
  ------------------
  |  |   51|   932k|#define bitfn(x) x##_8bpc
  ------------------
 1199|   932k|    const int cbw4 = (bw4 + ss_hor) >> ss_hor, cbh4 = (bh4 + ss_ver) >> ss_ver;
 1200|       |
 1201|   932k|    const int intra_edge_filter_flag = f->seq_hdr->intra_edge_filter << 10;
 1202|       |
 1203|  1.89M|    for (int init_y = 0; init_y < h4; init_y += 16) {
  ------------------
  |  Branch (1203:26): [True: 961k, False: 932k]
  ------------------
 1204|   961k|        const int sub_h4 = imin(h4, 16 + init_y);
 1205|   961k|        const int sub_ch4 = imin(ch4, (init_y + 16) >> ss_ver);
 1206|  1.98M|        for (int init_x = 0; init_x < w4; init_x += 16) {
  ------------------
  |  Branch (1206:30): [True: 1.02M, False: 961k]
  ------------------
 1207|  1.02M|            if (b->pal_sz[0]) {
  ------------------
  |  Branch (1207:17): [True: 21.8k, False: 998k]
  ------------------
 1208|  21.8k|                pixel *dst = ((pixel *) f->cur.data[0]) +
 1209|  21.8k|                             4 * (t->by * PXSTRIDE(f->cur.stride[0]) + t->bx);
  ------------------
  |  |   53|  21.8k|#define PXSTRIDE(x) (x)
  ------------------
 1210|  21.8k|                const uint8_t *pal_idx;
 1211|  21.8k|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (1211:21): [True: 0, False: 21.8k]
  ------------------
 1212|      0|                    const int p = t->frame_thread.pass & 1;
 1213|      0|                    assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  Branch (1213:21): [True: 0, False: 0]
  ------------------
 1214|      0|                    pal_idx = ts->frame_thread[p].pal_idx;
 1215|      0|                    ts->frame_thread[p].pal_idx += bw4 * bh4 * 8;
 1216|  21.8k|                } else {
 1217|  21.8k|                    pal_idx = t->scratch.pal_idx_y;
 1218|  21.8k|                }
 1219|  21.8k|                const pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (1219:42): [True: 0, False: 21.8k]
  ------------------
 1220|      0|                    f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 1221|      0|                                        ((t->bx >> 1) + (t->by & 1))][0] :
 1222|  21.8k|                    bytefn(t->scratch.pal)[0];
  ------------------
  |  |   87|  21.8k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  21.8k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1223|  21.8k|                f->dsp->ipred.pal_pred(dst, f->cur.stride[0], pal,
 1224|  21.8k|                                       pal_idx, bw4 * 4, bh4 * 4);
 1225|  21.8k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|  21.8k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 21.8k]
  |  |  ------------------
  |  |   35|  21.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|  21.8k|        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|  21.8k|            }
 1229|       |
 1230|  1.02M|            const int intra_flags = (sm_flag(t->a, bx4) |
 1231|  1.02M|                                     sm_flag(&t->l, by4) |
 1232|  1.02M|                                     intra_edge_filter_flag);
 1233|  1.02M|            const int sb_has_tr = init_x + 16 < w4 ? 1 : init_y ? 0 :
  ------------------
  |  Branch (1233:35): [True: 59.0k, False: 961k]
  |  Branch (1233:58): [True: 29.0k, False: 932k]
  ------------------
 1234|   961k|                              intra_edge_flags & EDGE_I444_TOP_HAS_RIGHT;
 1235|  1.02M|            const int sb_has_bl = init_x ? 0 : init_y + 16 < h4 ? 1 :
  ------------------
  |  Branch (1235:35): [True: 59.0k, False: 961k]
  |  Branch (1235:48): [True: 29.0k, False: 932k]
  ------------------
 1236|   961k|                              intra_edge_flags & EDGE_I444_LEFT_HAS_BOTTOM;
 1237|  1.02M|            int y, x;
 1238|  1.02M|            const int sub_w4 = imin(w4, init_x + 16);
 1239|  2.61M|            for (y = init_y, t->by += init_y; y < sub_h4;
  ------------------
  |  Branch (1239:47): [True: 1.59M, False: 1.02M]
  ------------------
 1240|  1.59M|                 y += t_dim->h, t->by += t_dim->h)
 1241|  1.59M|            {
 1242|  1.59M|                pixel *dst = ((pixel *) f->cur.data[0]) +
 1243|  1.59M|                               4 * (t->by * PXSTRIDE(f->cur.stride[0]) +
  ------------------
  |  |   53|  1.59M|#define PXSTRIDE(x) (x)
  ------------------
 1244|  1.59M|                                    t->bx + init_x);
 1245|  6.59M|                for (x = init_x, t->bx += init_x; x < sub_w4;
  ------------------
  |  Branch (1245:51): [True: 4.99M, False: 1.59M]
  ------------------
 1246|  4.99M|                     x += t_dim->w, t->bx += t_dim->w)
 1247|  4.99M|                {
 1248|  4.99M|                    if (b->pal_sz[0]) goto skip_y_pred;
  ------------------
  |  Branch (1248:25): [True: 35.8k, False: 4.96M]
  ------------------
 1249|       |
 1250|  4.96M|                    int angle = b->y_angle;
 1251|  4.96M|                    const enum EdgeFlags edge_flags =
 1252|  4.96M|                        (((y > init_y || !sb_has_tr) && (x + t_dim->w >= sub_w4)) ?
  ------------------
  |  Branch (1252:28): [True: 3.48M, False: 1.47M]
  |  Branch (1252:42): [True: 434k, False: 1.04M]
  |  Branch (1252:57): [True: 876k, False: 3.04M]
  ------------------
 1253|  4.08M|                             0 : EDGE_I444_TOP_HAS_RIGHT) |
 1254|  4.96M|                        ((x > init_x || (!sb_has_bl && y + t_dim->h >= sub_h4)) ?
  ------------------
  |  Branch (1254:27): [True: 3.39M, False: 1.56M]
  |  Branch (1254:42): [True: 1.06M, False: 499k]
  |  Branch (1254:56): [True: 604k, False: 464k]
  ------------------
 1255|  3.99M|                             0 : EDGE_I444_LEFT_HAS_BOTTOM);
 1256|  4.96M|                    const pixel *top_sb_edge = NULL;
 1257|  4.96M|                    if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1257:25): [True: 696k, False: 4.26M]
  ------------------
 1258|   696k|                        top_sb_edge = f->ipred_edge[0];
 1259|   696k|                        const int sby = t->by >> f->sb_shift;
 1260|   696k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1261|   696k|                    }
 1262|  4.96M|                    const enum IntraPredMode m =
 1263|  4.96M|                        bytefn(dav1d_prepare_intra_edges)(t->bx,
  ------------------
  |  |   87|  4.96M|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  4.96M|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1264|  4.96M|                                                          t->bx > ts->tiling.col_start,
 1265|  4.96M|                                                          t->by,
 1266|  4.96M|                                                          t->by > ts->tiling.row_start,
 1267|  4.96M|                                                          ts->tiling.col_end,
 1268|  4.96M|                                                          ts->tiling.row_end,
 1269|  4.96M|                                                          edge_flags, dst,
 1270|  4.96M|                                                          f->cur.stride[0], top_sb_edge,
 1271|  4.96M|                                                          b->y_mode, &angle,
 1272|  4.96M|                                                          t_dim->w, t_dim->h,
 1273|  4.96M|                                                          f->seq_hdr->intra_edge_filter,
 1274|  4.96M|                                                          edge HIGHBD_CALL_SUFFIX);
 1275|  4.96M|                    dsp->ipred.intra_pred[m](dst, f->cur.stride[0], edge,
 1276|  4.96M|                                             t_dim->w * 4, t_dim->h * 4,
 1277|  4.96M|                                             angle | intra_flags,
 1278|  4.96M|                                             4 * f->bw - 4 * t->bx,
 1279|  4.96M|                                             4 * f->bh - 4 * t->by
 1280|  4.96M|                                             HIGHBD_CALL_SUFFIX);
 1281|       |
 1282|  4.96M|                    if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  4.96M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 4.96M]
  |  |  ------------------
  |  |   35|  4.96M|        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.96M|        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|  4.99M|                skip_y_pred: {}
 1293|  4.99M|                    if (!b->skip) {
  ------------------
  |  Branch (1293:25): [True: 1.54M, False: 3.45M]
  ------------------
 1294|  1.54M|                        coef *cf;
 1295|  1.54M|                        int eob;
 1296|  1.54M|                        enum TxfmType txtp;
 1297|  1.54M|                        if (t->frame_thread.pass) {
  ------------------
  |  Branch (1297:29): [True: 0, False: 1.54M]
  ------------------
 1298|      0|                            const int p = t->frame_thread.pass & 1;
 1299|      0|                            const int cbi = *ts->frame_thread[p].cbi++;
 1300|      0|                            cf = ts->frame_thread[p].cf;
 1301|      0|                            ts->frame_thread[p].cf += imin(t_dim->w, 8) * imin(t_dim->h, 8) * 16;
 1302|      0|                            eob  = cbi >> 5;
 1303|      0|                            txtp = cbi & 0x1f;
 1304|  1.54M|                        } else {
 1305|  1.54M|                            uint8_t cf_ctx;
 1306|  1.54M|                            cf = bitfn(t->cf);
  ------------------
  |  |   51|  1.54M|#define bitfn(x) x##_8bpc
  ------------------
 1307|  1.54M|                            eob = decode_coefs(t, &t->a->lcoef[bx4 + x],
 1308|  1.54M|                                               &t->l.lcoef[by4 + y], b->tx, bs,
 1309|  1.54M|                                               b, 1, 0, cf, &txtp, &cf_ctx);
 1310|  1.54M|                            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.54M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.54M]
  |  |  ------------------
  |  |   35|  1.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|  1.54M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1311|      0|                                printf("Post-y-cf-blk[tx=%d,txtp=%d,eob=%d]: r=%d\n",
 1312|      0|                                       b->tx, txtp, eob, ts->msac.rng);
 1313|  1.54M|                            dav1d_memset_likely_pow2(&t->a->lcoef[bx4 + x], cf_ctx, imin(t_dim->w, f->bw - t->bx));
 1314|  1.54M|                            dav1d_memset_likely_pow2(&t->l.lcoef[by4 + y], cf_ctx, imin(t_dim->h, f->bh - t->by));
 1315|  1.54M|                        }
 1316|  1.54M|                        if (eob >= 0) {
  ------------------
  |  Branch (1316:29): [True: 927k, False: 616k]
  ------------------
 1317|   927k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   927k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 927k]
  |  |  ------------------
  |  |   35|   927k|        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|   927k|        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|   927k|                            dsp->itx.itxfm_add[b->tx]
 1321|   927k|                                              [txtp](dst,
 1322|   927k|                                                     f->cur.stride[0],
 1323|   927k|                                                     cf, eob HIGHBD_CALL_SUFFIX);
 1324|   927k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   927k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 927k]
  |  |  ------------------
  |  |   35|   927k|        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|   927k|        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|   927k|                        }
 1328|  3.45M|                    } else if (!t->frame_thread.pass) {
  ------------------
  |  Branch (1328:32): [True: 3.45M, False: 0]
  ------------------
 1329|  3.45M|                        dav1d_memset_pow2[t_dim->lw](&t->a->lcoef[bx4 + x], 0x40);
 1330|  3.45M|                        dav1d_memset_pow2[t_dim->lh](&t->l.lcoef[by4 + y], 0x40);
 1331|  3.45M|                    }
 1332|  4.99M|                    dst += 4 * t_dim->w;
 1333|  4.99M|                }
 1334|  1.59M|                t->bx -= x;
 1335|  1.59M|            }
 1336|  1.02M|            t->by -= y;
 1337|       |
 1338|  1.02M|            if (!has_chroma) continue;
  ------------------
  |  Branch (1338:17): [True: 321k, False: 698k]
  ------------------
 1339|       |
 1340|   698k|            const ptrdiff_t stride = f->cur.stride[1];
 1341|       |
 1342|   698k|            if (b->uv_mode == CFL_PRED) {
  ------------------
  |  Branch (1342:17): [True: 130k, False: 568k]
  ------------------
 1343|   130k|                assert(!init_x && !init_y);
  ------------------
  |  Branch (1343:17): [True: 130k, False: 0]
  |  Branch (1343:17): [True: 130k, False: 0]
  ------------------
 1344|       |
 1345|   130k|                int16_t *const ac = t->scratch.ac;
 1346|   130k|                pixel *y_src = ((pixel *) f->cur.data[0]) + 4 * (t->bx & ~ss_hor) +
 1347|   130k|                                 4 * (t->by & ~ss_ver) * PXSTRIDE(f->cur.stride[0]);
  ------------------
  |  |   53|   130k|#define PXSTRIDE(x) (x)
  ------------------
 1348|   130k|                const ptrdiff_t uv_off = 4 * ((t->bx >> ss_hor) +
 1349|   130k|                                              (t->by >> ss_ver) * PXSTRIDE(stride));
  ------------------
  |  |   53|   130k|#define PXSTRIDE(x) (x)
  ------------------
 1350|   130k|                pixel *const uv_dst[2] = { ((pixel *) f->cur.data[1]) + uv_off,
 1351|   130k|                                           ((pixel *) f->cur.data[2]) + uv_off };
 1352|       |
 1353|   130k|                const int furthest_r =
 1354|   130k|                    ((cw4 << ss_hor) + t_dim->w - 1) & ~(t_dim->w - 1);
 1355|   130k|                const int furthest_b =
 1356|   130k|                    ((ch4 << ss_ver) + t_dim->h - 1) & ~(t_dim->h - 1);
 1357|   130k|                dsp->ipred.cfl_ac[f->cur.p.layout - 1](ac, y_src, f->cur.stride[0],
 1358|   130k|                                                         cbw4 - (furthest_r >> ss_hor),
 1359|   130k|                                                         cbh4 - (furthest_b >> ss_ver),
 1360|   130k|                                                         cbw4 * 4, cbh4 * 4);
 1361|   391k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1361:34): [True: 260k, False: 130k]
  ------------------
 1362|   260k|                    if (!b->cfl_alpha[pl]) continue;
  ------------------
  |  Branch (1362:25): [True: 48.3k, False: 212k]
  ------------------
 1363|   212k|                    int angle = 0;
 1364|   212k|                    const pixel *top_sb_edge = NULL;
 1365|   212k|                    if (!((t->by & ~ss_ver) & (f->sb_step - 1))) {
  ------------------
  |  Branch (1365:25): [True: 63.1k, False: 149k]
  ------------------
 1366|  63.1k|                        top_sb_edge = f->ipred_edge[pl + 1];
 1367|  63.1k|                        const int sby = t->by >> f->sb_shift;
 1368|  63.1k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1369|  63.1k|                    }
 1370|   212k|                    const int xpos = t->bx >> ss_hor, ypos = t->by >> ss_ver;
 1371|   212k|                    const int xstart = ts->tiling.col_start >> ss_hor;
 1372|   212k|                    const int ystart = ts->tiling.row_start >> ss_ver;
 1373|   212k|                    const enum IntraPredMode m =
 1374|   212k|                        bytefn(dav1d_prepare_intra_edges)(xpos, xpos > xstart,
  ------------------
  |  |   87|   212k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|   212k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1375|   212k|                                                          ypos, ypos > ystart,
 1376|   212k|                                                          ts->tiling.col_end >> ss_hor,
 1377|   212k|                                                          ts->tiling.row_end >> ss_ver,
 1378|   212k|                                                          0, uv_dst[pl], stride,
 1379|   212k|                                                          top_sb_edge, DC_PRED, &angle,
 1380|   212k|                                                          uv_t_dim->w, uv_t_dim->h, 0,
 1381|   212k|                                                          edge HIGHBD_CALL_SUFFIX);
 1382|   212k|                    dsp->ipred.cfl_pred[m](uv_dst[pl], stride, edge,
 1383|   212k|                                           uv_t_dim->w * 4,
 1384|   212k|                                           uv_t_dim->h * 4,
 1385|   212k|                                           ac, b->cfl_alpha[pl]
 1386|   212k|                                           HIGHBD_CALL_SUFFIX);
 1387|   212k|                }
 1388|   130k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|   130k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 130k]
  |  |  ------------------
  |  |   35|   130k|        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|   130k|        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|   568k|            } else if (b->pal_sz[1]) {
  ------------------
  |  Branch (1393:24): [True: 4.47k, False: 563k]
  ------------------
 1394|  4.47k|                const ptrdiff_t uv_dstoff = 4 * ((t->bx >> ss_hor) +
 1395|  4.47k|                                              (t->by >> ss_ver) * PXSTRIDE(f->cur.stride[1]));
  ------------------
  |  |   53|  4.47k|#define PXSTRIDE(x) (x)
  ------------------
 1396|  4.47k|                const pixel (*pal)[8];
 1397|  4.47k|                const uint8_t *pal_idx;
 1398|  4.47k|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (1398:21): [True: 0, False: 4.47k]
  ------------------
 1399|      0|                    const int p = t->frame_thread.pass & 1;
 1400|      0|                    assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  Branch (1400:21): [True: 0, False: 0]
  ------------------
 1401|      0|                    pal = f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 1402|      0|                                              ((t->bx >> 1) + (t->by & 1))];
 1403|      0|                    pal_idx = ts->frame_thread[p].pal_idx;
 1404|      0|                    ts->frame_thread[p].pal_idx += cbw4 * cbh4 * 8;
 1405|  4.47k|                } else {
 1406|  4.47k|                    pal = bytefn(t->scratch.pal);
  ------------------
  |  |   87|  4.47k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  4.47k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1407|  4.47k|                    pal_idx = t->scratch.pal_idx_uv;
 1408|  4.47k|                }
 1409|       |
 1410|  4.47k|                f->dsp->ipred.pal_pred(((pixel *) f->cur.data[1]) + uv_dstoff,
 1411|  4.47k|                                       f->cur.stride[1], pal[1],
 1412|  4.47k|                                       pal_idx, cbw4 * 4, cbh4 * 4);
 1413|  4.47k|                f->dsp->ipred.pal_pred(((pixel *) f->cur.data[2]) + uv_dstoff,
 1414|  4.47k|                                       f->cur.stride[1], pal[2],
 1415|  4.47k|                                       pal_idx, cbw4 * 4, cbh4 * 4);
 1416|  4.47k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  4.47k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 4.47k]
  |  |  ------------------
  |  |   35|  4.47k|        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.47k|        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|  4.47k|            }
 1425|       |
 1426|   698k|            const int sm_uv_fl = sm_uv_flag(t->a, cbx4) |
 1427|   698k|                                 sm_uv_flag(&t->l, cby4);
 1428|   698k|            const int uv_sb_has_tr =
 1429|   698k|                ((init_x + 16) >> ss_hor) < cw4 ? 1 : init_y ? 0 :
  ------------------
  |  Branch (1429:17): [True: 45.9k, False: 652k]
  |  Branch (1429:55): [True: 23.2k, False: 629k]
  ------------------
 1430|   652k|                intra_edge_flags & (EDGE_I420_TOP_HAS_RIGHT >> (f->cur.p.layout - 1));
 1431|   698k|            const int uv_sb_has_bl =
 1432|   698k|                init_x ? 0 : ((init_y + 16) >> ss_ver) < ch4 ? 1 :
  ------------------
  |  Branch (1432:17): [True: 45.9k, False: 652k]
  |  Branch (1432:30): [True: 23.2k, False: 629k]
  ------------------
 1433|   652k|                intra_edge_flags & (EDGE_I420_LEFT_HAS_BOTTOM >> (f->cur.p.layout - 1));
 1434|   698k|            const int sub_cw4 = imin(cw4, (init_x + 16) >> ss_hor);
 1435|  2.09M|            for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1435:30): [True: 1.39M, False: 698k]
  ------------------
 1436|  3.27M|                for (y = init_y >> ss_ver, t->by += init_y; y < sub_ch4;
  ------------------
  |  Branch (1436:61): [True: 1.87M, False: 1.39M]
  ------------------
 1437|  1.87M|                     y += uv_t_dim->h, t->by += uv_t_dim->h << ss_ver)
 1438|  1.87M|                {
 1439|  1.87M|                    pixel *dst = ((pixel *) f->cur.data[1 + pl]) +
 1440|  1.87M|                                   4 * ((t->by >> ss_ver) * PXSTRIDE(stride) +
  ------------------
  |  |   53|  1.87M|#define PXSTRIDE(x) (x)
  ------------------
 1441|  1.87M|                                        ((t->bx + init_x) >> ss_hor));
 1442|  6.21M|                    for (x = init_x >> ss_hor, t->bx += init_x; x < sub_cw4;
  ------------------
  |  Branch (1442:65): [True: 4.34M, False: 1.87M]
  ------------------
 1443|  4.34M|                         x += uv_t_dim->w, t->bx += uv_t_dim->w << ss_hor)
 1444|  4.34M|                    {
 1445|  4.34M|                        if ((b->uv_mode == CFL_PRED && b->cfl_alpha[pl]) ||
  ------------------
  |  Branch (1445:30): [True: 260k, False: 4.07M]
  |  Branch (1445:56): [True: 212k, False: 48.3k]
  ------------------
 1446|  4.12M|                            b->pal_sz[1])
  ------------------
  |  Branch (1446:29): [True: 19.0k, False: 4.10M]
  ------------------
 1447|   231k|                        {
 1448|   231k|                            goto skip_uv_pred;
 1449|   231k|                        }
 1450|       |
 1451|  4.10M|                        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|  4.10M|                        const enum EdgeFlags edge_flags =
 1456|  4.10M|                            (((y > (init_y >> ss_ver) || !uv_sb_has_tr) &&
  ------------------
  |  Branch (1456:32): [True: 2.65M, False: 1.45M]
  |  Branch (1456:58): [True: 455k, False: 998k]
  ------------------
 1457|  3.10M|                              (x + uv_t_dim->w >= sub_cw4)) ?
  ------------------
  |  Branch (1457:31): [True: 893k, False: 2.21M]
  ------------------
 1458|  3.21M|                                 0 : EDGE_I444_TOP_HAS_RIGHT) |
 1459|  4.10M|                            ((x > (init_x >> ss_hor) ||
  ------------------
  |  Branch (1459:31): [True: 2.45M, False: 1.64M]
  ------------------
 1460|  1.64M|                              (!uv_sb_has_bl && y + uv_t_dim->h >= sub_ch4)) ?
  ------------------
  |  Branch (1460:32): [True: 1.09M, False: 552k]
  |  Branch (1460:49): [True: 683k, False: 413k]
  ------------------
 1461|  3.14M|                                 0 : EDGE_I444_LEFT_HAS_BOTTOM);
 1462|  4.10M|                        const pixel *top_sb_edge = NULL;
 1463|  4.10M|                        if (!((t->by & ~ss_ver) & (f->sb_step - 1))) {
  ------------------
  |  Branch (1463:29): [True: 593k, False: 3.51M]
  ------------------
 1464|   593k|                            top_sb_edge = f->ipred_edge[1 + pl];
 1465|   593k|                            const int sby = t->by >> f->sb_shift;
 1466|   593k|                            top_sb_edge += f->sb128w * 128 * (sby - 1);
 1467|   593k|                        }
 1468|  4.10M|                        const enum IntraPredMode uv_mode =
 1469|  4.10M|                             b->uv_mode == CFL_PRED ? DC_PRED : b->uv_mode;
  ------------------
  |  Branch (1469:30): [True: 48.3k, False: 4.06M]
  ------------------
 1470|  4.10M|                        const int xpos = t->bx >> ss_hor, ypos = t->by >> ss_ver;
 1471|  4.10M|                        const int xstart = ts->tiling.col_start >> ss_hor;
 1472|  4.10M|                        const int ystart = ts->tiling.row_start >> ss_ver;
 1473|  4.10M|                        const enum IntraPredMode m =
 1474|  4.10M|                            bytefn(dav1d_prepare_intra_edges)(xpos, xpos > xstart,
  ------------------
  |  |   87|  4.10M|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  4.10M|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1475|  4.10M|                                                              ypos, ypos > ystart,
 1476|  4.10M|                                                              ts->tiling.col_end >> ss_hor,
 1477|  4.10M|                                                              ts->tiling.row_end >> ss_ver,
 1478|  4.10M|                                                              edge_flags, dst, stride,
 1479|  4.10M|                                                              top_sb_edge, uv_mode,
 1480|  4.10M|                                                              &angle, uv_t_dim->w,
 1481|  4.10M|                                                              uv_t_dim->h,
 1482|  4.10M|                                                              f->seq_hdr->intra_edge_filter,
 1483|  4.10M|                                                              edge HIGHBD_CALL_SUFFIX);
 1484|  4.10M|                        angle |= intra_edge_filter_flag;
 1485|  4.10M|                        dsp->ipred.intra_pred[m](dst, stride, edge,
 1486|  4.10M|                                                 uv_t_dim->w * 4,
 1487|  4.10M|                                                 uv_t_dim->h * 4,
 1488|  4.10M|                                                 angle | sm_uv_fl,
 1489|  4.10M|                                                 (4 * f->bw + ss_hor -
 1490|  4.10M|                                                  4 * (t->bx & ~ss_hor)) >> ss_hor,
 1491|  4.10M|                                                 (4 * f->bh + ss_ver -
 1492|  4.10M|                                                  4 * (t->by & ~ss_ver)) >> ss_ver
 1493|  4.10M|                                                 HIGHBD_CALL_SUFFIX);
 1494|  4.10M|                        if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  4.10M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 4.10M]
  |  |  ------------------
  |  |   35|  4.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|  4.10M|        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|  4.34M|                    skip_uv_pred: {}
 1505|  4.34M|                        if (!b->skip) {
  ------------------
  |  Branch (1505:29): [True: 1.34M, False: 2.99M]
  ------------------
 1506|  1.34M|                            enum TxfmType txtp;
 1507|  1.34M|                            int eob;
 1508|  1.34M|                            coef *cf;
 1509|  1.34M|                            if (t->frame_thread.pass) {
  ------------------
  |  Branch (1509:33): [True: 0, False: 1.34M]
  ------------------
 1510|      0|                                const int p = t->frame_thread.pass & 1;
 1511|      0|                                const int cbi = *ts->frame_thread[p].cbi++;
 1512|      0|                                cf = ts->frame_thread[p].cf;
 1513|      0|                                ts->frame_thread[p].cf += uv_t_dim->w * uv_t_dim->h * 16;
 1514|      0|                                eob  = cbi >> 5;
 1515|      0|                                txtp = cbi & 0x1f;
 1516|  1.34M|                            } else {
 1517|  1.34M|                                uint8_t cf_ctx;
 1518|  1.34M|                                cf = bitfn(t->cf);
  ------------------
  |  |   51|  1.34M|#define bitfn(x) x##_8bpc
  ------------------
 1519|  1.34M|                                eob = decode_coefs(t, &t->a->ccoef[pl][cbx4 + x],
 1520|  1.34M|                                                   &t->l.ccoef[pl][cby4 + y],
 1521|  1.34M|                                                   b->uvtx, bs, b, 1, 1 + pl, cf,
 1522|  1.34M|                                                   &txtp, &cf_ctx);
 1523|  1.34M|                                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.34M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.34M]
  |  |  ------------------
  |  |   35|  1.34M|        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.34M|        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|  1.34M|                                int ctw = imin(uv_t_dim->w, (f->bw - t->bx + ss_hor) >> ss_hor);
 1528|  1.34M|                                int cth = imin(uv_t_dim->h, (f->bh - t->by + ss_ver) >> ss_ver);
 1529|  1.34M|                                dav1d_memset_likely_pow2(&t->a->ccoef[pl][cbx4 + x], cf_ctx, ctw);
 1530|  1.34M|                                dav1d_memset_likely_pow2(&t->l.ccoef[pl][cby4 + y], cf_ctx, cth);
 1531|  1.34M|                            }
 1532|  1.34M|                            if (eob >= 0) {
  ------------------
  |  Branch (1532:33): [True: 338k, False: 1.00M]
  ------------------
 1533|   338k|                                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   338k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 338k]
  |  |  ------------------
  |  |   35|   338k|        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|   338k|        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|   338k|                                dsp->itx.itxfm_add[b->uvtx]
 1537|   338k|                                                  [txtp](dst, stride,
 1538|   338k|                                                         cf, eob HIGHBD_CALL_SUFFIX);
 1539|   338k|                                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   338k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 338k]
  |  |  ------------------
  |  |   35|   338k|        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|   338k|        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|   338k|                            }
 1543|  2.99M|                        } else if (!t->frame_thread.pass) {
  ------------------
  |  Branch (1543:36): [True: 2.99M, False: 0]
  ------------------
 1544|  2.99M|                            dav1d_memset_pow2[uv_t_dim->lw](&t->a->ccoef[pl][cbx4 + x], 0x40);
 1545|  2.99M|                            dav1d_memset_pow2[uv_t_dim->lh](&t->l.ccoef[pl][cby4 + y], 0x40);
 1546|  2.99M|                        }
 1547|  4.34M|                        dst += uv_t_dim->w * 4;
 1548|  4.34M|                    }
 1549|  1.87M|                    t->bx -= x << ss_hor;
 1550|  1.87M|                }
 1551|  1.39M|                t->by -= y << ss_ver;
 1552|  1.39M|            }
 1553|   698k|        }
 1554|   961k|    }
 1555|   932k|}
dav1d_recon_b_inter_8bpc:
 1559|   625k|{
 1560|   625k|    Dav1dTileState *const ts = t->ts;
 1561|   625k|    const Dav1dFrameContext *const f = t->f;
 1562|   625k|    const Dav1dDSPContext *const dsp = f->dsp;
 1563|   625k|    const int bx4 = t->bx & 31, by4 = t->by & 31;
 1564|   625k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1565|   625k|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 1566|   625k|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
 1567|   625k|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
 1568|   625k|    const int bw4 = b_dim[0], bh4 = b_dim[1];
 1569|   625k|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
 1570|   625k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (1570:28): [True: 431k, False: 193k]
  ------------------
 1571|   431k|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (1571:29): [True: 386k, False: 45.1k]
  |  Branch (1571:45): [True: 22.3k, False: 22.8k]
  ------------------
 1572|   409k|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (1572:29): [True: 381k, False: 27.7k]
  |  Branch (1572:45): [True: 13.7k, False: 14.0k]
  ------------------
 1573|   625k|    const int chr_layout_idx = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I400 ? 0 :
  ------------------
  |  Branch (1573:32): [True: 193k, False: 431k]
  ------------------
 1574|   625k|                               DAV1D_PIXEL_LAYOUT_I444 - f->cur.p.layout;
 1575|   625k|    int res;
 1576|       |
 1577|       |    // prediction
 1578|   625k|    const int cbh4 = (bh4 + ss_ver) >> ss_ver, cbw4 = (bw4 + ss_hor) >> ss_hor;
 1579|   625k|    pixel *dst = ((pixel *) f->cur.data[0]) +
 1580|   625k|        4 * (t->by * PXSTRIDE(f->cur.stride[0]) + t->bx);
  ------------------
  |  |   53|   625k|#define PXSTRIDE(x) (x)
  ------------------
 1581|   625k|    const ptrdiff_t uvdstoff =
 1582|   625k|        4 * ((t->bx >> ss_hor) + (t->by >> ss_ver) * PXSTRIDE(f->cur.stride[1]));
  ------------------
  |  |   53|   625k|#define PXSTRIDE(x) (x)
  ------------------
 1583|   625k|    if (IS_KEY_OR_INTRA(f->frame_hdr)) {
  ------------------
  |  |   43|   625k|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|   625k|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 174k, False: 450k]
  |  |  ------------------
  ------------------
 1584|       |        // intrabc
 1585|   174k|        assert(!f->frame_hdr->super_res.enabled);
  ------------------
  |  Branch (1585:9): [True: 174k, False: 0]
  ------------------
 1586|   174k|        res = mc(t, dst, NULL, f->cur.stride[0], bw4, bh4, t->bx, t->by, 0,
 1587|   174k|                 b->mv[0], &f->sr_cur, 0 /* unused */, FILTER_2D_BILINEAR);
 1588|   174k|        if (res) return res;
  ------------------
  |  Branch (1588:13): [True: 0, False: 174k]
  ------------------
 1589|   386k|        if (has_chroma) for (int pl = 1; pl < 3; pl++) {
  ------------------
  |  Branch (1589:13): [True: 128k, False: 45.9k]
  |  Branch (1589:42): [True: 257k, False: 128k]
  ------------------
 1590|   257k|            res = mc(t, ((pixel *)f->cur.data[pl]) + uvdstoff, NULL, f->cur.stride[1],
 1591|   257k|                     bw4 << (bw4 == ss_hor), bh4 << (bh4 == ss_ver),
 1592|   257k|                     t->bx & ~ss_hor, t->by & ~ss_ver, pl, b->mv[0],
 1593|   257k|                     &f->sr_cur, 0 /* unused */, FILTER_2D_BILINEAR);
 1594|   257k|            if (res) return res;
  ------------------
  |  Branch (1594:17): [True: 0, False: 257k]
  ------------------
 1595|   257k|        }
 1596|   450k|    } else if (b->comp_type == COMP_INTER_NONE) {
  ------------------
  |  Branch (1596:16): [True: 380k, False: 70.2k]
  ------------------
 1597|   380k|        const Dav1dThreadPicture *const refp = &f->refp[b->ref[0]];
 1598|   380k|        const enum Filter2d filter_2d = b->filter2d;
 1599|       |
 1600|   380k|        if (imin(bw4, bh4) > 1 &&
  ------------------
  |  Branch (1600:13): [True: 252k, False: 127k]
  ------------------
 1601|   252k|            ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (1601:15): [True: 91.0k, False: 161k]
  |  Branch (1601:44): [True: 1.53k, False: 89.4k]
  ------------------
 1602|   250k|             (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (1602:15): [True: 28.9k, False: 221k]
  |  Branch (1602:44): [True: 26.1k, False: 2.81k]
  ------------------
 1603|  27.6k|        {
 1604|  27.6k|            res = warp_affine(t, dst, NULL, f->cur.stride[0], b_dim, 0, refp,
 1605|  27.6k|                              b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (1605:31): [True: 26.1k, False: 1.53k]
  ------------------
 1606|  27.6k|                                  &f->frame_hdr->gmv[b->ref[0]]);
 1607|  27.6k|            if (res) return res;
  ------------------
  |  Branch (1607:17): [True: 0, False: 27.6k]
  ------------------
 1608|   352k|        } else {
 1609|   352k|            res = mc(t, dst, NULL, f->cur.stride[0],
 1610|   352k|                     bw4, bh4, t->bx, t->by, 0, b->mv[0], refp, b->ref[0], filter_2d);
 1611|   352k|            if (res) return res;
  ------------------
  |  Branch (1611:17): [True: 0, False: 352k]
  ------------------
 1612|   352k|            if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (1612:17): [True: 77.8k, False: 274k]
  ------------------
 1613|  77.8k|                res = obmc(t, dst, f->cur.stride[0], b_dim, 0, bx4, by4, w4, h4);
 1614|  77.8k|                if (res) return res;
  ------------------
  |  Branch (1614:21): [True: 0, False: 77.8k]
  ------------------
 1615|  77.8k|            }
 1616|   352k|        }
 1617|   380k|        if (b->interintra_type) {
  ------------------
  |  Branch (1617:13): [True: 30.4k, False: 349k]
  ------------------
 1618|  30.4k|            pixel *const tl_edge = bitfn(t->scratch.edge) + 32;
  ------------------
  |  |   51|  30.4k|#define bitfn(x) x##_8bpc
  ------------------
 1619|  30.4k|            enum IntraPredMode m = b->interintra_mode == II_SMOOTH_PRED ?
  ------------------
  |  Branch (1619:36): [True: 5.93k, False: 24.5k]
  ------------------
 1620|  24.5k|                                   SMOOTH_PRED : b->interintra_mode;
 1621|  30.4k|            pixel *const tmp = bitfn(t->scratch.interintra);
  ------------------
  |  |   51|  30.4k|#define bitfn(x) x##_8bpc
  ------------------
 1622|  30.4k|            int angle = 0;
 1623|  30.4k|            const pixel *top_sb_edge = NULL;
 1624|  30.4k|            if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1624:17): [True: 3.43k, False: 27.0k]
  ------------------
 1625|  3.43k|                top_sb_edge = f->ipred_edge[0];
 1626|  3.43k|                const int sby = t->by >> f->sb_shift;
 1627|  3.43k|                top_sb_edge += f->sb128w * 128 * (sby - 1);
 1628|  3.43k|            }
 1629|  30.4k|            m = bytefn(dav1d_prepare_intra_edges)(t->bx, t->bx > ts->tiling.col_start,
  ------------------
  |  |   87|  30.4k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  30.4k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1630|  30.4k|                                                  t->by, t->by > ts->tiling.row_start,
 1631|  30.4k|                                                  ts->tiling.col_end, ts->tiling.row_end,
 1632|  30.4k|                                                  0, dst, f->cur.stride[0], top_sb_edge,
 1633|  30.4k|                                                  m, &angle, bw4, bh4, 0, tl_edge
 1634|  30.4k|                                                  HIGHBD_CALL_SUFFIX);
 1635|  30.4k|            dsp->ipred.intra_pred[m](tmp, 4 * bw4 * sizeof(pixel),
 1636|  30.4k|                                     tl_edge, bw4 * 4, bh4 * 4, 0, 0, 0
 1637|  30.4k|                                     HIGHBD_CALL_SUFFIX);
 1638|  30.4k|            dsp->mc.blend(dst, f->cur.stride[0], tmp,
 1639|  30.4k|                          bw4 * 4, bh4 * 4, II_MASK(0, bs, b));
  ------------------
  |  |   83|  30.4k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   84|  30.4k|    (size_t)((b)->interintra_type == INTER_INTRA_BLEND ? \
  |  |  ------------------
  |  |  |  Branch (84:14): [True: 22.7k, False: 7.73k]
  |  |  ------------------
  |  |   85|  30.4k|    dav1d_masks.offsets[c][(bs)-BS_32x32].ii[(b)->interintra_mode] : \
  |  |   86|  30.4k|    dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
  ------------------
 1640|  30.4k|        }
 1641|       |
 1642|   380k|        if (!has_chroma) goto skip_inter_chroma_pred;
  ------------------
  |  Branch (1642:13): [True: 161k, False: 219k]
  ------------------
 1643|       |
 1644|       |        // sub8x8 derivation
 1645|   219k|        int is_sub8x8 = bw4 == ss_hor || bh4 == ss_ver;
  ------------------
  |  Branch (1645:25): [True: 10.4k, False: 208k]
  |  Branch (1645:42): [True: 5.26k, False: 203k]
  ------------------
 1646|   219k|        refmvs_block *const *r;
 1647|   219k|        if (is_sub8x8) {
  ------------------
  |  Branch (1647:13): [True: 15.7k, False: 203k]
  ------------------
 1648|  15.7k|            assert(ss_hor == 1);
  ------------------
  |  Branch (1648:13): [True: 15.7k, False: 0]
  ------------------
 1649|  15.7k|            r = &t->rt.r[(t->by & 31) + 5];
 1650|  15.7k|            if (bw4 == 1) is_sub8x8 &= r[0][t->bx - 1].ref.ref[0] > 0;
  ------------------
  |  Branch (1650:17): [True: 10.4k, False: 5.26k]
  ------------------
 1651|  15.7k|            if (bh4 == ss_ver) is_sub8x8 &= r[-1][t->bx].ref.ref[0] > 0;
  ------------------
  |  Branch (1651:17): [True: 11.6k, False: 4.05k]
  ------------------
 1652|  15.7k|            if (bw4 == 1 && bh4 == ss_ver)
  ------------------
  |  Branch (1652:17): [True: 10.4k, False: 5.26k]
  |  Branch (1652:29): [True: 6.40k, False: 4.05k]
  ------------------
 1653|  6.40k|                is_sub8x8 &= r[-1][t->bx - 1].ref.ref[0] > 0;
 1654|  15.7k|        }
 1655|       |
 1656|       |        // chroma prediction
 1657|   219k|        if (is_sub8x8) {
  ------------------
  |  Branch (1657:13): [True: 12.9k, False: 206k]
  ------------------
 1658|  12.9k|            assert(ss_hor == 1);
  ------------------
  |  Branch (1658:13): [True: 12.9k, False: 0]
  ------------------
 1659|  12.9k|            ptrdiff_t h_off = 0, v_off = 0;
 1660|  12.9k|            if (bw4 == 1 && bh4 == ss_ver) {
  ------------------
  |  Branch (1660:17): [True: 8.64k, False: 4.33k]
  |  Branch (1660:29): [True: 5.15k, False: 3.49k]
  ------------------
 1661|  15.4k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1661:34): [True: 10.3k, False: 5.15k]
  ------------------
 1662|  10.3k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1663|  10.3k|                             NULL, f->cur.stride[1],
 1664|  10.3k|                             bw4, bh4, t->bx - 1, t->by - 1, 1 + pl,
 1665|  10.3k|                             r[-1][t->bx - 1].mv.mv[0],
 1666|  10.3k|                             &f->refp[r[-1][t->bx - 1].ref.ref[0] - 1],
 1667|  10.3k|                             r[-1][t->bx - 1].ref.ref[0] - 1,
 1668|  10.3k|                             t->frame_thread.pass != 2 ? t->tl_4x4_filter :
  ------------------
  |  Branch (1668:30): [True: 10.3k, False: 0]
  ------------------
 1669|  10.3k|                                 f->frame_thread.b[((t->by - 1) * f->b4_stride) + t->bx - 1].filter2d);
 1670|  10.3k|                    if (res) return res;
  ------------------
  |  Branch (1670:25): [True: 0, False: 10.3k]
  ------------------
 1671|  10.3k|                }
 1672|  5.15k|                v_off = 2 * PXSTRIDE(f->cur.stride[1]);
  ------------------
  |  |   53|  5.15k|#define PXSTRIDE(x) (x)
  ------------------
 1673|  5.15k|                h_off = 2;
 1674|  5.15k|            }
 1675|  12.9k|            if (bw4 == 1) {
  ------------------
  |  Branch (1675:17): [True: 8.64k, False: 4.33k]
  ------------------
 1676|  8.64k|                const enum Filter2d left_filter_2d =
 1677|  8.64k|                    dav1d_filter_2d[t->l.filter[1][by4]][t->l.filter[0][by4]];
 1678|  25.9k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1678:34): [True: 17.2k, False: 8.64k]
  ------------------
 1679|  17.2k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + v_off, NULL,
 1680|  17.2k|                             f->cur.stride[1], bw4, bh4, t->bx - 1,
 1681|  17.2k|                             t->by, 1 + pl, r[0][t->bx - 1].mv.mv[0],
 1682|  17.2k|                             &f->refp[r[0][t->bx - 1].ref.ref[0] - 1],
 1683|  17.2k|                             r[0][t->bx - 1].ref.ref[0] - 1,
 1684|  17.2k|                             t->frame_thread.pass != 2 ? left_filter_2d :
  ------------------
  |  Branch (1684:30): [True: 17.2k, False: 0]
  ------------------
 1685|  17.2k|                                 f->frame_thread.b[(t->by * f->b4_stride) + t->bx - 1].filter2d);
 1686|  17.2k|                    if (res) return res;
  ------------------
  |  Branch (1686:25): [True: 0, False: 17.2k]
  ------------------
 1687|  17.2k|                }
 1688|  8.64k|                h_off = 2;
 1689|  8.64k|            }
 1690|  12.9k|            if (bh4 == ss_ver) {
  ------------------
  |  Branch (1690:17): [True: 9.48k, False: 3.49k]
  ------------------
 1691|  9.48k|                const enum Filter2d top_filter_2d =
 1692|  9.48k|                    dav1d_filter_2d[t->a->filter[1][bx4]][t->a->filter[0][bx4]];
 1693|  28.4k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1693:34): [True: 18.9k, False: 9.48k]
  ------------------
 1694|  18.9k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + h_off, NULL,
 1695|  18.9k|                             f->cur.stride[1], bw4, bh4, t->bx, t->by - 1,
 1696|  18.9k|                             1 + pl, r[-1][t->bx].mv.mv[0],
 1697|  18.9k|                             &f->refp[r[-1][t->bx].ref.ref[0] - 1],
 1698|  18.9k|                             r[-1][t->bx].ref.ref[0] - 1,
 1699|  18.9k|                             t->frame_thread.pass != 2 ? top_filter_2d :
  ------------------
  |  Branch (1699:30): [True: 18.9k, False: 0]
  ------------------
 1700|  18.9k|                                 f->frame_thread.b[((t->by - 1) * f->b4_stride) + t->bx].filter2d);
 1701|  18.9k|                    if (res) return res;
  ------------------
  |  Branch (1701:25): [True: 0, False: 18.9k]
  ------------------
 1702|  18.9k|                }
 1703|  9.48k|                v_off = 2 * PXSTRIDE(f->cur.stride[1]);
  ------------------
  |  |   53|  9.48k|#define PXSTRIDE(x) (x)
  ------------------
 1704|  9.48k|            }
 1705|  38.9k|            for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1705:30): [True: 25.9k, False: 12.9k]
  ------------------
 1706|  25.9k|                res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + h_off + v_off, NULL, f->cur.stride[1],
 1707|  25.9k|                         bw4, bh4, t->bx, t->by, 1 + pl, b->mv[0],
 1708|  25.9k|                         refp, b->ref[0], filter_2d);
 1709|  25.9k|                if (res) return res;
  ------------------
  |  Branch (1709:21): [True: 0, False: 25.9k]
  ------------------
 1710|  25.9k|            }
 1711|   206k|        } else {
 1712|   206k|            if (imin(cbw4, cbh4) > 1 &&
  ------------------
  |  Branch (1712:17): [True: 97.1k, False: 108k]
  ------------------
 1713|  97.1k|                ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (1713:19): [True: 27.9k, False: 69.1k]
  |  Branch (1713:48): [True: 962, False: 26.9k]
  ------------------
 1714|  96.1k|                 (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (1714:19): [True: 9.56k, False: 86.6k]
  |  Branch (1714:48): [True: 8.69k, False: 876]
  ------------------
 1715|  9.65k|            {
 1716|  28.9k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1716:34): [True: 19.3k, False: 9.65k]
  ------------------
 1717|  19.3k|                    res = warp_affine(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff, NULL,
 1718|  19.3k|                                      f->cur.stride[1], b_dim, 1 + pl, refp,
 1719|  19.3k|                                      b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (1719:39): [True: 17.3k, False: 1.92k]
  ------------------
 1720|  19.3k|                                          &f->frame_hdr->gmv[b->ref[0]]);
 1721|  19.3k|                    if (res) return res;
  ------------------
  |  Branch (1721:25): [True: 0, False: 19.3k]
  ------------------
 1722|  19.3k|                }
 1723|   196k|            } else {
 1724|   589k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1724:34): [True: 392k, False: 196k]
  ------------------
 1725|   392k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1726|   392k|                             NULL, f->cur.stride[1],
 1727|   392k|                             bw4 << (bw4 == ss_hor), bh4 << (bh4 == ss_ver),
 1728|   392k|                             t->bx & ~ss_hor, t->by & ~ss_ver,
 1729|   392k|                             1 + pl, b->mv[0], refp, b->ref[0], filter_2d);
 1730|   392k|                    if (res) return res;
  ------------------
  |  Branch (1730:25): [True: 0, False: 392k]
  ------------------
 1731|   392k|                    if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (1731:25): [True: 119k, False: 273k]
  ------------------
 1732|   119k|                        res = obmc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1733|   119k|                                   f->cur.stride[1], b_dim, 1 + pl, bx4, by4, w4, h4);
 1734|   119k|                        if (res) return res;
  ------------------
  |  Branch (1734:29): [True: 0, False: 119k]
  ------------------
 1735|   119k|                    }
 1736|   392k|                }
 1737|   196k|            }
 1738|   206k|            if (b->interintra_type) {
  ------------------
  |  Branch (1738:17): [True: 26.9k, False: 179k]
  ------------------
 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|  26.9k|                const uint8_t *const ii_mask = II_MASK(chr_layout_idx, bs, b);
  ------------------
  |  |   83|  26.9k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   84|  26.9k|    (size_t)((b)->interintra_type == INTER_INTRA_BLEND ? \
  |  |  ------------------
  |  |  |  Branch (84:14): [True: 19.9k, False: 7.03k]
  |  |  ------------------
  |  |   85|  26.9k|    dav1d_masks.offsets[c][(bs)-BS_32x32].ii[(b)->interintra_mode] : \
  |  |   86|  26.9k|    dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
  ------------------
 1743|       |
 1744|  80.8k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1744:34): [True: 53.9k, False: 26.9k]
  ------------------
 1745|  53.9k|                    pixel *const tmp = bitfn(t->scratch.interintra);
  ------------------
  |  |   51|  53.9k|#define bitfn(x) x##_8bpc
  ------------------
 1746|  53.9k|                    pixel *const tl_edge = bitfn(t->scratch.edge) + 32;
  ------------------
  |  |   51|  53.9k|#define bitfn(x) x##_8bpc
  ------------------
 1747|  53.9k|                    enum IntraPredMode m =
 1748|  53.9k|                        b->interintra_mode == II_SMOOTH_PRED ?
  ------------------
  |  Branch (1748:25): [True: 10.7k, False: 43.1k]
  ------------------
 1749|  43.1k|                        SMOOTH_PRED : b->interintra_mode;
 1750|  53.9k|                    int angle = 0;
 1751|  53.9k|                    pixel *const uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff;
 1752|  53.9k|                    const pixel *top_sb_edge = NULL;
 1753|  53.9k|                    if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1753:25): [True: 6.03k, False: 47.8k]
  ------------------
 1754|  6.03k|                        top_sb_edge = f->ipred_edge[pl + 1];
 1755|  6.03k|                        const int sby = t->by >> f->sb_shift;
 1756|  6.03k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1757|  6.03k|                    }
 1758|  53.9k|                    m = bytefn(dav1d_prepare_intra_edges)(t->bx >> ss_hor,
  ------------------
  |  |   87|  53.9k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  53.9k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 1759|  53.9k|                                                          (t->bx >> ss_hor) >
 1760|  53.9k|                                                              (ts->tiling.col_start >> ss_hor),
 1761|  53.9k|                                                          t->by >> ss_ver,
 1762|  53.9k|                                                          (t->by >> ss_ver) >
 1763|  53.9k|                                                              (ts->tiling.row_start >> ss_ver),
 1764|  53.9k|                                                          ts->tiling.col_end >> ss_hor,
 1765|  53.9k|                                                          ts->tiling.row_end >> ss_ver,
 1766|  53.9k|                                                          0, uvdst, f->cur.stride[1],
 1767|  53.9k|                                                          top_sb_edge, m,
 1768|  53.9k|                                                          &angle, cbw4, cbh4, 0, tl_edge
 1769|  53.9k|                                                          HIGHBD_CALL_SUFFIX);
 1770|  53.9k|                    dsp->ipred.intra_pred[m](tmp, cbw4 * 4 * sizeof(pixel),
 1771|  53.9k|                                             tl_edge, cbw4 * 4, cbh4 * 4, 0, 0, 0
 1772|  53.9k|                                             HIGHBD_CALL_SUFFIX);
 1773|  53.9k|                    dsp->mc.blend(uvdst, f->cur.stride[1], tmp,
 1774|  53.9k|                                  cbw4 * 4, cbh4 * 4, ii_mask);
 1775|  53.9k|                }
 1776|  26.9k|            }
 1777|   206k|        }
 1778|       |
 1779|   380k|    skip_inter_chroma_pred: {}
 1780|   380k|        t->tl_4x4_filter = filter_2d;
 1781|   380k|    } else {
 1782|  70.2k|        const enum Filter2d filter_2d = b->filter2d;
 1783|       |        // Maximum super block size is 128x128
 1784|  70.2k|        int16_t (*tmp)[128 * 128] = t->scratch.compinter;
 1785|  70.2k|        int jnt_weight;
 1786|  70.2k|        uint8_t *const seg_mask = t->scratch.seg_mask;
 1787|  70.2k|        const uint8_t *mask;
 1788|       |
 1789|   210k|        for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1789:25): [True: 140k, False: 70.2k]
  ------------------
 1790|   140k|            const Dav1dThreadPicture *const refp = &f->refp[b->ref[i]];
 1791|       |
 1792|   140k|            if (b->inter_mode == GLOBALMV_GLOBALMV && f->gmv_warp_allowed[b->ref[i]]) {
  ------------------
  |  Branch (1792:17): [True: 11.6k, False: 128k]
  |  Branch (1792:55): [True: 785, False: 10.8k]
  ------------------
 1793|    785|                res = warp_affine(t, NULL, tmp[i], bw4 * 4, b_dim, 0, refp,
 1794|    785|                                  &f->frame_hdr->gmv[b->ref[i]]);
 1795|    785|                if (res) return res;
  ------------------
  |  Branch (1795:21): [True: 0, False: 785]
  ------------------
 1796|   139k|            } else {
 1797|   139k|                res = mc(t, NULL, tmp[i], 0, bw4, bh4, t->bx, t->by, 0,
 1798|   139k|                         b->mv[i], refp, b->ref[i], filter_2d);
 1799|   139k|                if (res) return res;
  ------------------
  |  Branch (1799:21): [True: 0, False: 139k]
  ------------------
 1800|   139k|            }
 1801|   140k|        }
 1802|  70.2k|        switch (b->comp_type) {
  ------------------
  |  Branch (1802:17): [True: 70.2k, False: 0]
  ------------------
 1803|  40.0k|        case COMP_INTER_AVG:
  ------------------
  |  Branch (1803:9): [True: 40.0k, False: 30.1k]
  ------------------
 1804|  40.0k|            dsp->mc.avg(dst, f->cur.stride[0], tmp[0], tmp[1],
 1805|  40.0k|                        bw4 * 4, bh4 * 4 HIGHBD_CALL_SUFFIX);
 1806|  40.0k|            break;
 1807|  10.0k|        case COMP_INTER_WEIGHTED_AVG:
  ------------------
  |  Branch (1807:9): [True: 10.0k, False: 60.2k]
  ------------------
 1808|  10.0k|            jnt_weight = f->jnt_weights[b->ref[0]][b->ref[1]];
 1809|  10.0k|            dsp->mc.w_avg(dst, f->cur.stride[0], tmp[0], tmp[1],
 1810|  10.0k|                          bw4 * 4, bh4 * 4, jnt_weight HIGHBD_CALL_SUFFIX);
 1811|  10.0k|            break;
 1812|  14.9k|        case COMP_INTER_SEG:
  ------------------
  |  Branch (1812:9): [True: 14.9k, False: 55.3k]
  ------------------
 1813|  14.9k|            dsp->mc.w_mask[chr_layout_idx](dst, f->cur.stride[0],
 1814|  14.9k|                                           tmp[b->mask_sign], tmp[!b->mask_sign],
 1815|  14.9k|                                           bw4 * 4, bh4 * 4, seg_mask,
 1816|  14.9k|                                           b->mask_sign HIGHBD_CALL_SUFFIX);
 1817|  14.9k|            mask = seg_mask;
 1818|  14.9k|            break;
 1819|  5.21k|        case COMP_INTER_WEDGE:
  ------------------
  |  Branch (1819:9): [True: 5.21k, False: 65.0k]
  ------------------
 1820|  5.21k|            mask = WEDGE_MASK(0, bs, 0, b->wedge_idx);
  ------------------
  |  |   89|  5.21k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   90|  5.21k|    (size_t)dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
  ------------------
 1821|  5.21k|            dsp->mc.mask(dst, f->cur.stride[0],
 1822|  5.21k|                         tmp[b->mask_sign], tmp[!b->mask_sign],
 1823|  5.21k|                         bw4 * 4, bh4 * 4, mask HIGHBD_CALL_SUFFIX);
 1824|  5.21k|            if (has_chroma)
  ------------------
  |  Branch (1824:17): [True: 3.37k, False: 1.84k]
  ------------------
 1825|  3.37k|                mask = WEDGE_MASK(chr_layout_idx, bs, b->mask_sign, b->wedge_idx);
  ------------------
  |  |   89|  3.37k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   90|  3.37k|    (size_t)dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
  ------------------
 1826|  5.21k|            break;
 1827|  70.2k|        }
 1828|       |
 1829|       |        // chroma
 1830|   141k|        if (has_chroma) for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1830:13): [True: 47.2k, False: 23.0k]
  |  Branch (1830:42): [True: 94.4k, False: 47.2k]
  ------------------
 1831|   283k|            for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1831:29): [True: 188k, False: 94.4k]
  ------------------
 1832|   188k|                const Dav1dThreadPicture *const refp = &f->refp[b->ref[i]];
 1833|   188k|                if (b->inter_mode == GLOBALMV_GLOBALMV &&
  ------------------
  |  Branch (1833:21): [True: 16.7k, False: 172k]
  ------------------
 1834|  16.7k|                    imin(cbw4, cbh4) > 1 && f->gmv_warp_allowed[b->ref[i]])
  ------------------
  |  Branch (1834:21): [True: 13.9k, False: 2.77k]
  |  Branch (1834:45): [True: 1.15k, False: 12.8k]
  ------------------
 1835|  1.15k|                {
 1836|  1.15k|                    res = warp_affine(t, NULL, tmp[i], bw4 * 4 >> ss_hor,
 1837|  1.15k|                                      b_dim, 1 + pl,
 1838|  1.15k|                                      refp, &f->frame_hdr->gmv[b->ref[i]]);
 1839|  1.15k|                    if (res) return res;
  ------------------
  |  Branch (1839:25): [True: 0, False: 1.15k]
  ------------------
 1840|   187k|                } else {
 1841|   187k|                    res = mc(t, NULL, tmp[i], 0, bw4, bh4, t->bx, t->by,
 1842|   187k|                             1 + pl, b->mv[i], refp, b->ref[i], filter_2d);
 1843|   187k|                    if (res) return res;
  ------------------
  |  Branch (1843:25): [True: 0, False: 187k]
  ------------------
 1844|   187k|                }
 1845|   188k|            }
 1846|  94.4k|            pixel *const uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff;
 1847|  94.4k|            switch (b->comp_type) {
  ------------------
  |  Branch (1847:21): [True: 94.4k, False: 0]
  ------------------
 1848|  49.4k|            case COMP_INTER_AVG:
  ------------------
  |  Branch (1848:13): [True: 49.4k, False: 45.0k]
  ------------------
 1849|  49.4k|                dsp->mc.avg(uvdst, f->cur.stride[1], tmp[0], tmp[1],
 1850|  49.4k|                            bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver
 1851|  49.4k|                            HIGHBD_CALL_SUFFIX);
 1852|  49.4k|                break;
 1853|  18.0k|            case COMP_INTER_WEIGHTED_AVG:
  ------------------
  |  Branch (1853:13): [True: 18.0k, False: 76.3k]
  ------------------
 1854|  18.0k|                dsp->mc.w_avg(uvdst, f->cur.stride[1], tmp[0], tmp[1],
 1855|  18.0k|                              bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver, jnt_weight
 1856|  18.0k|                              HIGHBD_CALL_SUFFIX);
 1857|  18.0k|                break;
 1858|  6.75k|            case COMP_INTER_WEDGE:
  ------------------
  |  Branch (1858:13): [True: 6.75k, False: 87.7k]
  ------------------
 1859|  26.9k|            case COMP_INTER_SEG:
  ------------------
  |  Branch (1859:13): [True: 20.1k, False: 74.2k]
  ------------------
 1860|  26.9k|                dsp->mc.mask(uvdst, f->cur.stride[1],
 1861|  26.9k|                             tmp[b->mask_sign], tmp[!b->mask_sign],
 1862|  26.9k|                             bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver, mask
 1863|  26.9k|                             HIGHBD_CALL_SUFFIX);
 1864|  26.9k|                break;
 1865|  94.4k|            }
 1866|  94.4k|        }
 1867|  70.2k|    }
 1868|       |
 1869|   625k|    if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|   625k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 625k]
  |  |  ------------------
  |  |   35|   625k|        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|   625k|        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|   625k|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
 1880|       |
 1881|   625k|    if (b->skip) {
  ------------------
  |  Branch (1881:9): [True: 372k, False: 252k]
  ------------------
 1882|       |        // reset coef contexts
 1883|   372k|        BlockContext *const a = t->a;
 1884|   372k|        dav1d_memset_pow2[b_dim[2]](&a->lcoef[bx4], 0x40);
 1885|   372k|        dav1d_memset_pow2[b_dim[3]](&t->l.lcoef[by4], 0x40);
 1886|   372k|        if (has_chroma) {
  ------------------
  |  Branch (1886:13): [True: 206k, False: 166k]
  ------------------
 1887|   206k|            dav1d_memset_pow2_fn memset_cw = dav1d_memset_pow2[ulog2(cbw4)];
 1888|   206k|            dav1d_memset_pow2_fn memset_ch = dav1d_memset_pow2[ulog2(cbh4)];
 1889|   206k|            memset_cw(&a->ccoef[0][cbx4], 0x40);
 1890|   206k|            memset_cw(&a->ccoef[1][cbx4], 0x40);
 1891|   206k|            memset_ch(&t->l.ccoef[0][cby4], 0x40);
 1892|   206k|            memset_ch(&t->l.ccoef[1][cby4], 0x40);
 1893|   206k|        }
 1894|   372k|        return 0;
 1895|   372k|    }
 1896|       |
 1897|   252k|    const TxfmInfo *const uvtx = &dav1d_txfm_dimensions[b->uvtx];
 1898|   252k|    const TxfmInfo *const ytx = &dav1d_txfm_dimensions[b->max_ytx];
 1899|   252k|    const uint16_t tx_split[2] = { b->tx_split0, b->tx_split1 };
 1900|       |
 1901|   507k|    for (int init_y = 0; init_y < bh4; init_y += 16) {
  ------------------
  |  Branch (1901:26): [True: 255k, False: 252k]
  ------------------
 1902|   515k|        for (int init_x = 0; init_x < bw4; init_x += 16) {
  ------------------
  |  Branch (1902:30): [True: 260k, False: 255k]
  ------------------
 1903|       |            // coefficient coding & inverse transforms
 1904|   260k|            int y_off = !!init_y, y;
 1905|   260k|            dst += PXSTRIDE(f->cur.stride[0]) * 4 * init_y;
  ------------------
  |  |   53|   260k|#define PXSTRIDE(x) (x)
  ------------------
 1906|   567k|            for (y = init_y, t->by += init_y; y < imin(h4, init_y + 16);
  ------------------
  |  Branch (1906:47): [True: 306k, False: 260k]
  ------------------
 1907|   306k|                 y += ytx->h, y_off++)
 1908|   306k|            {
 1909|   306k|                int x, x_off = !!init_x;
 1910|   892k|                for (x = init_x, t->bx += init_x; x < imin(w4, init_x + 16);
  ------------------
  |  Branch (1910:51): [True: 586k, False: 306k]
  ------------------
 1911|   586k|                     x += ytx->w, x_off++)
 1912|   586k|                {
 1913|   586k|                    read_coef_tree(t, bs, b, b->max_ytx, 0, tx_split,
 1914|   586k|                                   x_off, y_off, &dst[x * 4]);
 1915|   586k|                    t->bx += ytx->w;
 1916|   586k|                }
 1917|   306k|                dst += PXSTRIDE(f->cur.stride[0]) * 4 * ytx->h;
  ------------------
  |  |   53|   306k|#define PXSTRIDE(x) (x)
  ------------------
 1918|   306k|                t->bx -= x;
 1919|   306k|                t->by += ytx->h;
 1920|   306k|            }
 1921|   260k|            dst -= PXSTRIDE(f->cur.stride[0]) * 4 * y;
  ------------------
  |  |   53|   260k|#define PXSTRIDE(x) (x)
  ------------------
 1922|   260k|            t->by -= y;
 1923|       |
 1924|       |            // chroma coefs and inverse transform
 1925|   578k|            if (has_chroma) for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1925:17): [True: 192k, False: 67.8k]
  |  Branch (1925:46): [True: 385k, False: 192k]
  ------------------
 1926|   385k|                pixel *uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff +
 1927|   385k|                    (PXSTRIDE(f->cur.stride[1]) * init_y * 4 >> ss_ver);
  ------------------
  |  |   53|   385k|#define PXSTRIDE(x) (x)
  ------------------
 1928|   385k|                for (y = init_y >> ss_ver, t->by += init_y;
 1929|   813k|                     y < imin(ch4, (init_y + 16) >> ss_ver); y += uvtx->h)
  ------------------
  |  Branch (1929:22): [True: 428k, False: 385k]
  ------------------
 1930|   428k|                {
 1931|   428k|                    int x;
 1932|   428k|                    for (x = init_x >> ss_hor, t->bx += init_x;
 1933|  1.00M|                         x < imin(cw4, (init_x + 16) >> ss_hor); x += uvtx->w)
  ------------------
  |  Branch (1933:26): [True: 581k, False: 428k]
  ------------------
 1934|   581k|                    {
 1935|   581k|                        coef *cf;
 1936|   581k|                        int eob;
 1937|   581k|                        enum TxfmType txtp;
 1938|   581k|                        if (t->frame_thread.pass) {
  ------------------
  |  Branch (1938:29): [True: 0, False: 581k]
  ------------------
 1939|      0|                            const int p = t->frame_thread.pass & 1;
 1940|      0|                            const int cbi = *ts->frame_thread[p].cbi++;
 1941|      0|                            cf = ts->frame_thread[p].cf;
 1942|      0|                            ts->frame_thread[p].cf += uvtx->w * uvtx->h * 16;
 1943|      0|                            eob  = cbi >> 5;
 1944|      0|                            txtp = cbi & 0x1f;
 1945|   581k|                        } else {
 1946|   581k|                            uint8_t cf_ctx;
 1947|   581k|                            cf = bitfn(t->cf);
  ------------------
  |  |   51|   581k|#define bitfn(x) x##_8bpc
  ------------------
 1948|   581k|                            txtp = t->scratch.txtp_map[(by4 + (y << ss_ver)) * 32 +
 1949|   581k|                                                        bx4 + (x << ss_hor)];
 1950|   581k|                            eob = decode_coefs(t, &t->a->ccoef[pl][cbx4 + x],
 1951|   581k|                                               &t->l.ccoef[pl][cby4 + y],
 1952|   581k|                                               b->uvtx, bs, b, 0, 1 + pl,
 1953|   581k|                                               cf, &txtp, &cf_ctx);
 1954|   581k|                            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   581k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 581k]
  |  |  ------------------
  |  |   35|   581k|        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|   581k|        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|   581k|                            int ctw = imin(uvtx->w, (f->bw - t->bx + ss_hor) >> ss_hor);
 1959|   581k|                            int cth = imin(uvtx->h, (f->bh - t->by + ss_ver) >> ss_ver);
 1960|   581k|                            dav1d_memset_likely_pow2(&t->a->ccoef[pl][cbx4 + x], cf_ctx, ctw);
 1961|   581k|                            dav1d_memset_likely_pow2(&t->l.ccoef[pl][cby4 + y], cf_ctx, cth);
 1962|   581k|                        }
 1963|   581k|                        if (eob >= 0) {
  ------------------
  |  Branch (1963:29): [True: 196k, False: 385k]
  ------------------
 1964|   196k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   196k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 196k]
  |  |  ------------------
  |  |   35|   196k|        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|   196k|        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|   196k|                            dsp->itx.itxfm_add[b->uvtx]
 1967|   196k|                                              [txtp](&uvdst[4 * x],
 1968|   196k|                                                     f->cur.stride[1],
 1969|   196k|                                                     cf, eob HIGHBD_CALL_SUFFIX);
 1970|   196k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   196k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 196k]
  |  |  ------------------
  |  |   35|   196k|        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|   196k|        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|   196k|                        }
 1974|   581k|                        t->bx += uvtx->w << ss_hor;
 1975|   581k|                    }
 1976|   428k|                    uvdst += PXSTRIDE(f->cur.stride[1]) * 4 * uvtx->h;
  ------------------
  |  |   53|   428k|#define PXSTRIDE(x) (x)
  ------------------
 1977|   428k|                    t->bx -= x << ss_hor;
 1978|   428k|                    t->by += uvtx->h << ss_ver;
 1979|   428k|                }
 1980|   385k|                t->by -= y << ss_ver;
 1981|   385k|            }
 1982|   260k|        }
 1983|   255k|    }
 1984|   252k|    return 0;
 1985|   625k|}
dav1d_filter_sbrow_deblock_cols_8bpc:
 1987|  87.5k|void bytefn(dav1d_filter_sbrow_deblock_cols)(Dav1dFrameContext *const f, const int sby) {
 1988|  87.5k|    if (!(f->c->inloop_filters & DAV1D_INLOOPFILTER_DEBLOCK) ||
  ------------------
  |  Branch (1988:9): [True: 0, False: 87.5k]
  ------------------
 1989|  87.5k|        (!f->frame_hdr->loopfilter.level_y[0] && !f->frame_hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (1989:10): [True: 56.5k, False: 30.9k]
  |  Branch (1989:50): [True: 48.8k, False: 7.73k]
  ------------------
 1990|  48.8k|    {
 1991|  48.8k|        return;
 1992|  48.8k|    }
 1993|  38.7k|    const int y = sby * f->sb_step * 4;
 1994|  38.7k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1995|  38.7k|    pixel *const p[3] = {
 1996|  38.7k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|  38.7k|#define PXSTRIDE(x) (x)
  ------------------
 1997|  38.7k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  38.7k|#define PXSTRIDE(x) (x)
  ------------------
 1998|  38.7k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
  ------------------
  |  |   53|  38.7k|#define PXSTRIDE(x) (x)
  ------------------
 1999|  38.7k|    };
 2000|  38.7k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2001|  38.7k|    bytefn(dav1d_loopfilter_sbrow_cols)(f, p, mask, sby,
  ------------------
  |  |   87|  38.7k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  38.7k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2002|  38.7k|                                        f->lf.start_of_tile_row[sby]);
 2003|  38.7k|}
dav1d_filter_sbrow_deblock_rows_8bpc:
 2005|  87.5k|void bytefn(dav1d_filter_sbrow_deblock_rows)(Dav1dFrameContext *const f, const int sby) {
 2006|  87.5k|    const int y = sby * f->sb_step * 4;
 2007|  87.5k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2008|  87.5k|    pixel *const p[3] = {
 2009|  87.5k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|  87.5k|#define PXSTRIDE(x) (x)
  ------------------
 2010|  87.5k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  87.5k|#define PXSTRIDE(x) (x)
  ------------------
 2011|  87.5k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
  ------------------
  |  |   53|  87.5k|#define PXSTRIDE(x) (x)
  ------------------
 2012|  87.5k|    };
 2013|  87.5k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2014|  87.5k|    if (f->c->inloop_filters & DAV1D_INLOOPFILTER_DEBLOCK &&
  ------------------
  |  Branch (2014:9): [True: 87.5k, False: 0]
  ------------------
 2015|  87.5k|        (f->frame_hdr->loopfilter.level_y[0] || f->frame_hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (2015:10): [True: 30.9k, False: 56.5k]
  |  Branch (2015:49): [True: 7.73k, False: 48.8k]
  ------------------
 2016|  38.7k|    {
 2017|  38.7k|        bytefn(dav1d_loopfilter_sbrow_rows)(f, p, mask, sby);
  ------------------
  |  |   87|  38.7k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  38.7k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2018|  38.7k|    }
 2019|  87.5k|    if (f->lf.cdef_planes || f->lf.restore_planes) {
  ------------------
  |  Branch (2019:9): [True: 19.5k, False: 68.0k]
  |  Branch (2019:30): [True: 13.5k, False: 54.4k]
  ------------------
 2020|       |        // Store loop filtered pixels required by CDEF / LR
 2021|  33.0k|        bytefn(dav1d_copy_lpf)(f, p, sby);
  ------------------
  |  |   87|  33.0k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  33.0k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2022|  33.0k|    }
 2023|  87.5k|}
dav1d_filter_sbrow_cdef_8bpc:
 2025|  19.5k|void bytefn(dav1d_filter_sbrow_cdef)(Dav1dTaskContext *const tc, const int sby) {
 2026|  19.5k|    const Dav1dFrameContext *const f = tc->f;
 2027|  19.5k|    const int sbsz = f->sb_step;
 2028|  19.5k|    const int y = sby * sbsz * 4;
 2029|  19.5k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2030|  19.5k|    pixel *const p[3] = {
 2031|  19.5k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|  19.5k|#define PXSTRIDE(x) (x)
  ------------------
 2032|  19.5k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  19.5k|#define PXSTRIDE(x) (x)
  ------------------
 2033|  19.5k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
  ------------------
  |  |   53|  19.5k|#define PXSTRIDE(x) (x)
  ------------------
 2034|  19.5k|    };
 2035|  19.5k|    Av1Filter *prev_mask = f->lf.mask + ((sby - 1) >> !f->seq_hdr->sb128) * f->sb128w;
 2036|  19.5k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2037|  19.5k|    const int start = sby * sbsz;
 2038|  19.5k|    if (sby) {
  ------------------
  |  Branch (2038:9): [True: 18.9k, False: 624]
  ------------------
 2039|  18.9k|        const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2040|  18.9k|        pixel *p_up[3] = {
 2041|  18.9k|            p[0] - 8 * PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|  18.9k|#define PXSTRIDE(x) (x)
  ------------------
 2042|  18.9k|            p[1] - (8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  18.9k|#define PXSTRIDE(x) (x)
  ------------------
 2043|  18.9k|            p[2] - (8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  18.9k|#define PXSTRIDE(x) (x)
  ------------------
 2044|  18.9k|        };
 2045|  18.9k|        bytefn(dav1d_cdef_brow)(tc, p_up, prev_mask, start - 2, start, 1, sby);
  ------------------
  |  |   87|  18.9k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  18.9k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2046|  18.9k|    }
 2047|  19.5k|    const int n_blks = sbsz - 2 * (sby + 1 < f->sbh);
 2048|  19.5k|    const int end = imin(start + n_blks, f->bh);
 2049|  19.5k|    bytefn(dav1d_cdef_brow)(tc, p, mask, start, end, 0, sby);
  ------------------
  |  |   87|  19.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  19.5k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2050|  19.5k|}
dav1d_filter_sbrow_resize_8bpc:
 2052|  9.36k|void bytefn(dav1d_filter_sbrow_resize)(Dav1dFrameContext *const f, const int sby) {
 2053|  9.36k|    const int sbsz = f->sb_step;
 2054|  9.36k|    const int y = sby * sbsz * 4;
 2055|  9.36k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2056|  9.36k|    const pixel *const p[3] = {
 2057|  9.36k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
  ------------------
  |  |   53|  9.36k|#define PXSTRIDE(x) (x)
  ------------------
 2058|  9.36k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  9.36k|#define PXSTRIDE(x) (x)
  ------------------
 2059|  9.36k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
  ------------------
  |  |   53|  9.36k|#define PXSTRIDE(x) (x)
  ------------------
 2060|  9.36k|    };
 2061|  9.36k|    pixel *const sr_p[3] = {
 2062|  9.36k|        f->lf.sr_p[0] + y * PXSTRIDE(f->sr_cur.p.stride[0]),
  ------------------
  |  |   53|  9.36k|#define PXSTRIDE(x) (x)
  ------------------
 2063|  9.36k|        f->lf.sr_p[1] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  9.36k|#define PXSTRIDE(x) (x)
  ------------------
 2064|  9.36k|        f->lf.sr_p[2] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver)
  ------------------
  |  |   53|  9.36k|#define PXSTRIDE(x) (x)
  ------------------
 2065|  9.36k|    };
 2066|  9.36k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400;
 2067|  33.9k|    for (int pl = 0; pl < 1 + 2 * has_chroma; pl++) {
  ------------------
  |  Branch (2067:22): [True: 24.5k, False: 9.36k]
  ------------------
 2068|  24.5k|        const int ss_ver = pl && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (2068:28): [True: 15.2k, False: 9.36k]
  |  Branch (2068:34): [True: 8.00k, False: 7.22k]
  ------------------
 2069|  24.5k|        const int h_start = 8 * !!sby >> ss_ver;
 2070|  24.5k|        const ptrdiff_t dst_stride = f->sr_cur.p.stride[!!pl];
 2071|  24.5k|        pixel *dst = sr_p[pl] - h_start * PXSTRIDE(dst_stride);
  ------------------
  |  |   53|  24.5k|#define PXSTRIDE(x) (x)
  ------------------
 2072|  24.5k|        const ptrdiff_t src_stride = f->cur.stride[!!pl];
 2073|  24.5k|        const pixel *src = p[pl] - h_start * PXSTRIDE(src_stride);
  ------------------
  |  |   53|  24.5k|#define PXSTRIDE(x) (x)
  ------------------
 2074|  24.5k|        const int h_end = 4 * (sbsz - 2 * (sby + 1 < f->sbh)) >> ss_ver;
 2075|  24.5k|        const int ss_hor = pl && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (2075:28): [True: 15.2k, False: 9.36k]
  |  Branch (2075:34): [True: 10.2k, False: 5.00k]
  ------------------
 2076|  24.5k|        const int dst_w = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
 2077|  24.5k|        const int src_w = (4 * f->bw + ss_hor) >> ss_hor;
 2078|  24.5k|        const int img_h = (f->cur.p.h - sbsz * 4 * sby + ss_ver) >> ss_ver;
 2079|       |
 2080|  24.5k|        f->dsp->mc.resize(dst, dst_stride, src, src_stride, dst_w,
 2081|  24.5k|                          imin(img_h, h_end) + h_start, src_w,
 2082|  24.5k|                          f->resize_step[!!pl], f->resize_start[!!pl]
 2083|  24.5k|                          HIGHBD_CALL_SUFFIX);
 2084|  24.5k|    }
 2085|  9.36k|}
dav1d_filter_sbrow_lr_8bpc:
 2087|  30.9k|void bytefn(dav1d_filter_sbrow_lr)(Dav1dFrameContext *const f, const int sby) {
 2088|  30.9k|    if (!(f->c->inloop_filters & DAV1D_INLOOPFILTER_RESTORATION)) return;
  ------------------
  |  Branch (2088:9): [True: 0, False: 30.9k]
  ------------------
 2089|  30.9k|    const int y = sby * f->sb_step * 4;
 2090|  30.9k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2091|  30.9k|    pixel *const sr_p[3] = {
 2092|  30.9k|        f->lf.sr_p[0] + y * PXSTRIDE(f->sr_cur.p.stride[0]),
  ------------------
  |  |   53|  30.9k|#define PXSTRIDE(x) (x)
  ------------------
 2093|  30.9k|        f->lf.sr_p[1] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver),
  ------------------
  |  |   53|  30.9k|#define PXSTRIDE(x) (x)
  ------------------
 2094|  30.9k|        f->lf.sr_p[2] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver)
  ------------------
  |  |   53|  30.9k|#define PXSTRIDE(x) (x)
  ------------------
 2095|  30.9k|    };
 2096|  30.9k|    bytefn(dav1d_lr_sbrow)(f, sr_p, sby);
  ------------------
  |  |   87|  30.9k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  30.9k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2097|  30.9k|}
dav1d_filter_sbrow_8bpc:
 2099|  87.5k|void bytefn(dav1d_filter_sbrow)(Dav1dFrameContext *const f, const int sby) {
 2100|  87.5k|    bytefn(dav1d_filter_sbrow_deblock_cols)(f, sby);
  ------------------
  |  |   87|  87.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  87.5k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2101|  87.5k|    bytefn(dav1d_filter_sbrow_deblock_rows)(f, sby);
  ------------------
  |  |   87|  87.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  87.5k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2102|  87.5k|    if (f->lf.cdef_planes)
  ------------------
  |  Branch (2102:9): [True: 19.5k, False: 68.0k]
  ------------------
 2103|  19.5k|        bytefn(dav1d_filter_sbrow_cdef)(f->c->tc, sby);
  ------------------
  |  |   87|  19.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  19.5k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2104|  87.5k|    if (f->frame_hdr->width[0] != f->frame_hdr->width[1])
  ------------------
  |  Branch (2104:9): [True: 9.36k, False: 78.2k]
  ------------------
 2105|  9.36k|        bytefn(dav1d_filter_sbrow_resize)(f, sby);
  ------------------
  |  |   87|  9.36k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  9.36k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2106|  87.5k|    if (f->lf.restore_planes)
  ------------------
  |  Branch (2106:9): [True: 30.9k, False: 56.5k]
  ------------------
 2107|  30.9k|        bytefn(dav1d_filter_sbrow_lr)(f, sby);
  ------------------
  |  |   87|  30.9k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  30.9k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2108|  87.5k|}
dav1d_backup_ipred_edge_8bpc:
 2110|  95.5k|void bytefn(dav1d_backup_ipred_edge)(Dav1dTaskContext *const t) {
 2111|  95.5k|    const Dav1dFrameContext *const f = t->f;
 2112|  95.5k|    Dav1dTileState *const ts = t->ts;
 2113|  95.5k|    const int sby = t->by >> f->sb_shift;
 2114|  95.5k|    const int sby_off = f->sb128w * 128 * sby;
 2115|  95.5k|    const int x_off = ts->tiling.col_start;
 2116|       |
 2117|  95.5k|    const pixel *const y =
 2118|  95.5k|        ((const pixel *) f->cur.data[0]) + x_off * 4 +
 2119|  95.5k|                    ((t->by + f->sb_step) * 4 - 1) * PXSTRIDE(f->cur.stride[0]);
  ------------------
  |  |   53|  95.5k|#define PXSTRIDE(x) (x)
  ------------------
 2120|  95.5k|    pixel_copy(&f->ipred_edge[0][sby_off + x_off * 4], y,
  ------------------
  |  |   47|  95.5k|#define pixel_copy memcpy
  ------------------
 2121|  95.5k|               4 * (ts->tiling.col_end - x_off));
 2122|       |
 2123|  95.5k|    if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (2123:9): [True: 43.7k, False: 51.8k]
  ------------------
 2124|  43.7k|        const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2125|  43.7k|        const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 2126|       |
 2127|  43.7k|        const ptrdiff_t uv_off = (x_off * 4 >> ss_hor) +
 2128|  43.7k|            (((t->by + f->sb_step) * 4 >> ss_ver) - 1) * PXSTRIDE(f->cur.stride[1]);
  ------------------
  |  |   53|  43.7k|#define PXSTRIDE(x) (x)
  ------------------
 2129|   131k|        for (int pl = 1; pl <= 2; pl++)
  ------------------
  |  Branch (2129:26): [True: 87.4k, False: 43.7k]
  ------------------
 2130|  87.4k|            pixel_copy(&f->ipred_edge[pl][sby_off + (x_off * 4 >> ss_hor)],
  ------------------
  |  |   47|  87.4k|#define pixel_copy memcpy
  ------------------
 2131|  87.4k|                       &((const pixel *) f->cur.data[pl])[uv_off],
 2132|  87.4k|                       4 * (ts->tiling.col_end - x_off) >> ss_hor);
 2133|  43.7k|    }
 2134|  95.5k|}
dav1d_copy_pal_block_y_8bpc:
 2140|  21.8k|{
 2141|  21.8k|    const Dav1dFrameContext *const f = t->f;
 2142|  21.8k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2142:24): [True: 0, False: 21.8k]
  ------------------
 2143|      0|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2144|      0|                            ((t->bx >> 1) + (t->by & 1))][0] :
 2145|  21.8k|        bytefn(t->scratch.pal)[0];
  ------------------
  |  |   87|  21.8k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  21.8k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2146|  94.8k|    for (int x = 0; x < bw4; x++)
  ------------------
  |  Branch (2146:21): [True: 73.0k, False: 21.8k]
  ------------------
 2147|  73.0k|        memcpy(bytefn(t->al_pal)[0][bx4 + x][0], pal, 8 * sizeof(pixel));
  ------------------
  |  |   87|  73.0k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  73.0k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2148|  83.4k|    for (int y = 0; y < bh4; y++)
  ------------------
  |  Branch (2148:21): [True: 61.6k, False: 21.8k]
  ------------------
 2149|  61.6k|        memcpy(bytefn(t->al_pal)[1][by4 + y][0], pal, 8 * sizeof(pixel));
  ------------------
  |  |   87|  61.6k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  61.6k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2150|  21.8k|}
dav1d_copy_pal_block_uv_8bpc:
 2156|  4.47k|{
 2157|  4.47k|    const Dav1dFrameContext *const f = t->f;
 2158|  4.47k|    const pixel (*const pal)[8] = t->frame_thread.pass ?
  ------------------
  |  Branch (2158:35): [True: 0, False: 4.47k]
  ------------------
 2159|      0|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2160|      0|                            ((t->bx >> 1) + (t->by & 1))] :
 2161|  4.47k|        bytefn(t->scratch.pal);
  ------------------
  |  |   87|  4.47k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  4.47k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2162|       |    // see aomedia bug 2183 for why we use luma coordinates here
 2163|  13.4k|    for (int pl = 1; pl <= 2; pl++) {
  ------------------
  |  Branch (2163:22): [True: 8.94k, False: 4.47k]
  ------------------
 2164|  40.8k|        for (int x = 0; x < bw4; x++)
  ------------------
  |  Branch (2164:25): [True: 31.8k, False: 8.94k]
  ------------------
 2165|  31.8k|            memcpy(bytefn(t->al_pal)[0][bx4 + x][pl], pal[pl], 8 * sizeof(pixel));
  ------------------
  |  |   87|  31.8k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  31.8k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2166|  37.0k|        for (int y = 0; y < bh4; y++)
  ------------------
  |  Branch (2166:25): [True: 28.1k, False: 8.94k]
  ------------------
 2167|  28.1k|            memcpy(bytefn(t->al_pal)[1][by4 + y][pl], pal[pl], 8 * sizeof(pixel));
  ------------------
  |  |   87|  28.1k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  28.1k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2168|  8.94k|    }
 2169|  4.47k|}
dav1d_read_pal_plane_8bpc:
 2174|  26.3k|{
 2175|  26.3k|    Dav1dTileState *const ts = t->ts;
 2176|  26.3k|    const Dav1dFrameContext *const f = t->f;
 2177|  26.3k|    const int pal_sz = b->pal_sz[pl] = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|  26.3k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 2178|  26.3k|                                           ts->cdf.m.pal_sz[pl][sz_ctx], 6) + 2;
 2179|  26.3k|    pixel cache[16], used_cache[8];
 2180|  26.3k|    int l_cache = pl ? t->pal_sz_uv[1][by4] : t->l.pal_sz[by4];
  ------------------
  |  Branch (2180:19): [True: 4.47k, False: 21.8k]
  ------------------
 2181|  26.3k|    int n_cache = 0;
 2182|       |    // don't reuse above palette outside SB64 boundaries
 2183|  26.3k|    int a_cache = by4 & 15 ? pl ? t->pal_sz_uv[0][bx4] : t->a->pal_sz[bx4] : 0;
  ------------------
  |  Branch (2183:19): [True: 22.7k, False: 3.58k]
  |  Branch (2183:30): [True: 3.73k, False: 19.0k]
  ------------------
 2184|  26.3k|    const pixel *l = bytefn(t->al_pal)[1][by4][pl];
  ------------------
  |  |   87|  26.3k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  26.3k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2185|  26.3k|    const pixel *a = bytefn(t->al_pal)[0][bx4][pl];
  ------------------
  |  |   87|  26.3k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  26.3k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2186|       |
 2187|       |    // fill/sort cache
 2188|  51.7k|    while (l_cache && a_cache) {
  ------------------
  |  Branch (2188:12): [True: 34.2k, False: 17.4k]
  |  Branch (2188:23): [True: 25.4k, False: 8.84k]
  ------------------
 2189|  25.4k|        if (*l < *a) {
  ------------------
  |  Branch (2189:13): [True: 7.26k, False: 18.1k]
  ------------------
 2190|  7.26k|            if (!n_cache || cache[n_cache - 1] != *l)
  ------------------
  |  Branch (2190:17): [True: 818, False: 6.44k]
  |  Branch (2190:29): [True: 6.14k, False: 300]
  ------------------
 2191|  6.96k|                cache[n_cache++] = *l;
 2192|  7.26k|            l++;
 2193|  7.26k|            l_cache--;
 2194|  18.1k|        } else {
 2195|  18.1k|            if (*a == *l) {
  ------------------
  |  Branch (2195:17): [True: 9.26k, False: 8.89k]
  ------------------
 2196|  9.26k|                l++;
 2197|  9.26k|                l_cache--;
 2198|  9.26k|            }
 2199|  18.1k|            if (!n_cache || cache[n_cache - 1] != *a)
  ------------------
  |  Branch (2199:17): [True: 3.36k, False: 14.8k]
  |  Branch (2199:29): [True: 13.0k, False: 1.78k]
  ------------------
 2200|  16.3k|                cache[n_cache++] = *a;
 2201|  18.1k|            a++;
 2202|  18.1k|            a_cache--;
 2203|  18.1k|        }
 2204|  25.4k|    }
 2205|  26.3k|    if (l_cache) {
  ------------------
  |  Branch (2205:9): [True: 8.84k, False: 17.4k]
  ------------------
 2206|  35.6k|        do {
 2207|  35.6k|            if (!n_cache || cache[n_cache - 1] != *l)
  ------------------
  |  Branch (2207:17): [True: 6.74k, False: 28.8k]
  |  Branch (2207:29): [True: 23.8k, False: 5.01k]
  ------------------
 2208|  30.5k|                cache[n_cache++] = *l;
 2209|  35.6k|            l++;
 2210|  35.6k|        } while (--l_cache > 0);
  ------------------
  |  Branch (2210:18): [True: 26.7k, False: 8.84k]
  ------------------
 2211|  17.4k|    } else if (a_cache) {
  ------------------
  |  Branch (2211:16): [True: 6.65k, False: 10.8k]
  ------------------
 2212|  29.8k|        do {
 2213|  29.8k|            if (!n_cache || cache[n_cache - 1] != *a)
  ------------------
  |  Branch (2213:17): [True: 5.06k, False: 24.7k]
  |  Branch (2213:29): [True: 17.6k, False: 7.06k]
  ------------------
 2214|  22.7k|                cache[n_cache++] = *a;
 2215|  29.8k|            a++;
 2216|  29.8k|        } while (--a_cache > 0);
  ------------------
  |  Branch (2216:18): [True: 23.1k, False: 6.65k]
  ------------------
 2217|  6.65k|    }
 2218|       |
 2219|       |    // find reused cache entries
 2220|  26.3k|    int i = 0;
 2221|  91.5k|    for (int n = 0; n < n_cache && i < pal_sz; n++)
  ------------------
  |  Branch (2221:21): [True: 68.8k, False: 22.7k]
  |  Branch (2221:36): [True: 65.2k, False: 3.61k]
  ------------------
 2222|  65.2k|        if (dav1d_msac_decode_bool_equi(&ts->msac))
  ------------------
  |  |   53|  65.2k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (2222:13): [True: 35.5k, False: 29.7k]
  ------------------
 2223|  35.5k|            used_cache[i++] = cache[n];
 2224|  26.3k|    const int n_used_cache = i;
 2225|       |
 2226|       |    // parse new entries
 2227|  26.3k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2227:24): [True: 0, False: 26.3k]
  ------------------
 2228|      0|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2229|      0|                            ((t->bx >> 1) + (t->by & 1))][pl] :
 2230|  26.3k|        bytefn(t->scratch.pal)[pl];
  ------------------
  |  |   87|  26.3k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  26.3k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2231|  26.3k|    if (i < pal_sz) {
  ------------------
  |  Branch (2231:9): [True: 21.4k, False: 4.84k]
  ------------------
 2232|  21.4k|        const int bpc = BITDEPTH == 8 ? 8 : f->cur.p.bpc;
  ------------------
  |  Branch (2232:25): [True: 21.4k, Folded]
  ------------------
 2233|  21.4k|        int prev = pal[i++] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2234|       |
 2235|  21.4k|        if (i < pal_sz) {
  ------------------
  |  Branch (2235:13): [True: 18.4k, False: 3.04k]
  ------------------
 2236|  18.4k|            int bits = bpc - 3 + dav1d_msac_decode_bools(&ts->msac, 2);
 2237|  18.4k|            const int max = (1 << bpc) - 1;
 2238|       |
 2239|  44.6k|            do {
 2240|  44.6k|                const int delta = dav1d_msac_decode_bools(&ts->msac, bits);
 2241|  44.6k|                prev = pal[i++] = imin(prev + delta + !pl, max);
 2242|  44.6k|                if (prev + !pl >= max) {
  ------------------
  |  Branch (2242:21): [True: 9.70k, False: 34.9k]
  ------------------
 2243|  24.6k|                    for (; i < pal_sz; i++)
  ------------------
  |  Branch (2243:28): [True: 14.9k, False: 9.70k]
  ------------------
 2244|  14.9k|                        pal[i] = max;
 2245|  9.70k|                    break;
 2246|  9.70k|                }
 2247|  34.9k|                bits = imin(bits, 1 + ulog2(max - prev - !pl));
 2248|  34.9k|            } while (i < pal_sz);
  ------------------
  |  Branch (2248:22): [True: 26.1k, False: 8.74k]
  ------------------
 2249|  18.4k|        }
 2250|       |
 2251|       |        // merge cache+new entries
 2252|  21.4k|        int n = 0, m = n_used_cache;
 2253|   123k|        for (i = 0; i < pal_sz; i++) {
  ------------------
  |  Branch (2253:21): [True: 102k, False: 21.4k]
  ------------------
 2254|   102k|            if (n < n_used_cache && (m >= pal_sz || used_cache[n] <= pal[m])) {
  ------------------
  |  Branch (2254:17): [True: 35.4k, False: 66.9k]
  |  Branch (2254:38): [True: 6.78k, False: 28.6k]
  |  Branch (2254:53): [True: 14.5k, False: 14.1k]
  ------------------
 2255|  21.2k|                pal[i] = used_cache[n++];
 2256|  81.1k|            } else {
 2257|  81.1k|                assert(m < pal_sz);
  ------------------
  |  Branch (2257:17): [True: 81.1k, False: 0]
  ------------------
 2258|  81.1k|                pal[i] = pal[m++];
 2259|  81.1k|            }
 2260|   102k|        }
 2261|  21.4k|    } else {
 2262|  4.84k|        memcpy(pal, used_cache, n_used_cache * sizeof(*used_cache));
 2263|  4.84k|    }
 2264|       |
 2265|  26.3k|    if (DEBUG_BLOCK_INFO) {
  ------------------
  |  |   34|  26.3k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 26.3k]
  |  |  ------------------
  |  |   35|  26.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|  26.3k|        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|  26.3k|}
dav1d_read_pal_uv_8bpc:
 2279|  4.47k|{
 2280|  4.47k|    bytefn(dav1d_read_pal_plane)(t, b, 1, sz_ctx, bx4, by4);
  ------------------
  |  |   87|  4.47k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  4.47k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2281|       |
 2282|       |    // V pal coding
 2283|  4.47k|    Dav1dTileState *const ts = t->ts;
 2284|  4.47k|    const Dav1dFrameContext *const f = t->f;
 2285|  4.47k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2285:24): [True: 0, False: 4.47k]
  ------------------
 2286|      0|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2287|      0|                            ((t->bx >> 1) + (t->by & 1))][2] :
 2288|  4.47k|        bytefn(t->scratch.pal)[2];
  ------------------
  |  |   87|  4.47k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   51|  4.47k|#define bitfn(x) x##_8bpc
  |  |  ------------------
  ------------------
 2289|  4.47k|    const int bpc = BITDEPTH == 8 ? 8 : f->cur.p.bpc;
  ------------------
  |  Branch (2289:21): [True: 4.47k, Folded]
  ------------------
 2290|  4.47k|    if (dav1d_msac_decode_bool_equi(&ts->msac)) {
  ------------------
  |  |   53|  4.47k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (2290:9): [True: 2.86k, False: 1.61k]
  ------------------
 2291|  2.86k|        const int bits = bpc - 4 + dav1d_msac_decode_bools(&ts->msac, 2);
 2292|  2.86k|        int prev = pal[0] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2293|  2.86k|        const int max = (1 << bpc) - 1;
 2294|  11.1k|        for (int i = 1; i < b->pal_sz[1]; i++) {
  ------------------
  |  Branch (2294:25): [True: 8.28k, False: 2.86k]
  ------------------
 2295|  8.28k|            int delta = dav1d_msac_decode_bools(&ts->msac, bits);
 2296|  8.28k|            if (delta) {
  ------------------
  |  Branch (2296:17): [True: 7.94k, False: 342]
  ------------------
 2297|  7.94k|                const int sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  7.94k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
 2298|  7.94k|                delta = apply_sign_bool(delta, sign);
 2299|  7.94k|            }
 2300|  8.28k|            prev = pal[i] = (prev + delta) & max;
 2301|  8.28k|        }
 2302|  2.86k|    } else {
 2303|  7.22k|        for (int i = 0; i < b->pal_sz[1]; i++)
  ------------------
  |  Branch (2303:25): [True: 5.61k, False: 1.61k]
  ------------------
 2304|  5.61k|            pal[i] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2305|  1.61k|    }
 2306|  4.47k|    if (DEBUG_BLOCK_INFO) {
  ------------------
  |  |   34|  4.47k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 4.47k]
  |  |  ------------------
  |  |   35|  4.47k|        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.47k|        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|  4.47k|}
recon_tmpl.c:read_coef_tree:
  736|  1.19M|{
  737|  1.19M|    const Dav1dFrameContext *const f = t->f;
  738|  1.19M|    Dav1dTileState *const ts = t->ts;
  739|  1.19M|    const Dav1dDSPContext *const dsp = f->dsp;
  740|  1.19M|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[ytx];
  741|  1.19M|    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|  1.19M|    if (depth < 2 && tx_split[depth] &&
  ------------------
  |  Branch (745:9): [True: 1.12M, False: 75.8k]
  |  Branch (745:22): [True: 86.6k, False: 1.03M]
  ------------------
  746|  86.6k|        tx_split[depth] & (1 << (y_off * 4 + x_off)))
  ------------------
  |  Branch (746:9): [True: 65.4k, False: 21.1k]
  ------------------
  747|  65.4k|    {
  748|  65.4k|        const enum RectTxfmSize sub = t_dim->sub;
  749|  65.4k|        const TxfmInfo *const sub_t_dim = &dav1d_txfm_dimensions[sub];
  750|  65.4k|        const int txsw = sub_t_dim->w, txsh = sub_t_dim->h;
  751|       |
  752|  65.4k|        read_coef_tree(t, bs, b, sub, depth + 1, tx_split,
  753|  65.4k|                       x_off * 2 + 0, y_off * 2 + 0, dst);
  754|  65.4k|        t->bx += txsw;
  755|  65.4k|        if (txw >= txh && t->bx < f->bw)
  ------------------
  |  Branch (755:13): [True: 53.2k, False: 12.2k]
  |  Branch (755:27): [True: 52.5k, False: 719]
  ------------------
  756|  52.5k|            read_coef_tree(t, bs, b, sub, depth + 1, tx_split, x_off * 2 + 1,
  757|  52.5k|                           y_off * 2 + 0, dst ? &dst[4 * txsw] : NULL);
  ------------------
  |  Branch (757:43): [True: 52.5k, False: 0]
  ------------------
  758|  65.4k|        t->bx -= txsw;
  759|  65.4k|        t->by += txsh;
  760|  65.4k|        if (txh >= txw && t->by < f->bh) {
  ------------------
  |  Branch (760:13): [True: 46.2k, False: 19.2k]
  |  Branch (760:27): [True: 45.0k, False: 1.15k]
  ------------------
  761|  45.0k|            if (dst)
  ------------------
  |  Branch (761:17): [True: 45.0k, False: 0]
  ------------------
  762|  45.0k|                dst += 4 * txsh * PXSTRIDE(f->cur.stride[0]);
  ------------------
  |  |   53|  45.0k|#define PXSTRIDE(x) (x)
  ------------------
  763|  45.0k|            read_coef_tree(t, bs, b, sub, depth + 1, tx_split,
  764|  45.0k|                           x_off * 2 + 0, y_off * 2 + 1, dst);
  765|  45.0k|            t->bx += txsw;
  766|  45.0k|            if (txw >= txh && t->bx < f->bw)
  ------------------
  |  Branch (766:17): [True: 32.8k, False: 12.2k]
  |  Branch (766:31): [True: 32.1k, False: 703]
  ------------------
  767|  32.1k|                read_coef_tree(t, bs, b, sub, depth + 1, tx_split, x_off * 2 + 1,
  768|  32.1k|                               y_off * 2 + 1, dst ? &dst[4 * txsw] : NULL);
  ------------------
  |  Branch (768:47): [True: 32.1k, False: 0]
  ------------------
  769|  45.0k|            t->bx -= txsw;
  770|  45.0k|        }
  771|  65.4k|        t->by -= txsh;
  772|  1.13M|    } else {
  773|  1.13M|        const int bx4 = t->bx & 31, by4 = t->by & 31;
  774|  1.13M|        enum TxfmType txtp;
  775|  1.13M|        uint8_t cf_ctx;
  776|  1.13M|        int eob;
  777|  1.13M|        coef *cf;
  778|       |
  779|  1.13M|        if (t->frame_thread.pass) {
  ------------------
  |  Branch (779:13): [True: 0, False: 1.13M]
  ------------------
  780|      0|            const int p = t->frame_thread.pass & 1;
  781|      0|            assert(ts->frame_thread[p].cf);
  ------------------
  |  Branch (781:13): [True: 0, False: 0]
  ------------------
  782|      0|            cf = ts->frame_thread[p].cf;
  783|      0|            ts->frame_thread[p].cf += imin(t_dim->w, 8) * imin(t_dim->h, 8) * 16;
  784|  1.13M|        } else {
  785|  1.13M|            cf = bitfn(t->cf);
  ------------------
  |  |   51|  1.13M|#define bitfn(x) x##_8bpc
  ------------------
  786|  1.13M|        }
  787|  1.13M|        if (t->frame_thread.pass != 2) {
  ------------------
  |  Branch (787:13): [True: 1.13M, False: 0]
  ------------------
  788|  1.13M|            eob = decode_coefs(t, &t->a->lcoef[bx4], &t->l.lcoef[by4],
  789|  1.13M|                               ytx, bs, b, 0, 0, cf, &txtp, &cf_ctx);
  790|  1.13M|            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.13M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.13M]
  |  |  ------------------
  |  |   35|  1.13M|        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.13M|        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|  1.13M|            dav1d_memset_likely_pow2(&t->a->lcoef[bx4], cf_ctx, imin(txw, f->bw - t->bx));
  794|  1.13M|            dav1d_memset_likely_pow2(&t->l.lcoef[by4], cf_ctx, imin(txh, f->bh - t->by));
  795|  1.13M|#define set_ctx(rep_macro) \
  796|  1.13M|            for (int y = 0; y < txh; y++) { \
  797|  1.13M|                rep_macro(txtp_map, 0, txtp); \
  798|  1.13M|                txtp_map += 32; \
  799|  1.13M|            }
  800|  1.13M|            uint8_t *txtp_map = &t->scratch.txtp_map[by4 * 32 + bx4];
  801|  1.13M|            case_set_upto16(t_dim->lw);
  ------------------
  |  |   80|  1.13M|    switch (var) { \
  |  |   81|   703k|    case 0: set_ctx(set_ctx1); break; \
  |  |  ------------------
  |  |  |  |  796|  1.46M|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 760k, False: 703k]
  |  |  |  |  ------------------
  |  |  |  |  797|   760k|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|   760k|    case 0: set_ctx(set_ctx1); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|   760k|    ((union alias8 *) &(var)[off])->u8 = (val) * 0x01
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|   760k|                txtp_map += 32; \
  |  |  |  |  799|   760k|            }
  |  |  ------------------
  |  |  |  Branch (81:5): [True: 703k, False: 429k]
  |  |  ------------------
  |  |   82|   198k|    case 1: set_ctx(set_ctx2); break; \
  |  |  ------------------
  |  |  |  |  796|   655k|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 457k, False: 198k]
  |  |  |  |  ------------------
  |  |  |  |  797|   457k|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   82|   457k|    case 1: set_ctx(set_ctx2); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   457k|    ((union alias16 *) &(var)[off])->u16 = (val) * 0x0101
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|   457k|                txtp_map += 32; \
  |  |  |  |  799|   457k|            }
  |  |  ------------------
  |  |  |  Branch (82:5): [True: 198k, False: 934k]
  |  |  ------------------
  |  |   83|   145k|    case 2: set_ctx(set_ctx4); break; \
  |  |  ------------------
  |  |  |  |  796|   608k|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 463k, False: 145k]
  |  |  |  |  ------------------
  |  |  |  |  797|   463k|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   83|   463k|    case 2: set_ctx(set_ctx4); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|   463k|    ((union alias32 *) &(var)[off])->u32 = (val) * 0x01010101U
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|   463k|                txtp_map += 32; \
  |  |  |  |  799|   463k|            }
  |  |  ------------------
  |  |  |  Branch (83:5): [True: 145k, False: 988k]
  |  |  ------------------
  |  |   84|  46.8k|    case 3: set_ctx(set_ctx8); break; \
  |  |  ------------------
  |  |  |  |  796|   308k|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 261k, False: 46.8k]
  |  |  |  |  ------------------
  |  |  |  |  797|   261k|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   84|   261k|    case 3: set_ctx(set_ctx8); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|   261k|    ((union alias64 *) &(var)[off])->u64 = (val) * 0x0101010101010101ULL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|   261k|                txtp_map += 32; \
  |  |  |  |  799|   261k|            }
  |  |  ------------------
  |  |  |  Branch (84:5): [True: 46.8k, False: 1.08M]
  |  |  ------------------
  |  |   85|  39.1k|    case 4: set_ctx(set_ctx16); break; \
  |  |  ------------------
  |  |  |  |  796|   568k|            for (int y = 0; y < txh; y++) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (796:29): [True: 529k, False: 39.1k]
  |  |  |  |  ------------------
  |  |  |  |  797|   529k|                rep_macro(txtp_map, 0, txtp); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   85|   529k|    case 4: set_ctx(set_ctx16); break; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   63|   529k|#define set_ctx16(var, off, val) do { \
  |  |  |  |  |  |  |  |   64|   529k|        memset(&(var)[off], val, 16); \
  |  |  |  |  |  |  |  |   65|   529k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (65:14): [Folded, False: 529k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  798|   529k|                txtp_map += 32; \
  |  |  |  |  799|   529k|            }
  |  |  ------------------
  |  |  |  Branch (85:5): [True: 39.1k, False: 1.09M]
  |  |  ------------------
  |  |   86|      0|    default: assert(0); \
  |  |  ------------------
  |  |  |  Branch (86:5): [True: 0, False: 1.13M]
  |  |  ------------------
  |  |   87|  1.13M|    }
  ------------------
  |  Branch (801:13): [Folded, False: 0]
  ------------------
  802|  1.13M|#undef set_ctx
  803|  1.13M|            if (t->frame_thread.pass == 1)
  ------------------
  |  Branch (803:17): [True: 0, False: 1.13M]
  ------------------
  804|      0|                *ts->frame_thread[1].cbi++ = eob * (1 << 5) + txtp;
  805|  1.13M|        } else {
  806|      0|            const int cbi = *ts->frame_thread[0].cbi++;
  807|      0|            eob  = cbi >> 5;
  808|      0|            txtp = cbi & 0x1f;
  809|      0|        }
  810|  1.13M|        if (!(t->frame_thread.pass & 1)) {
  ------------------
  |  Branch (810:13): [True: 1.13M, False: 0]
  ------------------
  811|  1.13M|            assert(dst);
  ------------------
  |  Branch (811:13): [True: 1.13M, False: 0]
  ------------------
  812|  1.13M|            if (eob >= 0) {
  ------------------
  |  Branch (812:17): [True: 743k, False: 390k]
  ------------------
  813|   743k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   743k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 743k]
  |  |  ------------------
  |  |   35|   743k|        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|   743k|        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|   743k|                dsp->itx.itxfm_add[ytx][txtp](dst, f->cur.stride[0], cf, eob
  816|   743k|                                              HIGHBD_CALL_SUFFIX);
  817|   743k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   743k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 743k]
  |  |  ------------------
  |  |   35|   743k|        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|   743k|        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|   743k|            }
  820|  1.13M|        }
  821|  1.13M|    }
  822|  1.19M|}
recon_tmpl.c:decode_coefs:
  327|  8.77M|{
  328|  8.77M|    Dav1dTileState *const ts = t->ts;
  329|  8.77M|    const int chroma = !!plane;
  330|  8.77M|    const Dav1dFrameContext *const f = t->f;
  331|  8.77M|    const int lossless = f->frame_hdr->segmentation.lossless[b->seg_id];
  332|  8.77M|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[tx];
  333|  8.77M|    const int dbg = DEBUG_BLOCK_INFO && plane && 0;
  ------------------
  |  |   34|  8.77M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 8.77M]
  |  |  ------------------
  |  |   35|  8.77M|        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.77M|        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|  8.77M|    if (dbg)
  ------------------
  |  Branch (335:9): [Folded, False: 8.77M]
  ------------------
  336|      0|        printf("Start: r=%d\n", ts->msac.rng);
  337|       |
  338|       |    // does this block have any non-zero coefficients
  339|  8.77M|    const int sctx = get_skip_ctx(t_dim, bs, a, l, chroma, f->cur.p.layout);
  340|  8.77M|    const int all_skip = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|  8.77M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  341|  8.77M|                             ts->cdf.coef.skip[t_dim->ctx][sctx]);
  342|  8.77M|    if (dbg)
  ------------------
  |  Branch (342:9): [Folded, False: 8.77M]
  ------------------
  343|      0|        printf("Post-non-zero[%d][%d][%d]: r=%d\n",
  344|      0|               t_dim->ctx, sctx, all_skip, ts->msac.rng);
  345|  8.77M|    if (all_skip) {
  ------------------
  |  Branch (345:9): [True: 4.56M, False: 4.21M]
  ------------------
  346|  4.56M|        *res_ctx = 0x40;
  347|  4.56M|        *txtp = lossless * WHT_WHT; /* lossless ? WHT_WHT : DCT_DCT */
  348|  4.56M|        return -1;
  349|  4.56M|    }
  350|       |
  351|       |    // transform type (chroma: derived, luma: explicitly coded)
  352|  4.21M|    if (lossless) {
  ------------------
  |  Branch (352:9): [True: 874k, False: 3.33M]
  ------------------
  353|   874k|        assert(t_dim->max == TX_4X4);
  ------------------
  |  Branch (353:9): [True: 874k, False: 0]
  ------------------
  354|   874k|        *txtp = WHT_WHT;
  355|  3.33M|    } else if (t_dim->max + intra >= TX_64X64) {
  ------------------
  |  Branch (355:16): [True: 742k, False: 2.59M]
  ------------------
  356|   742k|        *txtp = DCT_DCT;
  357|  2.59M|    } else if (chroma) {
  ------------------
  |  Branch (357:16): [True: 601k, False: 1.99M]
  ------------------
  358|       |        // inferred from either the luma txtp (inter) or a LUT (intra)
  359|   601k|        *txtp = intra ? dav1d_txtp_from_uvmode[b->uv_mode] :
  ------------------
  |  Branch (359:17): [True: 423k, False: 178k]
  ------------------
  360|   601k|                        get_uv_inter_txtp(t_dim, *txtp);
  361|  1.99M|    } else if (!f->frame_hdr->segmentation.qidx[b->seg_id]) {
  ------------------
  |  Branch (361:16): [True: 3.07k, False: 1.99M]
  ------------------
  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|  3.07k|        *txtp = DCT_DCT;
  366|  1.99M|    } else {
  367|  1.99M|        unsigned idx;
  368|  1.99M|        if (intra) {
  ------------------
  |  Branch (368:13): [True: 1.56M, False: 427k]
  ------------------
  369|  1.56M|            const enum IntraPredMode y_mode_nofilt = b->y_mode == FILTER_PRED ?
  ------------------
  |  Branch (369:54): [True: 230k, False: 1.33M]
  ------------------
  370|  1.33M|                dav1d_filter_mode_to_y_mode[b->y_angle] : b->y_mode;
  371|  1.56M|            if (f->frame_hdr->reduced_txtp_set || t_dim->min == TX_16X16) {
  ------------------
  |  Branch (371:17): [True: 268k, False: 1.29M]
  |  Branch (371:51): [True: 210k, False: 1.08M]
  ------------------
  372|   479k|                idx = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|   479k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  373|   479k|                          ts->cdf.m.txtp_intra2[t_dim->min][y_mode_nofilt], 4);
  374|   479k|                *txtp = dav1d_tx_types_per_set[idx + 0];
  375|  1.08M|            } else {
  376|  1.08M|                idx = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|  1.08M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
  377|  1.08M|                          ts->cdf.m.txtp_intra1[t_dim->min][y_mode_nofilt], 6);
  378|  1.08M|                *txtp = dav1d_tx_types_per_set[idx + 5];
  379|  1.08M|            }
  380|  1.56M|            if (dbg)
  ------------------
  |  Branch (380:17): [Folded, False: 1.56M]
  ------------------
  381|      0|                printf("Post-txtp-intra[%d->%d][%d][%d->%d]: r=%d\n",
  382|      0|                       tx, t_dim->min, y_mode_nofilt, idx, *txtp, ts->msac.rng);
  383|  1.56M|        } else {
  384|   427k|            if (f->frame_hdr->reduced_txtp_set || t_dim->max == TX_32X32) {
  ------------------
  |  Branch (384:17): [True: 93.3k, False: 334k]
  |  Branch (384:51): [True: 39.2k, False: 295k]
  ------------------
  385|   132k|                idx = dav1d_msac_decode_bool_adapt(&ts->msac,
  ------------------
  |  |   52|   132k|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  386|   132k|                          ts->cdf.m.txtp_inter3[t_dim->min]);
  387|   132k|                *txtp = (idx - 1) & IDTX; /* idx ? DCT_DCT : IDTX */
  388|   295k|            } else if (t_dim->min == TX_16X16) {
  ------------------
  |  Branch (388:24): [True: 41.9k, False: 253k]
  ------------------
  389|  41.9k|                idx = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|  41.9k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
  390|  41.9k|                          ts->cdf.m.txtp_inter2, 11);
  391|  41.9k|                *txtp = dav1d_tx_types_per_set[idx + 12];
  392|   253k|            } else {
  393|   253k|                idx = dav1d_msac_decode_symbol_adapt16(&ts->msac,
  ------------------
  |  |   57|   253k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  ------------------
  394|   253k|                          ts->cdf.m.txtp_inter1[t_dim->min], 15);
  395|   253k|                *txtp = dav1d_tx_types_per_set[idx + 24];
  396|   253k|            }
  397|   427k|            if (dbg)
  ------------------
  |  Branch (397:17): [Folded, False: 427k]
  ------------------
  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|   427k|        }
  401|  1.99M|    }
  402|       |
  403|       |    // find end-of-block (eob)
  404|  4.21M|    int eob;
  405|  4.21M|    const int slw = imin(t_dim->lw, TX_32X32), slh = imin(t_dim->lh, TX_32X32);
  406|  4.21M|    const int tx2dszctx = slw + slh;
  407|  4.21M|    const enum TxClass tx_class = dav1d_tx_type_class[*txtp];
  408|  4.21M|    const int is_1d = tx_class != TX_CLASS_2D;
  409|  4.21M|    switch (tx2dszctx) {
  ------------------
  |  Branch (409:13): [True: 4.21M, False: 0]
  ------------------
  410|      0|#define case_sz(sz, bin, ns, is_1d) \
  411|      0|    case sz: { \
  412|      0|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  413|      0|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  414|      0|        break; \
  415|      0|    }
  416|  1.27M|    case_sz(0,   16,  8, [is_1d]);
  ------------------
  |  |  411|  1.27M|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 1.27M, False: 2.94M]
  |  |  ------------------
  |  |  412|  1.27M|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|  1.27M|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   48|  1.27M|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  |  |  ------------------
  |  |  414|  1.27M|        break; \
  |  |  415|  1.27M|    }
  ------------------
  417|   340k|    case_sz(1,   32,  8, [is_1d]);
  ------------------
  |  |  411|   340k|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 340k, False: 3.87M]
  |  |  ------------------
  |  |  412|   340k|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|   340k|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   48|   340k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  |  |  ------------------
  |  |  414|   340k|        break; \
  |  |  415|   340k|    }
  ------------------
  418|   918k|    case_sz(2,   64,  8, [is_1d]);
  ------------------
  |  |  411|   918k|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 918k, False: 3.29M]
  |  |  ------------------
  |  |  412|   918k|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|   918k|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   48|   918k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  |  |  ------------------
  |  |  414|   918k|        break; \
  |  |  415|   918k|    }
  ------------------
  419|   457k|    case_sz(3,  128,  8, [is_1d]);
  ------------------
  |  |  411|   457k|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 457k, False: 3.75M]
  |  |  ------------------
  |  |  412|   457k|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|   457k|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   48|   457k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  |  |  ------------------
  |  |  414|   457k|        break; \
  |  |  415|   457k|    }
  ------------------
  420|   529k|    case_sz(4,  256, 16, [is_1d]);
  ------------------
  |  |  411|   529k|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 529k, False: 3.68M]
  |  |  ------------------
  |  |  412|   529k|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|   529k|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   57|   529k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  |  |  ------------------
  |  |  414|   529k|        break; \
  |  |  415|   529k|    }
  ------------------
  421|   236k|    case_sz(5,  512, 16,        );
  ------------------
  |  |  411|   236k|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 236k, False: 3.97M]
  |  |  ------------------
  |  |  412|   236k|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|   236k|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   57|   236k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  |  |  ------------------
  |  |  414|   236k|        break; \
  |  |  415|   236k|    }
  ------------------
  422|   458k|    case_sz(6, 1024, 16,        );
  ------------------
  |  |  411|   458k|    case sz: { \
  |  |  ------------------
  |  |  |  Branch (411:5): [True: 458k, False: 3.75M]
  |  |  ------------------
  |  |  412|   458k|        uint16_t *const eob_bin_cdf = ts->cdf.coef.eob_bin_##bin[chroma]is_1d; \
  |  |  413|   458k|        eob = dav1d_msac_decode_symbol_adapt##ns(&ts->msac, eob_bin_cdf, 4 + sz); \
  |  |  ------------------
  |  |  |  |   57|   458k|#define dav1d_msac_decode_symbol_adapt16(ctx, cdf, symb) ((ctx)->symbol_adapt16(ctx, cdf, symb))
  |  |  ------------------
  |  |  414|   458k|        break; \
  |  |  415|   458k|    }
  ------------------
  423|  4.21M|#undef case_sz
  424|  4.21M|    }
  425|  4.21M|    if (dbg)
  ------------------
  |  Branch (425:9): [Folded, False: 4.21M]
  ------------------
  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|  4.21M|    if (eob > 1) {
  ------------------
  |  Branch (428:9): [True: 2.95M, False: 1.25M]
  ------------------
  429|  2.95M|        const int eob_bin = eob - 2;
  430|  2.95M|        uint16_t *const eob_hi_bit_cdf =
  431|  2.95M|            ts->cdf.coef.eob_hi_bit[t_dim->ctx][chroma][eob_bin];
  432|  2.95M|        const int eob_hi_bit = dav1d_msac_decode_bool_adapt(&ts->msac, eob_hi_bit_cdf);
  ------------------
  |  |   52|  2.95M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  433|  2.95M|        if (dbg)
  ------------------
  |  Branch (433:13): [Folded, False: 2.95M]
  ------------------
  434|      0|            printf("Post-eob_hi_bit[%d][%d][%d][%d]: r=%d\n",
  435|      0|                   t_dim->ctx, chroma, eob_bin, eob_hi_bit, ts->msac.rng);
  436|  2.95M|        eob = ((eob_hi_bit | 2) << eob_bin) | dav1d_msac_decode_bools(&ts->msac, eob_bin);
  437|  2.95M|        if (dbg)
  ------------------
  |  Branch (437:13): [Folded, False: 2.95M]
  ------------------
  438|      0|            printf("Post-eob[%d]: r=%d\n", eob, ts->msac.rng);
  439|  2.95M|    }
  440|  4.21M|    assert(eob >= 0);
  ------------------
  |  Branch (440:5): [True: 4.21M, False: 0]
  ------------------
  441|       |
  442|       |    // base tokens
  443|  4.21M|    uint16_t (*const eob_cdf)[4] = ts->cdf.coef.eob_base_tok[t_dim->ctx][chroma];
  444|  4.21M|    uint16_t (*const hi_cdf)[4] = ts->cdf.coef.br_tok[imin(t_dim->ctx, 3)][chroma];
  445|  4.21M|    unsigned rc, dc_tok;
  446|       |
  447|  4.21M|    if (eob) {
  ------------------
  |  Branch (447:9): [True: 3.12M, False: 1.08M]
  ------------------
  448|  3.12M|        uint16_t (*const lo_cdf)[4] = ts->cdf.coef.base_tok[t_dim->ctx][chroma];
  449|  3.12M|        uint8_t *const levels = t->scratch.levels; // bits 0-5: tok, 6-7: lo_tok
  450|       |
  451|       |        /* eob */
  452|  3.12M|        unsigned ctx = 1 + (eob > 2 << tx2dszctx) + (eob > 4 << tx2dszctx);
  453|  3.12M|        int eob_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, eob_cdf[ctx], 2);
  ------------------
  |  |   47|  3.12M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
  454|  3.12M|        int tok = eob_tok + 1;
  455|  3.12M|        int level_tok = tok * 0x41;
  456|  3.12M|        unsigned mag;
  457|       |
  458|  3.12M|#define DECODE_COEFS_CLASS(tx_class) \
  459|  3.12M|        unsigned x, y; \
  460|  3.12M|        uint8_t *level; \
  461|  3.12M|        if (tx_class == TX_CLASS_2D) \
  462|  3.12M|            rc = scan[eob], x = rc >> shift, y = rc & mask; \
  463|  3.12M|        else if (tx_class == TX_CLASS_H) \
  464|       |            /* Transposing reduces the stride and padding requirements */ \
  465|  3.12M|            x = eob & mask, y = eob >> shift, rc = eob; \
  466|  3.12M|        else /* tx_class == TX_CLASS_V */ \
  467|  3.12M|            x = eob & mask, y = eob >> shift, rc = (x << shift2) | y; \
  468|  3.12M|        if (dbg) \
  469|  3.12M|            printf("Post-lo_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  470|  3.12M|                   t_dim->ctx, chroma, ctx, eob, rc, tok, ts->msac.rng); \
  471|  3.12M|        if (eob_tok == 2) { \
  472|  3.12M|            ctx = (tx_class == TX_CLASS_2D ? (x | y) > 1 : y != 0) ? 14 : 7; \
  473|  3.12M|            tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  474|  3.12M|            level_tok = tok + (3 << 6); \
  475|  3.12M|            if (dbg) \
  476|  3.12M|                printf("Post-hi_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  477|  3.12M|                       imin(t_dim->ctx, 3), chroma, ctx, eob, rc, tok, \
  478|  3.12M|                       ts->msac.rng); \
  479|  3.12M|        } \
  480|  3.12M|        cf[rc] = tok << 11; \
  481|  3.12M|        if (tx_class == TX_CLASS_2D) \
  482|  3.12M|            level = levels + rc; \
  483|  3.12M|        else \
  484|  3.12M|            level = levels + x * stride + y; \
  485|  3.12M|        *level = (uint8_t) level_tok; \
  486|  3.12M|        for (int i = eob - 1; i > 0; i--) { /* ac */ \
  487|  3.12M|            unsigned rc_i; \
  488|  3.12M|            if (tx_class == TX_CLASS_2D) \
  489|  3.12M|                rc_i = scan[i], x = rc_i >> shift, y = rc_i & mask; \
  490|  3.12M|            else if (tx_class == TX_CLASS_H) \
  491|  3.12M|                x = i & mask, y = i >> shift, rc_i = i; \
  492|  3.12M|            else /* tx_class == TX_CLASS_V */ \
  493|  3.12M|                x = i & mask, y = i >> shift, rc_i = (x << shift2) | y; \
  494|  3.12M|            assert(x < 32 && y < 32); \
  495|  3.12M|            if (tx_class == TX_CLASS_2D) \
  496|  3.12M|                level = levels + rc_i; \
  497|  3.12M|            else \
  498|  3.12M|                level = levels + x * stride + y; \
  499|  3.12M|            ctx = get_lo_ctx(level, tx_class, &mag, lo_ctx_offsets, x, y, stride); \
  500|  3.12M|            if (tx_class == TX_CLASS_2D) \
  501|  3.12M|                y |= x; \
  502|  3.12M|            tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  503|  3.12M|            if (dbg) \
  504|  3.12M|                printf("Post-lo_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  505|  3.12M|                       t_dim->ctx, chroma, ctx, i, rc_i, tok, ts->msac.rng); \
  506|  3.12M|            if (tok == 3) { \
  507|  3.12M|                mag &= 63; \
  508|  3.12M|                ctx = (y > (tx_class == TX_CLASS_2D) ? 14 : 7) + \
  509|  3.12M|                      (mag > 12 ? 6 : (mag + 1) >> 1); \
  510|  3.12M|                tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  511|  3.12M|                if (dbg) \
  512|  3.12M|                    printf("Post-hi_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  513|  3.12M|                           imin(t_dim->ctx, 3), chroma, ctx, i, rc_i, tok, \
  514|  3.12M|                           ts->msac.rng); \
  515|  3.12M|                *level = (uint8_t) (tok + (3 << 6)); \
  516|  3.12M|                cf[rc_i] = (tok << 11) | rc; \
  517|  3.12M|                rc = rc_i; \
  518|  3.12M|            } else { \
  519|       |                /* 0x1 for tok, 0x7ff as bitmask for rc, 0x41 for level_tok */ \
  520|  3.12M|                tok *= 0x17ff41; \
  521|  3.12M|                *level = (uint8_t) tok; \
  522|       |                /* tok ? (tok << 11) | rc : 0 */ \
  523|  3.12M|                tok = (tok >> 9) & (rc + ~0x7ffu); \
  524|  3.12M|                if (tok) rc = rc_i; \
  525|  3.12M|                cf[rc_i] = tok; \
  526|  3.12M|            } \
  527|  3.12M|        } \
  528|       |        /* dc */ \
  529|  3.12M|        ctx = (tx_class == TX_CLASS_2D) ? 0 : \
  530|  3.12M|            get_lo_ctx(levels, tx_class, &mag, lo_ctx_offsets, 0, 0, stride); \
  531|  3.12M|        dc_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  532|  3.12M|        if (dbg) \
  533|  3.12M|            printf("Post-dc_lo_tok[%d][%d][%d][%d]: r=%d\n", \
  534|  3.12M|                   t_dim->ctx, chroma, ctx, dc_tok, ts->msac.rng); \
  535|  3.12M|        if (dc_tok == 3) { \
  536|  3.12M|            if (tx_class == TX_CLASS_2D) \
  537|  3.12M|                mag = levels[0 * stride + 1] + levels[1 * stride + 0] + \
  538|  3.12M|                      levels[1 * stride + 1]; \
  539|  3.12M|            mag &= 63; \
  540|  3.12M|            ctx = mag > 12 ? 6 : (mag + 1) >> 1; \
  541|  3.12M|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  542|  3.12M|            if (dbg) \
  543|  3.12M|                printf("Post-dc_hi_tok[%d][%d][0][%d]: r=%d\n", \
  544|  3.12M|                       imin(t_dim->ctx, 3), chroma, dc_tok, ts->msac.rng); \
  545|  3.12M|        } \
  546|  3.12M|        break
  547|       |
  548|  3.12M|        const uint16_t *scan;
  549|  3.12M|        switch (tx_class) {
  550|  2.87M|        case TX_CLASS_2D: {
  ------------------
  |  Branch (550:9): [True: 2.87M, False: 252k]
  ------------------
  551|  2.87M|            const unsigned nonsquare_tx = tx >= RTX_4X8;
  552|  2.87M|            const uint8_t (*const lo_ctx_offsets)[5] =
  553|  2.87M|                dav1d_lo_ctx_offsets[nonsquare_tx + (tx & nonsquare_tx)];
  554|  2.87M|            scan = dav1d_scans[tx];
  555|  2.87M|            const ptrdiff_t stride = 4 << slh;
  556|  2.87M|            const unsigned shift = slh + 2, shift2 = 0;
  557|  2.87M|            const unsigned mask = (4 << slh) - 1;
  558|  2.87M|            memset(levels, 0, stride * ((4 << slw) + 2));
  559|  2.87M|            DECODE_COEFS_CLASS(TX_CLASS_2D);
  ------------------
  |  |  459|  2.87M|        unsigned x, y; \
  |  |  460|  2.87M|        uint8_t *level; \
  |  |  461|  2.87M|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (461:13): [True: 2.87M, Folded]
  |  |  ------------------
  |  |  462|  2.87M|            rc = scan[eob], x = rc >> shift, y = rc & mask; \
  |  |  463|  2.87M|        else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (463:18): [Folded, False: 0]
  |  |  ------------------
  |  |  464|      0|            /* Transposing reduces the stride and padding requirements */ \
  |  |  465|      0|            x = eob & mask, y = eob >> shift, rc = eob; \
  |  |  466|      0|        else /* tx_class == TX_CLASS_V */ \
  |  |  467|      0|            x = eob & mask, y = eob >> shift, rc = (x << shift2) | y; \
  |  |  468|  2.87M|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (468:13): [Folded, False: 2.87M]
  |  |  ------------------
  |  |  469|  2.87M|            printf("Post-lo_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  |  |  470|      0|                   t_dim->ctx, chroma, ctx, eob, rc, tok, ts->msac.rng); \
  |  |  471|  2.87M|        if (eob_tok == 2) { \
  |  |  ------------------
  |  |  |  Branch (471:13): [True: 95.3k, False: 2.78M]
  |  |  ------------------
  |  |  472|  95.3k|            ctx = (tx_class == TX_CLASS_2D ? (x | y) > 1 : y != 0) ? 14 : 7; \
  |  |  ------------------
  |  |  |  Branch (472:19): [True: 91.6k, False: 3.69k]
  |  |  |  Branch (472:20): [True: 95.3k, Folded]
  |  |  ------------------
  |  |  473|  95.3k|            tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  95.3k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  474|  95.3k|            level_tok = tok + (3 << 6); \
  |  |  475|  95.3k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (475:17): [Folded, False: 95.3k]
  |  |  ------------------
  |  |  476|  95.3k|                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|  95.3k|        } \
  |  |  480|  2.87M|        cf[rc] = tok << 11; \
  |  |  481|  2.87M|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (481:13): [True: 2.87M, Folded]
  |  |  ------------------
  |  |  482|  2.87M|            level = levels + rc; \
  |  |  483|  2.87M|        else \
  |  |  484|  2.87M|            level = levels + x * stride + y; \
  |  |  485|  2.87M|        *level = (uint8_t) level_tok; \
  |  |  486|  82.8M|        for (int i = eob - 1; i > 0; i--) { /* ac */ \
  |  |  ------------------
  |  |  |  Branch (486:31): [True: 79.9M, False: 2.87M]
  |  |  ------------------
  |  |  487|  79.9M|            unsigned rc_i; \
  |  |  488|  79.9M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (488:17): [True: 79.9M, Folded]
  |  |  ------------------
  |  |  489|  79.9M|                rc_i = scan[i], x = rc_i >> shift, y = rc_i & mask; \
  |  |  490|  79.9M|            else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (490:22): [Folded, False: 0]
  |  |  ------------------
  |  |  491|      0|                x = i & mask, y = i >> shift, rc_i = i; \
  |  |  492|      0|            else /* tx_class == TX_CLASS_V */ \
  |  |  493|      0|                x = i & mask, y = i >> shift, rc_i = (x << shift2) | y; \
  |  |  494|  79.9M|            assert(x < 32 && y < 32); \
  |  |  495|  79.9M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (495:17): [True: 79.9M, Folded]
  |  |  ------------------
  |  |  496|  79.9M|                level = levels + rc_i; \
  |  |  497|  79.9M|            else \
  |  |  498|  79.9M|                level = levels + x * stride + y; \
  |  |  499|  79.9M|            ctx = get_lo_ctx(level, tx_class, &mag, lo_ctx_offsets, x, y, stride); \
  |  |  500|  79.9M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (500:17): [True: 79.9M, Folded]
  |  |  ------------------
  |  |  501|  79.9M|                y |= x; \
  |  |  502|  79.9M|            tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|  79.9M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  503|  79.9M|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (503:17): [Folded, False: 79.9M]
  |  |  ------------------
  |  |  504|  79.9M|                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|  79.9M|            if (tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (506:17): [True: 6.89M, False: 73.0M]
  |  |  ------------------
  |  |  507|  6.89M|                mag &= 63; \
  |  |  508|  6.89M|                ctx = (y > (tx_class == TX_CLASS_2D) ? 14 : 7) + \
  |  |  ------------------
  |  |  |  Branch (508:24): [True: 5.66M, False: 1.23M]
  |  |  ------------------
  |  |  509|  6.89M|                      (mag > 12 ? 6 : (mag + 1) >> 1); \
  |  |  ------------------
  |  |  |  Branch (509:24): [True: 2.07M, False: 4.82M]
  |  |  ------------------
  |  |  510|  6.89M|                tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  6.89M|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  511|  6.89M|                if (dbg) \
  |  |  ------------------
  |  |  |  Branch (511:21): [Folded, False: 6.89M]
  |  |  ------------------
  |  |  512|  6.89M|                    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|  6.89M|                *level = (uint8_t) (tok + (3 << 6)); \
  |  |  516|  6.89M|                cf[rc_i] = (tok << 11) | rc; \
  |  |  517|  6.89M|                rc = rc_i; \
  |  |  518|  73.0M|            } else { \
  |  |  519|  73.0M|                /* 0x1 for tok, 0x7ff as bitmask for rc, 0x41 for level_tok */ \
  |  |  520|  73.0M|                tok *= 0x17ff41; \
  |  |  521|  73.0M|                *level = (uint8_t) tok; \
  |  |  522|  73.0M|                /* tok ? (tok << 11) | rc : 0 */ \
  |  |  523|  73.0M|                tok = (tok >> 9) & (rc + ~0x7ffu); \
  |  |  524|  73.0M|                if (tok) rc = rc_i; \
  |  |  ------------------
  |  |  |  Branch (524:21): [True: 21.5M, False: 51.4M]
  |  |  ------------------
  |  |  525|  73.0M|                cf[rc_i] = tok; \
  |  |  526|  73.0M|            } \
  |  |  527|  79.9M|        } \
  |  |  528|  2.87M|        /* dc */ \
  |  |  529|  2.87M|        ctx = (tx_class == TX_CLASS_2D) ? 0 : \
  |  |  ------------------
  |  |  |  Branch (529:15): [True: 2.87M, Folded]
  |  |  ------------------
  |  |  530|  2.87M|            get_lo_ctx(levels, tx_class, &mag, lo_ctx_offsets, 0, 0, stride); \
  |  |  531|  2.87M|        dc_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|  2.87M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  532|  2.87M|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (532:13): [Folded, False: 2.87M]
  |  |  ------------------
  |  |  533|  2.87M|            printf("Post-dc_lo_tok[%d][%d][%d][%d]: r=%d\n", \
  |  |  534|      0|                   t_dim->ctx, chroma, ctx, dc_tok, ts->msac.rng); \
  |  |  535|  2.87M|        if (dc_tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (535:13): [True: 1.11M, False: 1.76M]
  |  |  ------------------
  |  |  536|  1.11M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (536:17): [True: 1.11M, Folded]
  |  |  ------------------
  |  |  537|  1.11M|                mag = levels[0 * stride + 1] + levels[1 * stride + 0] + \
  |  |  538|  1.11M|                      levels[1 * stride + 1]; \
  |  |  539|  1.11M|            mag &= 63; \
  |  |  540|  1.11M|            ctx = mag > 12 ? 6 : (mag + 1) >> 1; \
  |  |  ------------------
  |  |  |  Branch (540:19): [True: 152k, False: 960k]
  |  |  ------------------
  |  |  541|  1.11M|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  1.11M|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  542|  1.11M|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (542:17): [Folded, False: 1.11M]
  |  |  ------------------
  |  |  543|  1.11M|                printf("Post-dc_hi_tok[%d][%d][0][%d]: r=%d\n", \
  |  |  544|      0|                       imin(t_dim->ctx, 3), chroma, dc_tok, ts->msac.rng); \
  |  |  545|  1.11M|        } \
  |  |  546|  2.87M|        break
  ------------------
  |  Branch (559:13): [True: 79.9M, False: 0]
  |  Branch (559:13): [True: 79.9M, False: 0]
  ------------------
  560|  2.87M|        }
  561|   163k|        case TX_CLASS_H: {
  ------------------
  |  Branch (561:9): [True: 163k, False: 2.96M]
  ------------------
  562|   163k|            const uint8_t (*const lo_ctx_offsets)[5] = NULL;
  563|   163k|            const ptrdiff_t stride = 16;
  564|   163k|            const unsigned shift = slh + 2, shift2 = 0;
  565|   163k|            const unsigned mask = (4 << slh) - 1;
  566|   163k|            memset(levels, 0, stride * ((4 << slh) + 2));
  567|   163k|            DECODE_COEFS_CLASS(TX_CLASS_H);
  ------------------
  |  |  459|   163k|        unsigned x, y; \
  |  |  460|   163k|        uint8_t *level; \
  |  |  461|   163k|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (461:13): [Folded, False: 163k]
  |  |  ------------------
  |  |  462|   163k|            rc = scan[eob], x = rc >> shift, y = rc & mask; \
  |  |  463|   163k|        else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (463:18): [True: 163k, Folded]
  |  |  ------------------
  |  |  464|   163k|            /* Transposing reduces the stride and padding requirements */ \
  |  |  465|   163k|            x = eob & mask, y = eob >> shift, rc = eob; \
  |  |  466|   163k|        else /* tx_class == TX_CLASS_V */ \
  |  |  467|   163k|            x = eob & mask, y = eob >> shift, rc = (x << shift2) | y; \
  |  |  468|   163k|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (468:13): [Folded, False: 163k]
  |  |  ------------------
  |  |  469|   163k|            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|   163k|        if (eob_tok == 2) { \
  |  |  ------------------
  |  |  |  Branch (471:13): [True: 3.25k, False: 160k]
  |  |  ------------------
  |  |  472|  3.25k|            ctx = (tx_class == TX_CLASS_2D ? (x | y) > 1 : y != 0) ? 14 : 7; \
  |  |  ------------------
  |  |  |  Branch (472:19): [True: 2.91k, False: 348]
  |  |  |  Branch (472:20): [Folded, False: 3.25k]
  |  |  ------------------
  |  |  473|  3.25k|            tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  3.25k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  474|  3.25k|            level_tok = tok + (3 << 6); \
  |  |  475|  3.25k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (475:17): [Folded, False: 3.25k]
  |  |  ------------------
  |  |  476|  3.25k|                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|  3.25k|        } \
  |  |  480|   163k|        cf[rc] = tok << 11; \
  |  |  481|   163k|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (481:13): [Folded, False: 163k]
  |  |  ------------------
  |  |  482|   163k|            level = levels + rc; \
  |  |  483|   163k|        else \
  |  |  484|   163k|            level = levels + x * stride + y; \
  |  |  485|   163k|        *level = (uint8_t) level_tok; \
  |  |  486|  3.32M|        for (int i = eob - 1; i > 0; i--) { /* ac */ \
  |  |  ------------------
  |  |  |  Branch (486:31): [True: 3.16M, False: 163k]
  |  |  ------------------
  |  |  487|  3.16M|            unsigned rc_i; \
  |  |  488|  3.16M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (488:17): [Folded, False: 3.16M]
  |  |  ------------------
  |  |  489|  3.16M|                rc_i = scan[i], x = rc_i >> shift, y = rc_i & mask; \
  |  |  490|  3.16M|            else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (490:22): [True: 3.16M, Folded]
  |  |  ------------------
  |  |  491|  3.16M|                x = i & mask, y = i >> shift, rc_i = i; \
  |  |  492|  3.16M|            else /* tx_class == TX_CLASS_V */ \
  |  |  493|  3.16M|                x = i & mask, y = i >> shift, rc_i = (x << shift2) | y; \
  |  |  494|  3.16M|            assert(x < 32 && y < 32); \
  |  |  495|  3.16M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (495:17): [Folded, False: 3.16M]
  |  |  ------------------
  |  |  496|  3.16M|                level = levels + rc_i; \
  |  |  497|  3.16M|            else \
  |  |  498|  3.16M|                level = levels + x * stride + y; \
  |  |  499|  3.16M|            ctx = get_lo_ctx(level, tx_class, &mag, lo_ctx_offsets, x, y, stride); \
  |  |  500|  3.16M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (500:17): [Folded, False: 3.16M]
  |  |  ------------------
  |  |  501|  3.16M|                y |= x; \
  |  |  502|  3.16M|            tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|  3.16M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  503|  3.16M|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (503:17): [Folded, False: 3.16M]
  |  |  ------------------
  |  |  504|  3.16M|                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|  3.16M|            if (tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (506:17): [True: 131k, False: 3.03M]
  |  |  ------------------
  |  |  507|   131k|                mag &= 63; \
  |  |  508|   131k|                ctx = (y > (tx_class == TX_CLASS_2D) ? 14 : 7) + \
  |  |  ------------------
  |  |  |  Branch (508:24): [True: 77.4k, False: 54.4k]
  |  |  ------------------
  |  |  509|   131k|                      (mag > 12 ? 6 : (mag + 1) >> 1); \
  |  |  ------------------
  |  |  |  Branch (509:24): [True: 9.27k, False: 122k]
  |  |  ------------------
  |  |  510|   131k|                tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|   131k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  511|   131k|                if (dbg) \
  |  |  ------------------
  |  |  |  Branch (511:21): [Folded, False: 131k]
  |  |  ------------------
  |  |  512|   131k|                    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|   131k|                *level = (uint8_t) (tok + (3 << 6)); \
  |  |  516|   131k|                cf[rc_i] = (tok << 11) | rc; \
  |  |  517|   131k|                rc = rc_i; \
  |  |  518|  3.03M|            } else { \
  |  |  519|  3.03M|                /* 0x1 for tok, 0x7ff as bitmask for rc, 0x41 for level_tok */ \
  |  |  520|  3.03M|                tok *= 0x17ff41; \
  |  |  521|  3.03M|                *level = (uint8_t) tok; \
  |  |  522|  3.03M|                /* tok ? (tok << 11) | rc : 0 */ \
  |  |  523|  3.03M|                tok = (tok >> 9) & (rc + ~0x7ffu); \
  |  |  524|  3.03M|                if (tok) rc = rc_i; \
  |  |  ------------------
  |  |  |  Branch (524:21): [True: 781k, False: 2.25M]
  |  |  ------------------
  |  |  525|  3.03M|                cf[rc_i] = tok; \
  |  |  526|  3.03M|            } \
  |  |  527|  3.16M|        } \
  |  |  528|   163k|        /* dc */ \
  |  |  529|   163k|        ctx = (tx_class == TX_CLASS_2D) ? 0 : \
  |  |  ------------------
  |  |  |  Branch (529:15): [Folded, False: 163k]
  |  |  ------------------
  |  |  530|   163k|            get_lo_ctx(levels, tx_class, &mag, lo_ctx_offsets, 0, 0, stride); \
  |  |  531|   163k|        dc_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|   163k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  532|   163k|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (532:13): [Folded, False: 163k]
  |  |  ------------------
  |  |  533|   163k|            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|   163k|        if (dc_tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (535:13): [True: 19.6k, False: 143k]
  |  |  ------------------
  |  |  536|  19.6k|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (536:17): [Folded, False: 19.6k]
  |  |  ------------------
  |  |  537|  19.6k|                mag = levels[0 * stride + 1] + levels[1 * stride + 0] + \
  |  |  538|      0|                      levels[1 * stride + 1]; \
  |  |  539|  19.6k|            mag &= 63; \
  |  |  540|  19.6k|            ctx = mag > 12 ? 6 : (mag + 1) >> 1; \
  |  |  ------------------
  |  |  |  Branch (540:19): [True: 2.75k, False: 16.9k]
  |  |  ------------------
  |  |  541|  19.6k|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  19.6k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  542|  19.6k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (542:17): [Folded, False: 19.6k]
  |  |  ------------------
  |  |  543|  19.6k|                printf("Post-dc_hi_tok[%d][%d][0][%d]: r=%d\n", \
  |  |  544|      0|                       imin(t_dim->ctx, 3), chroma, dc_tok, ts->msac.rng); \
  |  |  545|  19.6k|        } \
  |  |  546|   163k|        break
  ------------------
  |  Branch (567:13): [True: 3.16M, False: 0]
  |  Branch (567:13): [True: 3.16M, False: 0]
  ------------------
  568|   163k|        }
  569|  88.8k|        case TX_CLASS_V: {
  ------------------
  |  Branch (569:9): [True: 88.8k, False: 3.04M]
  ------------------
  570|  88.8k|            const uint8_t (*const lo_ctx_offsets)[5] = NULL;
  571|  88.8k|            const ptrdiff_t stride = 16;
  572|  88.8k|            const unsigned shift = slw + 2, shift2 = slh + 2;
  573|  88.8k|            const unsigned mask = (4 << slw) - 1;
  574|  88.8k|            memset(levels, 0, stride * ((4 << slw) + 2));
  575|  88.8k|            DECODE_COEFS_CLASS(TX_CLASS_V);
  ------------------
  |  |  459|  88.8k|        unsigned x, y; \
  |  |  460|  88.8k|        uint8_t *level; \
  |  |  461|  88.8k|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (461:13): [Folded, False: 88.8k]
  |  |  ------------------
  |  |  462|  88.8k|            rc = scan[eob], x = rc >> shift, y = rc & mask; \
  |  |  463|  88.8k|        else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (463:18): [Folded, False: 88.8k]
  |  |  ------------------
  |  |  464|  88.8k|            /* Transposing reduces the stride and padding requirements */ \
  |  |  465|  88.8k|            x = eob & mask, y = eob >> shift, rc = eob; \
  |  |  466|  88.8k|        else /* tx_class == TX_CLASS_V */ \
  |  |  467|  88.8k|            x = eob & mask, y = eob >> shift, rc = (x << shift2) | y; \
  |  |  468|  88.8k|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (468:13): [Folded, False: 88.8k]
  |  |  ------------------
  |  |  469|  88.8k|            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|  88.8k|        if (eob_tok == 2) { \
  |  |  ------------------
  |  |  |  Branch (471:13): [True: 3.54k, False: 85.2k]
  |  |  ------------------
  |  |  472|  3.54k|            ctx = (tx_class == TX_CLASS_2D ? (x | y) > 1 : y != 0) ? 14 : 7; \
  |  |  ------------------
  |  |  |  Branch (472:19): [True: 2.85k, False: 698]
  |  |  |  Branch (472:20): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  473|  3.54k|            tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  3.54k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  474|  3.54k|            level_tok = tok + (3 << 6); \
  |  |  475|  3.54k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (475:17): [Folded, False: 3.54k]
  |  |  ------------------
  |  |  476|  3.54k|                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|  3.54k|        } \
  |  |  480|  88.8k|        cf[rc] = tok << 11; \
  |  |  481|  88.8k|        if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (481:13): [Folded, False: 88.8k]
  |  |  ------------------
  |  |  482|  88.8k|            level = levels + rc; \
  |  |  483|  88.8k|        else \
  |  |  484|  88.8k|            level = levels + x * stride + y; \
  |  |  485|  88.8k|        *level = (uint8_t) level_tok; \
  |  |  486|  1.58M|        for (int i = eob - 1; i > 0; i--) { /* ac */ \
  |  |  ------------------
  |  |  |  Branch (486:31): [True: 1.49M, False: 88.8k]
  |  |  ------------------
  |  |  487|  1.49M|            unsigned rc_i; \
  |  |  488|  1.49M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (488:17): [Folded, False: 1.49M]
  |  |  ------------------
  |  |  489|  1.49M|                rc_i = scan[i], x = rc_i >> shift, y = rc_i & mask; \
  |  |  490|  1.49M|            else if (tx_class == TX_CLASS_H) \
  |  |  ------------------
  |  |  |  Branch (490:22): [Folded, False: 1.49M]
  |  |  ------------------
  |  |  491|  1.49M|                x = i & mask, y = i >> shift, rc_i = i; \
  |  |  492|  1.49M|            else /* tx_class == TX_CLASS_V */ \
  |  |  493|  1.49M|                x = i & mask, y = i >> shift, rc_i = (x << shift2) | y; \
  |  |  494|  1.49M|            assert(x < 32 && y < 32); \
  |  |  495|  1.49M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (495:17): [Folded, False: 1.49M]
  |  |  ------------------
  |  |  496|  1.49M|                level = levels + rc_i; \
  |  |  497|  1.49M|            else \
  |  |  498|  1.49M|                level = levels + x * stride + y; \
  |  |  499|  1.49M|            ctx = get_lo_ctx(level, tx_class, &mag, lo_ctx_offsets, x, y, stride); \
  |  |  500|  1.49M|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (500:17): [Folded, False: 1.49M]
  |  |  ------------------
  |  |  501|  1.49M|                y |= x; \
  |  |  502|  1.49M|            tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|  1.49M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  503|  1.49M|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (503:17): [Folded, False: 1.49M]
  |  |  ------------------
  |  |  504|  1.49M|                printf("Post-lo_tok[%d][%d][%d][%d=%d=%d]: r=%d\n", \
  |  |  505|      0|                       t_dim->ctx, chroma, ctx, i, rc_i, tok, ts->msac.rng); \
  |  |  506|  1.49M|            if (tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (506:17): [True: 57.9k, False: 1.43M]
  |  |  ------------------
  |  |  507|  57.9k|                mag &= 63; \
  |  |  508|  57.9k|                ctx = (y > (tx_class == TX_CLASS_2D) ? 14 : 7) + \
  |  |  ------------------
  |  |  |  Branch (508:24): [True: 33.1k, False: 24.7k]
  |  |  ------------------
  |  |  509|  57.9k|                      (mag > 12 ? 6 : (mag + 1) >> 1); \
  |  |  ------------------
  |  |  |  Branch (509:24): [True: 4.43k, False: 53.4k]
  |  |  ------------------
  |  |  510|  57.9k|                tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  57.9k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  511|  57.9k|                if (dbg) \
  |  |  ------------------
  |  |  |  Branch (511:21): [Folded, False: 57.9k]
  |  |  ------------------
  |  |  512|  57.9k|                    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|  57.9k|                *level = (uint8_t) (tok + (3 << 6)); \
  |  |  516|  57.9k|                cf[rc_i] = (tok << 11) | rc; \
  |  |  517|  57.9k|                rc = rc_i; \
  |  |  518|  1.43M|            } else { \
  |  |  519|  1.43M|                /* 0x1 for tok, 0x7ff as bitmask for rc, 0x41 for level_tok */ \
  |  |  520|  1.43M|                tok *= 0x17ff41; \
  |  |  521|  1.43M|                *level = (uint8_t) tok; \
  |  |  522|  1.43M|                /* tok ? (tok << 11) | rc : 0 */ \
  |  |  523|  1.43M|                tok = (tok >> 9) & (rc + ~0x7ffu); \
  |  |  524|  1.43M|                if (tok) rc = rc_i; \
  |  |  ------------------
  |  |  |  Branch (524:21): [True: 338k, False: 1.09M]
  |  |  ------------------
  |  |  525|  1.43M|                cf[rc_i] = tok; \
  |  |  526|  1.43M|            } \
  |  |  527|  1.49M|        } \
  |  |  528|  88.8k|        /* dc */ \
  |  |  529|  88.8k|        ctx = (tx_class == TX_CLASS_2D) ? 0 : \
  |  |  ------------------
  |  |  |  Branch (529:15): [Folded, False: 88.8k]
  |  |  ------------------
  |  |  530|  88.8k|            get_lo_ctx(levels, tx_class, &mag, lo_ctx_offsets, 0, 0, stride); \
  |  |  531|  88.8k|        dc_tok = dav1d_msac_decode_symbol_adapt4(&ts->msac, lo_cdf[ctx], 3); \
  |  |  ------------------
  |  |  |  |   47|  88.8k|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  |  |  ------------------
  |  |  532|  88.8k|        if (dbg) \
  |  |  ------------------
  |  |  |  Branch (532:13): [Folded, False: 88.8k]
  |  |  ------------------
  |  |  533|  88.8k|            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|  88.8k|        if (dc_tok == 3) { \
  |  |  ------------------
  |  |  |  Branch (535:13): [True: 9.85k, False: 78.9k]
  |  |  ------------------
  |  |  536|  9.85k|            if (tx_class == TX_CLASS_2D) \
  |  |  ------------------
  |  |  |  Branch (536:17): [Folded, False: 9.85k]
  |  |  ------------------
  |  |  537|  9.85k|                mag = levels[0 * stride + 1] + levels[1 * stride + 0] + \
  |  |  538|      0|                      levels[1 * stride + 1]; \
  |  |  539|  9.85k|            mag &= 63; \
  |  |  540|  9.85k|            ctx = mag > 12 ? 6 : (mag + 1) >> 1; \
  |  |  ------------------
  |  |  |  Branch (540:19): [True: 1.76k, False: 8.09k]
  |  |  ------------------
  |  |  541|  9.85k|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[ctx]); \
  |  |  ------------------
  |  |  |  |   49|  9.85k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  |  |  ------------------
  |  |  542|  9.85k|            if (dbg) \
  |  |  ------------------
  |  |  |  Branch (542:17): [Folded, False: 9.85k]
  |  |  ------------------
  |  |  543|  9.85k|                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|  9.85k|        } \
  |  |  546|  88.8k|        break
  ------------------
  |  Branch (575:13): [True: 1.49M, False: 0]
  |  Branch (575:13): [True: 1.49M, False: 0]
  ------------------
  576|  88.8k|        }
  577|      0|#undef DECODE_COEFS_CLASS
  578|      0|        default: assert(0);
  ------------------
  |  Branch (578:9): [True: 0, False: 3.12M]
  |  Branch (578:18): [Folded, False: 0]
  ------------------
  579|  3.12M|        }
  580|  3.12M|    } else { // dc-only
  581|  1.08M|        int tok_br = dav1d_msac_decode_symbol_adapt4(&ts->msac, eob_cdf[0], 2);
  ------------------
  |  |   47|  1.08M|#define dav1d_msac_decode_symbol_adapt4  dav1d_msac_decode_symbol_adapt4_sse2
  ------------------
  582|  1.08M|        dc_tok = 1 + tok_br;
  583|  1.08M|        if (dbg)
  ------------------
  |  Branch (583:13): [Folded, False: 1.08M]
  ------------------
  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|  1.08M|        if (tok_br == 2) {
  ------------------
  |  Branch (586:13): [True: 61.7k, False: 1.02M]
  ------------------
  587|  61.7k|            dc_tok = dav1d_msac_decode_hi_tok(&ts->msac, hi_cdf[0]);
  ------------------
  |  |   49|  61.7k|#define dav1d_msac_decode_hi_tok         dav1d_msac_decode_hi_tok_sse2
  ------------------
  588|  61.7k|            if (dbg)
  ------------------
  |  Branch (588:17): [Folded, False: 61.7k]
  ------------------
  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|  61.7k|        }
  592|  1.08M|        rc = 0;
  593|  1.08M|    }
  594|       |
  595|       |    // residual and sign
  596|  4.21M|    const uint16_t *const dq_tbl = ts->dq[b->seg_id][plane];
  597|  4.21M|    const uint8_t *const qm_tbl = *txtp < IDTX ? f->qm[tx][plane] : NULL;
  ------------------
  |  Branch (597:35): [True: 2.90M, False: 1.30M]
  ------------------
  598|  4.21M|    const int dq_shift = imax(0, t_dim->ctx - 2);
  599|  4.21M|    const int cf_max = ~(~127U << (BITDEPTH == 8 ? 8 : f->cur.p.bpc));
  ------------------
  |  Branch (599:36): [True: 1.88M, Folded]
  ------------------
  600|  4.21M|    unsigned cul_level, dc_sign_level;
  601|       |
  602|  4.21M|    if (!dc_tok) {
  ------------------
  |  Branch (602:9): [True: 776k, False: 3.43M]
  ------------------
  603|   776k|        cul_level = 0;
  604|   776k|        dc_sign_level = 1 << 6;
  605|   776k|        if (qm_tbl) goto ac_qm;
  ------------------
  |  Branch (605:13): [True: 114k, False: 661k]
  ------------------
  606|   661k|        goto ac_noqm;
  607|   776k|    }
  608|       |
  609|  3.43M|    const int dc_sign_ctx = get_dc_sign_ctx(tx, a, l);
  610|  3.43M|    uint16_t *const dc_sign_cdf = ts->cdf.coef.dc_sign[chroma][dc_sign_ctx];
  611|  3.43M|    const int dc_sign = dav1d_msac_decode_bool_adapt(&ts->msac, dc_sign_cdf);
  ------------------
  |  |   52|  3.43M|#define dav1d_msac_decode_bool_adapt     dav1d_msac_decode_bool_adapt_sse2
  ------------------
  612|  3.43M|    if (dbg)
  ------------------
  |  Branch (612:9): [Folded, False: 3.43M]
  ------------------
  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|  3.43M|    int dc_dq = dq_tbl[0];
  617|  3.43M|    dc_sign_level = (dc_sign - 1) & (2 << 6);
  618|       |
  619|  3.43M|    if (qm_tbl) {
  ------------------
  |  Branch (619:9): [True: 610k, False: 2.82M]
  ------------------
  620|   610k|        dc_dq = (dc_dq * qm_tbl[0] + 16) >> 5;
  621|       |
  622|   610k|        if (dc_tok == 15) {
  ------------------
  |  Branch (622:13): [True: 43.9k, False: 566k]
  ------------------
  623|  43.9k|            dc_tok = read_golomb(&ts->msac) + 15;
  624|  43.9k|            if (dbg)
  ------------------
  |  Branch (624:17): [Folded, False: 43.9k]
  ------------------
  625|      0|                printf("Post-dc_residual[%d->%d]: r=%d\n",
  626|      0|                       dc_tok - 15, dc_tok, ts->msac.rng);
  627|       |
  628|  43.9k|            dc_tok &= 0xfffff;
  629|  43.9k|            dc_dq = (dc_dq * dc_tok) & 0xffffff;
  630|   566k|        } else {
  631|   566k|            dc_dq *= dc_tok;
  632|   566k|            assert(dc_dq <= 0xffffff);
  ------------------
  |  Branch (632:13): [True: 566k, False: 0]
  ------------------
  633|   566k|        }
  634|   610k|        cul_level = dc_tok;
  635|   610k|        dc_dq >>= dq_shift;
  636|   610k|        dc_dq = umin(dc_dq, cf_max + dc_sign);
  637|   610k|        cf[0] = (coef) apply_sign_bool(dc_dq, dc_sign);
  638|       |
  639|   999k|        if (rc) ac_qm: {
  ------------------
  |  Branch (639:13): [True: 442k, False: 167k]
  ------------------
  640|   999k|            const unsigned ac_dq = dq_tbl[1];
  641|  10.6M|            do {
  642|  10.6M|                const int sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  10.6M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  643|  10.6M|                if (dbg)
  ------------------
  |  Branch (643:21): [Folded, False: 10.6M]
  ------------------
  644|      0|                    printf("Post-sign[%d=%d]: r=%d\n", rc, sign, ts->msac.rng);
  645|  10.6M|                const unsigned rc_tok = cf[rc];
  646|  10.6M|                unsigned tok, dq = (ac_dq * qm_tbl[rc] + 16) >> 5;
  647|  10.6M|                int dq_sat;
  648|       |
  649|  10.6M|                if (rc_tok >= (15 << 11)) {
  ------------------
  |  Branch (649:21): [True: 686k, False: 9.97M]
  ------------------
  650|   686k|                    tok = read_golomb(&ts->msac) + 15;
  651|   686k|                    if (dbg)
  ------------------
  |  Branch (651:25): [Folded, False: 686k]
  ------------------
  652|      0|                        printf("Post-residual[%d=%d->%d]: r=%d\n",
  653|      0|                               rc, tok - 15, tok, ts->msac.rng);
  654|       |
  655|   686k|                    tok &= 0xfffff;
  656|   686k|                    dq = (dq * tok) & 0xffffff;
  657|  9.97M|                } else {
  658|  9.97M|                    tok = rc_tok >> 11;
  659|  9.97M|                    dq *= tok;
  660|  9.97M|                    assert(dq <= 0xffffff);
  ------------------
  |  Branch (660:21): [True: 9.97M, False: 0]
  ------------------
  661|  9.97M|                }
  662|  10.6M|                cul_level += tok;
  663|  10.6M|                dq >>= dq_shift;
  664|  10.6M|                dq_sat = umin(dq, cf_max + sign);
  665|  10.6M|                cf[rc] = (coef) apply_sign_bool(dq_sat, sign);
  666|       |
  667|  10.6M|                rc = rc_tok & 0x3ff;
  668|  10.6M|            } while (rc);
  ------------------
  |  Branch (668:22): [True: 10.1M, False: 557k]
  ------------------
  669|   999k|        }
  670|  2.82M|    } else {
  671|       |        // non-qmatrix is the common case and allows for additional optimizations
  672|  2.82M|        if (dc_tok == 15) {
  ------------------
  |  Branch (672:13): [True: 101k, False: 2.72M]
  ------------------
  673|   101k|            dc_tok = read_golomb(&ts->msac) + 15;
  674|   101k|            if (dbg)
  ------------------
  |  Branch (674:17): [Folded, False: 101k]
  ------------------
  675|      0|                printf("Post-dc_residual[%d->%d]: r=%d\n",
  676|      0|                       dc_tok - 15, dc_tok, ts->msac.rng);
  677|       |
  678|   101k|            dc_tok &= 0xfffff;
  679|   101k|            dc_dq = ((dc_dq * dc_tok) & 0xffffff) >> dq_shift;
  680|   101k|            dc_dq = umin(dc_dq, cf_max + dc_sign);
  681|  2.72M|        } else {
  682|  2.72M|            dc_dq = ((dc_dq * dc_tok) >> dq_shift);
  683|  2.72M|            assert(dc_dq <= cf_max);
  ------------------
  |  Branch (683:13): [True: 2.72M, False: 0]
  ------------------
  684|  2.72M|        }
  685|  2.82M|        cul_level = dc_tok;
  686|  2.82M|        cf[0] = (coef) apply_sign_bool(dc_dq, dc_sign);
  687|       |
  688|  4.48M|        if (rc) ac_noqm: {
  ------------------
  |  Branch (688:13): [True: 1.91M, False: 915k]
  ------------------
  689|  4.48M|            const unsigned ac_dq = dq_tbl[1];
  690|  22.2M|            do {
  691|  22.2M|                const int sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  22.2M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  692|  22.2M|                if (dbg)
  ------------------
  |  Branch (692:21): [Folded, False: 22.2M]
  ------------------
  693|      0|                    printf("Post-sign[%d=%d]: r=%d\n", rc, sign, ts->msac.rng);
  694|  22.2M|                const unsigned rc_tok = cf[rc];
  695|  22.2M|                unsigned tok;
  696|  22.2M|                int dq;
  697|       |
  698|       |                // residual
  699|  22.2M|                if (rc_tok >= (15 << 11)) {
  ------------------
  |  Branch (699:21): [True: 855k, False: 21.4M]
  ------------------
  700|   855k|                    tok = read_golomb(&ts->msac) + 15;
  701|   855k|                    if (dbg)
  ------------------
  |  Branch (701:25): [Folded, False: 855k]
  ------------------
  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|   855k|                    tok &= 0xfffff;
  707|       |
  708|       |                    // dequant, see 7.12.3
  709|   855k|                    dq = ((ac_dq * tok) & 0xffffff) >> dq_shift;
  710|   855k|                    dq = umin(dq, cf_max + sign);
  711|  21.4M|                } else {
  712|       |                    // cannot exceed cf_max, so we can avoid the clipping
  713|  21.4M|                    tok = rc_tok >> 11;
  714|  21.4M|                    dq = ((ac_dq * tok) >> dq_shift);
  715|  21.4M|                    assert(dq <= cf_max);
  ------------------
  |  Branch (715:21): [True: 21.4M, False: 0]
  ------------------
  716|  21.4M|                }
  717|  22.2M|                cul_level += tok;
  718|  22.2M|                cf[rc] = (coef) apply_sign_bool(dq, sign);
  719|       |
  720|  22.2M|                rc = rc_tok & 0x3ff; // next non-zero rc, zero if eob
  721|  22.2M|            } while (rc);
  ------------------
  |  Branch (721:22): [True: 19.7M, False: 2.57M]
  ------------------
  722|  4.48M|        }
  723|  2.82M|    }
  724|       |
  725|       |    // context
  726|  4.21M|    *res_ctx = umin(cul_level, 63) | dc_sign_level;
  727|       |
  728|  4.21M|    return eob;
  729|  3.43M|}
recon_tmpl.c:get_skip_ctx:
   65|  8.77M|{
   66|  8.77M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
   67|       |
   68|  8.77M|    if (chroma) {
  ------------------
  |  Branch (68:9): [True: 4.36M, False: 4.41M]
  ------------------
   69|  4.36M|        const int ss_ver = layout == DAV1D_PIXEL_LAYOUT_I420;
   70|  4.36M|        const int ss_hor = layout != DAV1D_PIXEL_LAYOUT_I444;
   71|  4.36M|        const int not_one_blk = b_dim[2] - (!!b_dim[2] && ss_hor) > t_dim->lw ||
  ------------------
  |  Branch (71:33): [True: 1.40M, False: 2.95M]
  |  Branch (71:45): [True: 3.93M, False: 422k]
  |  Branch (71:59): [True: 812k, False: 3.12M]
  ------------------
   72|  2.95M|                                b_dim[3] - (!!b_dim[3] && ss_ver) > t_dim->lh;
  ------------------
  |  Branch (72:33): [True: 82.2k, False: 2.87M]
  |  Branch (72:45): [True: 2.29M, False: 667k]
  |  Branch (72:59): [True: 389k, False: 1.90M]
  ------------------
   73|  4.36M|        unsigned ca, cl;
   74|       |
   75|  4.36M|#define MERGE_CTX(dir, type, no_val) \
   76|  4.36M|        c##dir = *(const type *) dir != no_val; \
   77|  4.36M|        break
   78|       |
   79|  4.36M|        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: 4.36M]
  |  Branch (85:18): [Folded, False: 0]
  ------------------
   86|  1.23M|        case TX_4X4:   MERGE_CTX(a, uint8_t,  0x40);
  ------------------
  |  |   76|  1.23M|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  1.23M|        break
  ------------------
  |  Branch (86:9): [True: 1.23M, False: 3.12M]
  ------------------
   87|   901k|        case TX_8X8:   MERGE_CTX(a, uint16_t, 0x4040);
  ------------------
  |  |   76|   901k|        c##dir = *(const type *) dir != no_val; \
  |  |   77|   901k|        break
  ------------------
  |  Branch (87:9): [True: 901k, False: 3.45M]
  ------------------
   88|   960k|        case TX_16X16: MERGE_CTX(a, uint32_t, 0x40404040U);
  ------------------
  |  |   76|   960k|        c##dir = *(const type *) dir != no_val; \
  |  |   77|   960k|        break
  ------------------
  |  Branch (88:9): [True: 960k, False: 3.40M]
  ------------------
   89|  1.26M|        case TX_32X32: MERGE_CTX(a, uint64_t, 0x4040404040404040ULL);
  ------------------
  |  |   76|  1.26M|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  1.26M|        break
  ------------------
  |  Branch (89:9): [True: 1.26M, False: 3.09M]
  ------------------
   90|  4.36M|        }
   91|  4.36M|        switch (t_dim->lh) {
   92|      0|        default: assert(0); /* fall-through */
  ------------------
  |  Branch (92:9): [True: 0, False: 4.36M]
  |  Branch (92:18): [Folded, False: 0]
  ------------------
   93|  1.51M|        case TX_4X4:   MERGE_CTX(l, uint8_t,  0x40);
  ------------------
  |  |   76|  1.51M|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  1.51M|        break
  ------------------
  |  Branch (93:9): [True: 1.51M, False: 2.84M]
  ------------------
   94|  1.02M|        case TX_8X8:   MERGE_CTX(l, uint16_t, 0x4040);
  ------------------
  |  |   76|  1.02M|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  1.02M|        break
  ------------------
  |  Branch (94:9): [True: 1.02M, False: 3.33M]
  ------------------
   95|   778k|        case TX_16X16: MERGE_CTX(l, uint32_t, 0x40404040U);
  ------------------
  |  |   76|   778k|        c##dir = *(const type *) dir != no_val; \
  |  |   77|   778k|        break
  ------------------
  |  Branch (95:9): [True: 778k, False: 3.58M]
  ------------------
   96|  1.04M|        case TX_32X32: MERGE_CTX(l, uint64_t, 0x4040404040404040ULL);
  ------------------
  |  |   76|  1.04M|        c##dir = *(const type *) dir != no_val; \
  |  |   77|  1.04M|        break
  ------------------
  |  Branch (96:9): [True: 1.04M, False: 3.32M]
  ------------------
   97|  4.36M|        }
   98|  4.36M|#undef MERGE_CTX
   99|       |
  100|  4.36M|        return 7 + not_one_blk * 3 + ca + cl;
  101|  4.41M|    } else if (b_dim[2] == t_dim->lw && b_dim[3] == t_dim->lh) {
  ------------------
  |  Branch (101:16): [True: 1.98M, False: 2.43M]
  |  Branch (101:41): [True: 1.87M, False: 110k]
  ------------------
  102|  1.87M|        return 0;
  103|  2.54M|    } else {
  104|  2.54M|        unsigned la, ll;
  105|       |
  106|  2.54M|#define MERGE_CTX(dir, type, tx) \
  107|  2.54M|        if (tx == TX_64X64) { \
  108|  2.54M|            uint64_t tmp = *(const uint64_t *) dir; \
  109|  2.54M|            tmp |= *(const uint64_t *) &dir[8]; \
  110|  2.54M|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  111|  2.54M|        } else \
  112|  2.54M|            l##dir = *(const type *) dir; \
  113|  2.54M|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  114|  2.54M|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  115|  2.54M|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  116|  2.54M|        break
  117|       |
  118|  2.54M|        switch (t_dim->lw) {
  119|      0|        default: assert(0); /* fall-through */
  ------------------
  |  Branch (119:9): [True: 0, False: 2.54M]
  |  Branch (119:18): [Folded, False: 0]
  ------------------
  120|  1.33M|        case TX_4X4:   MERGE_CTX(a, uint8_t,  TX_4X4);
  ------------------
  |  |  107|  1.33M|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 1.33M]
  |  |  ------------------
  |  |  108|      0|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|      0|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|      0|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|      0|        } else \
  |  |  112|  1.33M|            l##dir = *(const type *) dir; \
  |  |  113|  1.33M|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 1.33M]
  |  |  ------------------
  |  |  114|  1.33M|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [Folded, False: 1.33M]
  |  |  ------------------
  |  |  115|  1.33M|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [Folded, False: 1.33M]
  |  |  ------------------
  |  |  116|  1.33M|        break
  ------------------
  |  Branch (120:9): [True: 1.33M, False: 1.20M]
  ------------------
  121|   726k|        case TX_8X8:   MERGE_CTX(a, uint16_t, TX_8X8);
  ------------------
  |  |  107|   726k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 726k]
  |  |  ------------------
  |  |  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|   726k|            l##dir = *(const type *) dir; \
  |  |  113|   726k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 726k]
  |  |  ------------------
  |  |  114|   726k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [Folded, False: 726k]
  |  |  ------------------
  |  |  115|   726k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 726k, Folded]
  |  |  ------------------
  |  |  116|   726k|        break
  ------------------
  |  Branch (121:9): [True: 726k, False: 1.81M]
  ------------------
  122|   348k|        case TX_16X16: MERGE_CTX(a, uint32_t, TX_16X16);
  ------------------
  |  |  107|   348k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 348k]
  |  |  ------------------
  |  |  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|   348k|            l##dir = *(const type *) dir; \
  |  |  113|   348k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 348k]
  |  |  ------------------
  |  |  114|   348k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 348k, Folded]
  |  |  ------------------
  |  |  115|   348k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 348k, Folded]
  |  |  ------------------
  |  |  116|   348k|        break
  ------------------
  |  Branch (122:9): [True: 348k, False: 2.19M]
  ------------------
  123|  31.2k|        case TX_32X32: MERGE_CTX(a, uint32_t, TX_32X32);
  ------------------
  |  |  107|  31.2k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 31.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|  31.2k|            l##dir = *(const type *) dir; \
  |  |  113|  31.2k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 31.2k, Folded]
  |  |  ------------------
  |  |  114|  31.2k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 31.2k, Folded]
  |  |  ------------------
  |  |  115|  31.2k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 31.2k, Folded]
  |  |  ------------------
  |  |  116|  31.2k|        break
  ------------------
  |  Branch (123:9): [True: 31.2k, False: 2.51M]
  ------------------
  124|   103k|        case TX_64X64: MERGE_CTX(a, uint32_t, TX_64X64);
  ------------------
  |  |  107|   103k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [True: 103k, Folded]
  |  |  ------------------
  |  |  108|   103k|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|   103k|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|   103k|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|   103k|        } else \
  |  |  112|   103k|            l##dir = *(const type *) dir; \
  |  |  113|   103k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 103k]
  |  |  ------------------
  |  |  114|   103k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 103k, Folded]
  |  |  ------------------
  |  |  115|   103k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 103k, Folded]
  |  |  ------------------
  |  |  116|   103k|        break
  ------------------
  |  Branch (124:9): [True: 103k, False: 2.43M]
  ------------------
  125|  2.54M|        }
  126|  2.54M|        switch (t_dim->lh) {
  127|      0|        default: assert(0); /* fall-through */
  ------------------
  |  Branch (127:9): [True: 0, False: 2.54M]
  |  Branch (127:18): [Folded, False: 0]
  ------------------
  128|  1.34M|        case TX_4X4:   MERGE_CTX(l, uint8_t,  TX_4X4);
  ------------------
  |  |  107|  1.34M|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 1.34M]
  |  |  ------------------
  |  |  108|      0|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|      0|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|      0|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|      0|        } else \
  |  |  112|  1.34M|            l##dir = *(const type *) dir; \
  |  |  113|  1.34M|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 1.34M]
  |  |  ------------------
  |  |  114|  1.34M|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [Folded, False: 1.34M]
  |  |  ------------------
  |  |  115|  1.34M|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [Folded, False: 1.34M]
  |  |  ------------------
  |  |  116|  1.34M|        break
  ------------------
  |  Branch (128:9): [True: 1.34M, False: 1.19M]
  ------------------
  129|   717k|        case TX_8X8:   MERGE_CTX(l, uint16_t, TX_8X8);
  ------------------
  |  |  107|   717k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 717k]
  |  |  ------------------
  |  |  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|   717k|            l##dir = *(const type *) dir; \
  |  |  113|   717k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 717k]
  |  |  ------------------
  |  |  114|   717k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [Folded, False: 717k]
  |  |  ------------------
  |  |  115|   717k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 717k, Folded]
  |  |  ------------------
  |  |  116|   717k|        break
  ------------------
  |  Branch (129:9): [True: 717k, False: 1.82M]
  ------------------
  130|   343k|        case TX_16X16: MERGE_CTX(l, uint32_t, TX_16X16);
  ------------------
  |  |  107|   343k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 343k]
  |  |  ------------------
  |  |  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|   343k|            l##dir = *(const type *) dir; \
  |  |  113|   343k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 343k]
  |  |  ------------------
  |  |  114|   343k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 343k, Folded]
  |  |  ------------------
  |  |  115|   343k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 343k, Folded]
  |  |  ------------------
  |  |  116|   343k|        break
  ------------------
  |  Branch (130:9): [True: 343k, False: 2.19M]
  ------------------
  131|  30.8k|        case TX_32X32: MERGE_CTX(l, uint32_t, TX_32X32);
  ------------------
  |  |  107|  30.8k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [Folded, False: 30.8k]
  |  |  ------------------
  |  |  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.8k|            l##dir = *(const type *) dir; \
  |  |  113|  30.8k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [True: 30.8k, Folded]
  |  |  ------------------
  |  |  114|  30.8k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 30.8k, Folded]
  |  |  ------------------
  |  |  115|  30.8k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 30.8k, Folded]
  |  |  ------------------
  |  |  116|  30.8k|        break
  ------------------
  |  Branch (131:9): [True: 30.8k, False: 2.51M]
  ------------------
  132|   103k|        case TX_64X64: MERGE_CTX(l, uint32_t, TX_64X64);
  ------------------
  |  |  107|   103k|        if (tx == TX_64X64) { \
  |  |  ------------------
  |  |  |  Branch (107:13): [True: 103k, Folded]
  |  |  ------------------
  |  |  108|   103k|            uint64_t tmp = *(const uint64_t *) dir; \
  |  |  109|   103k|            tmp |= *(const uint64_t *) &dir[8]; \
  |  |  110|   103k|            l##dir = (unsigned) (tmp >> 32) | (unsigned) tmp; \
  |  |  111|   103k|        } else \
  |  |  112|   103k|            l##dir = *(const type *) dir; \
  |  |  113|   103k|        if (tx == TX_32X32) l##dir |= *(const type *) &dir[sizeof(type)]; \
  |  |  ------------------
  |  |  |  Branch (113:13): [Folded, False: 103k]
  |  |  ------------------
  |  |  114|   103k|        if (tx >= TX_16X16) l##dir |= l##dir >> 16; \
  |  |  ------------------
  |  |  |  Branch (114:13): [True: 103k, Folded]
  |  |  ------------------
  |  |  115|   103k|        if (tx >= TX_8X8)   l##dir |= l##dir >> 8; \
  |  |  ------------------
  |  |  |  Branch (115:13): [True: 103k, Folded]
  |  |  ------------------
  |  |  116|   103k|        break
  ------------------
  |  Branch (132:9): [True: 103k, False: 2.43M]
  ------------------
  133|  2.54M|        }
  134|  2.54M|#undef MERGE_CTX
  135|       |
  136|  2.54M|        return dav1d_skip_ctx[umin(la & 0x3F, 4)][umin(ll & 0x3F, 4)];
  137|  2.54M|    }
  138|  8.77M|}
recon_tmpl.c:get_lo_ctx:
  304|  84.8M|{
  305|  84.8M|    unsigned mag = levels[0 * stride + 1] + levels[1 * stride + 0];
  306|  84.8M|    unsigned offset;
  307|  84.8M|    if (tx_class == TX_CLASS_2D) {
  ------------------
  |  Branch (307:9): [True: 79.9M, False: 4.90M]
  ------------------
  308|  79.9M|        mag += levels[1 * stride + 1];
  309|  79.9M|        *hi_mag = mag;
  310|  79.9M|        mag += levels[0 * stride + 2] + levels[2 * stride + 0];
  311|  79.9M|        offset = ctx_offsets[umin(y, 4)][umin(x, 4)];
  312|  79.9M|    } else {
  313|  4.90M|        mag += levels[0 * stride + 2];
  314|  4.90M|        *hi_mag = mag;
  315|  4.90M|        mag += levels[0 * stride + 3] + levels[0 * stride + 4];
  316|  4.90M|        offset = 26 + (y > 1 ? 10 : y * 5);
  ------------------
  |  Branch (316:24): [True: 2.22M, False: 2.68M]
  ------------------
  317|  4.90M|    }
  318|  84.8M|    return offset + (mag > 512 ? 4 : (mag + 64) >> 7);
  ------------------
  |  Branch (318:22): [True: 6.06M, False: 78.7M]
  ------------------
  319|  84.8M|}
recon_tmpl.c:get_dc_sign_ctx:
  143|  3.43M|{
  144|  3.43M|    uint64_t mask = 0xC0C0C0C0C0C0C0C0ULL, mul = 0x0101010101010101ULL;
  145|  3.43M|    int s;
  146|       |
  147|  3.43M|#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|  3.43M|    __asm__("" : "+r"(mask), "+r"(mul));
  151|  3.43M|#endif
  152|       |
  153|  3.43M|    switch(tx) {
  154|      0|    default: assert(0); /* fall-through */
  ------------------
  |  Branch (154:5): [True: 0, False: 3.43M]
  |  Branch (154:14): [Folded, False: 0]
  ------------------
  155|  1.05M|    case TX_4X4: {
  ------------------
  |  Branch (155:5): [True: 1.05M, False: 2.37M]
  ------------------
  156|  1.05M|        int t = *(const uint8_t *) a >> 6;
  157|  1.05M|        t    += *(const uint8_t *) l >> 6;
  158|  1.05M|        s = t - 1 - 1;
  159|  1.05M|        break;
  160|      0|    }
  161|   483k|    case TX_8X8: {
  ------------------
  |  Branch (161:5): [True: 483k, False: 2.95M]
  ------------------
  162|   483k|        uint32_t t = *(const uint16_t *) a & (uint32_t) mask;
  163|   483k|        t         += *(const uint16_t *) l & (uint32_t) mask;
  164|   483k|        t *= 0x04040404U;
  165|   483k|        s = (int) (t >> 24) - 2 - 2;
  166|   483k|        break;
  167|      0|    }
  168|   306k|    case TX_16X16: {
  ------------------
  |  Branch (168:5): [True: 306k, False: 3.13M]
  ------------------
  169|   306k|        uint32_t t = (*(const uint32_t *) a & (uint32_t) mask) >> 6;
  170|   306k|        t         += (*(const uint32_t *) l & (uint32_t) mask) >> 6;
  171|   306k|        t *= (uint32_t) mul;
  172|   306k|        s = (int) (t >> 24) - 4 - 4;
  173|   306k|        break;
  174|      0|    }
  175|   275k|    case TX_32X32: {
  ------------------
  |  Branch (175:5): [True: 275k, False: 3.16M]
  ------------------
  176|   275k|        uint64_t t = (*(const uint64_t *) a & mask) >> 6;
  177|   275k|        t         += (*(const uint64_t *) l & mask) >> 6;
  178|   275k|        t *= mul;
  179|   275k|        s = (int) (t >> 56) - 8 - 8;
  180|   275k|        break;
  181|      0|    }
  182|  95.9k|    case TX_64X64: {
  ------------------
  |  Branch (182:5): [True: 95.9k, False: 3.34M]
  ------------------
  183|  95.9k|        uint64_t t = (*(const uint64_t *) &a[0] & mask) >> 6;
  184|  95.9k|        t         += (*(const uint64_t *) &a[8] & mask) >> 6;
  185|  95.9k|        t         += (*(const uint64_t *) &l[0] & mask) >> 6;
  186|  95.9k|        t         += (*(const uint64_t *) &l[8] & mask) >> 6;
  187|  95.9k|        t *= mul;
  188|  95.9k|        s = (int) (t >> 56) - 16 - 16;
  189|  95.9k|        break;
  190|      0|    }
  191|  97.8k|    case RTX_4X8: {
  ------------------
  |  Branch (191:5): [True: 97.8k, False: 3.33M]
  ------------------
  192|  97.8k|        uint32_t t = *(const uint8_t  *) a & (uint32_t) mask;
  193|  97.8k|        t         += *(const uint16_t *) l & (uint32_t) mask;
  194|  97.8k|        t *= 0x04040404U;
  195|  97.8k|        s = (int) (t >> 24) - 1 - 2;
  196|  97.8k|        break;
  197|      0|    }
  198|   165k|    case RTX_8X4: {
  ------------------
  |  Branch (198:5): [True: 165k, False: 3.27M]
  ------------------
  199|   165k|        uint32_t t = *(const uint16_t *) a & (uint32_t) mask;
  200|   165k|        t         += *(const uint8_t  *) l & (uint32_t) mask;
  201|   165k|        t *= 0x04040404U;
  202|   165k|        s = (int) (t >> 24) - 2 - 1;
  203|   165k|        break;
  204|      0|    }
  205|   111k|    case RTX_8X16: {
  ------------------
  |  Branch (205:5): [True: 111k, False: 3.32M]
  ------------------
  206|   111k|        uint32_t t = *(const uint16_t *) a & (uint32_t) mask;
  207|   111k|        t         += *(const uint32_t *) l & (uint32_t) mask;
  208|   111k|        t = (t >> 6) * (uint32_t) mul;
  209|   111k|        s = (int) (t >> 24) - 2 - 4;
  210|   111k|        break;
  211|      0|    }
  212|   235k|    case RTX_16X8: {
  ------------------
  |  Branch (212:5): [True: 235k, False: 3.20M]
  ------------------
  213|   235k|        uint32_t t = *(const uint32_t *) a & (uint32_t) mask;
  214|   235k|        t         += *(const uint16_t *) l & (uint32_t) mask;
  215|   235k|        t = (t >> 6) * (uint32_t) mul;
  216|   235k|        s = (int) (t >> 24) - 4 - 2;
  217|   235k|        break;
  218|      0|    }
  219|  54.2k|    case RTX_16X32: {
  ------------------
  |  Branch (219:5): [True: 54.2k, False: 3.38M]
  ------------------
  220|  54.2k|        uint64_t t = *(const uint32_t *) a & (uint32_t) mask;
  221|  54.2k|        t         += *(const uint64_t *) l & mask;
  222|  54.2k|        t = (t >> 6) * mul;
  223|  54.2k|        s = (int) (t >> 56) - 4 - 8;
  224|  54.2k|        break;
  225|      0|    }
  226|   115k|    case RTX_32X16: {
  ------------------
  |  Branch (226:5): [True: 115k, False: 3.32M]
  ------------------
  227|   115k|        uint64_t t = *(const uint64_t *) a & mask;
  228|   115k|        t         += *(const uint32_t *) l & (uint32_t) mask;
  229|   115k|        t = (t >> 6) * mul;
  230|   115k|        s = (int) (t >> 56) - 8 - 4;
  231|   115k|        break;
  232|      0|    }
  233|  7.66k|    case RTX_32X64: {
  ------------------
  |  Branch (233:5): [True: 7.66k, False: 3.42M]
  ------------------
  234|  7.66k|        uint64_t t = (*(const uint64_t *) &a[0] & mask) >> 6;
  235|  7.66k|        t         += (*(const uint64_t *) &l[0] & mask) >> 6;
  236|  7.66k|        t         += (*(const uint64_t *) &l[8] & mask) >> 6;
  237|  7.66k|        t *= mul;
  238|  7.66k|        s = (int) (t >> 56) - 8 - 16;
  239|  7.66k|        break;
  240|      0|    }
  241|  32.6k|    case RTX_64X32: {
  ------------------
  |  Branch (241:5): [True: 32.6k, False: 3.40M]
  ------------------
  242|  32.6k|        uint64_t t = (*(const uint64_t *) &a[0] & mask) >> 6;
  243|  32.6k|        t         += (*(const uint64_t *) &a[8] & mask) >> 6;
  244|  32.6k|        t         += (*(const uint64_t *) &l[0] & mask) >> 6;
  245|  32.6k|        t *= mul;
  246|  32.6k|        s = (int) (t >> 56) - 16 - 8;
  247|  32.6k|        break;
  248|      0|    }
  249|  69.9k|    case RTX_4X16: {
  ------------------
  |  Branch (249:5): [True: 69.9k, False: 3.36M]
  ------------------
  250|  69.9k|        uint32_t t = *(const uint8_t  *) a & (uint32_t) mask;
  251|  69.9k|        t         += *(const uint32_t *) l & (uint32_t) mask;
  252|  69.9k|        t = (t >> 6) * (uint32_t) mul;
  253|  69.9k|        s = (int) (t >> 24) - 1 - 4;
  254|  69.9k|        break;
  255|      0|    }
  256|   169k|    case RTX_16X4: {
  ------------------
  |  Branch (256:5): [True: 169k, False: 3.26M]
  ------------------
  257|   169k|        uint32_t t = *(const uint32_t *) a & (uint32_t) mask;
  258|   169k|        t         += *(const uint8_t  *) l & (uint32_t) mask;
  259|   169k|        t = (t >> 6) * (uint32_t) mul;
  260|   169k|        s = (int) (t >> 24) - 4 - 1;
  261|   169k|        break;
  262|      0|    }
  263|  36.6k|    case RTX_8X32: {
  ------------------
  |  Branch (263:5): [True: 36.6k, False: 3.39M]
  ------------------
  264|  36.6k|        uint64_t t = *(const uint16_t *) a & (uint32_t) mask;
  265|  36.6k|        t         += *(const uint64_t *) l & mask;
  266|  36.6k|        t = (t >> 6) * mul;
  267|  36.6k|        s = (int) (t >> 56) - 2 - 8;
  268|  36.6k|        break;
  269|      0|    }
  270|  86.2k|    case RTX_32X8: {
  ------------------
  |  Branch (270:5): [True: 86.2k, False: 3.34M]
  ------------------
  271|  86.2k|        uint64_t t = *(const uint64_t *) a & mask;
  272|  86.2k|        t         += *(const uint16_t *) l & (uint32_t) mask;
  273|  86.2k|        t = (t >> 6) * mul;
  274|  86.2k|        s = (int) (t >> 56) - 8 - 2;
  275|  86.2k|        break;
  276|      0|    }
  277|  11.8k|    case RTX_16X64: {
  ------------------
  |  Branch (277:5): [True: 11.8k, False: 3.42M]
  ------------------
  278|  11.8k|        uint64_t t = *(const uint32_t *) a & (uint32_t) mask;
  279|  11.8k|        t         += *(const uint64_t *) &l[0] & mask;
  280|  11.8k|        t = (t >> 6) + ((*(const uint64_t *) &l[8] & mask) >> 6);
  281|  11.8k|        t *= mul;
  282|  11.8k|        s = (int) (t >> 56) - 4 - 16;
  283|  11.8k|        break;
  284|      0|    }
  285|  22.8k|    case RTX_64X16: {
  ------------------
  |  Branch (285:5): [True: 22.8k, False: 3.41M]
  ------------------
  286|  22.8k|        uint64_t t = *(const uint64_t *) &a[0] & mask;
  287|  22.8k|        t         += *(const uint32_t *) l & (uint32_t) mask;
  288|  22.8k|        t = (t >> 6) + ((*(const uint64_t *) &a[8] & mask) >> 6);
  289|  22.8k|        t *= mul;
  290|  22.8k|        s = (int) (t >> 56) - 16 - 4;
  291|  22.8k|        break;
  292|      0|    }
  293|  3.43M|    }
  294|       |
  295|  3.43M|    return (s != 0) + (s > 0);
  296|  3.43M|}
recon_tmpl.c:read_golomb:
   49|  1.68M|static inline unsigned read_golomb(MsacContext *const msac) {
   50|  1.68M|    int len = 0;
   51|  1.68M|    unsigned val = 1;
   52|       |
   53|  3.45M|    while (!dav1d_msac_decode_bool_equi(msac) && len < 32) len++;
  ------------------
  |  |   53|  3.45M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (53:12): [True: 1.76M, False: 1.68M]
  |  Branch (53:50): [True: 1.76M, False: 157]
  ------------------
   54|  3.45M|    while (len--) val = (val << 1) + dav1d_msac_decode_bool_equi(msac);
  ------------------
  |  |   53|  1.76M|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (54:12): [True: 1.76M, False: 1.68M]
  ------------------
   55|       |
   56|  1.68M|    return val - 1;
   57|  1.68M|}
recon_tmpl.c:mc:
  944|  4.05M|{
  945|  4.05M|    assert((dst8 != NULL) ^ (dst16 != NULL));
  ------------------
  |  Branch (945:5): [True: 4.05M, False: 0]
  ------------------
  946|  4.05M|    const Dav1dFrameContext *const f = t->f;
  947|  4.05M|    const int ss_ver = !!pl && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (947:24): [True: 1.97M, False: 2.08M]
  |  Branch (947:32): [True: 706k, False: 1.26M]
  ------------------
  948|  4.05M|    const int ss_hor = !!pl && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (948:24): [True: 1.97M, False: 2.08M]
  |  Branch (948:32): [True: 710k, False: 1.26M]
  ------------------
  949|  4.05M|    const int h_mul = 4 >> ss_hor, v_mul = 4 >> ss_ver;
  950|  4.05M|    const int mvx = mv.x, mvy = mv.y;
  951|  4.05M|    const int mx = mvx & (15 >> !ss_hor), my = mvy & (15 >> !ss_ver);
  952|  4.05M|    ptrdiff_t ref_stride = refp->p.stride[!!pl];
  953|  4.05M|    const pixel *ref;
  954|       |
  955|  4.05M|    if (refp->p.p.w == f->cur.p.w && refp->p.p.h == f->cur.p.h) {
  ------------------
  |  Branch (955:9): [True: 3.00M, False: 1.05M]
  |  Branch (955:38): [True: 2.97M, False: 34.7k]
  ------------------
  956|  2.97M|        const int dx = bx * h_mul + (mvx >> (3 + ss_hor));
  957|  2.97M|        const int dy = by * v_mul + (mvy >> (3 + ss_ver));
  958|  2.97M|        int w, h;
  959|       |
  960|  2.97M|        if (refp->p.data[0] != f->cur.data[0]) { // i.e. not for intrabc
  ------------------
  |  Branch (960:13): [True: 1.49M, False: 1.47M]
  ------------------
  961|  1.49M|            w = (f->cur.p.w + ss_hor) >> ss_hor;
  962|  1.49M|            h = (f->cur.p.h + ss_ver) >> ss_ver;
  963|  1.49M|        } else {
  964|  1.47M|            w = f->bw * 4 >> ss_hor;
  965|  1.47M|            h = f->bh * 4 >> ss_ver;
  966|  1.47M|        }
  967|  2.97M|        if (dx < !!mx * 3 || dy < !!my * 3 ||
  ------------------
  |  Branch (967:13): [True: 53.7k, False: 2.91M]
  |  Branch (967:30): [True: 47.7k, False: 2.86M]
  ------------------
  968|  2.86M|            dx + bw4 * h_mul + !!mx * 4 > w ||
  ------------------
  |  Branch (968:13): [True: 103k, False: 2.76M]
  ------------------
  969|  2.76M|            dy + bh4 * v_mul + !!my * 4 > h)
  ------------------
  |  Branch (969:13): [True: 246k, False: 2.51M]
  ------------------
  970|   451k|        {
  971|   451k|            pixel *const emu_edge_buf = bitfn(t->scratch.emu_edge);
  ------------------
  |  |   51|   451k|#define bitfn(x) x##_8bpc
  ------------------
  972|   451k|            f->dsp->mc.emu_edge(bw4 * h_mul + !!mx * 7, bh4 * v_mul + !!my * 7,
  973|   451k|                                w, h, dx - !!mx * 3, dy - !!my * 3,
  974|   451k|                                emu_edge_buf, 192 * sizeof(pixel),
  975|   451k|                                refp->p.data[pl], ref_stride);
  976|   451k|            ref = &emu_edge_buf[192 * !!my * 3 + !!mx * 3];
  977|   451k|            ref_stride = 192 * sizeof(pixel);
  978|  2.51M|        } else {
  979|  2.51M|            ref = ((pixel *) refp->p.data[pl]) + PXSTRIDE(ref_stride) * dy + dx;
  ------------------
  |  |   53|  2.51M|#define PXSTRIDE(x) (x)
  ------------------
  980|  2.51M|        }
  981|       |
  982|  2.97M|        if (dst8 != NULL) {
  ------------------
  |  Branch (982:13): [True: 2.68M, False: 287k]
  ------------------
  983|  2.68M|            f->dsp->mc.mc[filter_2d](dst8, dst_stride, ref, ref_stride, bw4 * h_mul,
  984|  2.68M|                                     bh4 * v_mul, mx << !ss_hor, my << !ss_ver
  985|  2.68M|                                     HIGHBD_CALL_SUFFIX);
  986|  2.68M|        } else {
  987|   287k|            f->dsp->mc.mct[filter_2d](dst16, ref, ref_stride, bw4 * h_mul,
  988|   287k|                                      bh4 * v_mul, mx << !ss_hor, my << !ss_ver
  989|   287k|                                      HIGHBD_CALL_SUFFIX);
  990|   287k|        }
  991|  2.97M|    } else {
  992|  1.08M|        assert(refp != &f->sr_cur);
  ------------------
  |  Branch (992:9): [True: 1.08M, False: 0]
  ------------------
  993|       |
  994|  1.08M|        const int orig_pos_y = (by * v_mul << 4) + mvy * (1 << !ss_ver);
  995|  1.08M|        const int orig_pos_x = (bx * h_mul << 4) + mvx * (1 << !ss_hor);
  996|  1.08M|#define scale_mv(res, val, scale) do { \
  997|  1.08M|            const int64_t tmp = (int64_t)(val) * scale + (scale - 0x4000) * 8; \
  998|  1.08M|            res = apply_sign64((int) ((llabs(tmp) + 128) >> 8), tmp) + 32;     \
  999|  1.08M|        } while (0)
 1000|  1.08M|        int pos_y, pos_x;
 1001|  1.08M|        scale_mv(pos_x, orig_pos_x, f->svc[refidx][0].scale);
  ------------------
  |  |  996|  1.08M|#define scale_mv(res, val, scale) do { \
  |  |  997|  1.08M|            const int64_t tmp = (int64_t)(val) * scale + (scale - 0x4000) * 8; \
  |  |  998|  1.08M|            res = apply_sign64((int) ((llabs(tmp) + 128) >> 8), tmp) + 32;     \
  |  |  999|  1.08M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (999:18): [Folded, False: 1.08M]
  |  |  ------------------
  ------------------
 1002|  1.08M|        scale_mv(pos_y, orig_pos_y, f->svc[refidx][1].scale);
  ------------------
  |  |  996|  1.08M|#define scale_mv(res, val, scale) do { \
  |  |  997|  1.08M|            const int64_t tmp = (int64_t)(val) * scale + (scale - 0x4000) * 8; \
  |  |  998|  1.08M|            res = apply_sign64((int) ((llabs(tmp) + 128) >> 8), tmp) + 32;     \
  |  |  999|  1.08M|        } while (0)
  |  |  ------------------
  |  |  |  Branch (999:18): [Folded, False: 1.08M]
  |  |  ------------------
  ------------------
 1003|  1.08M|#undef scale_mv
 1004|  1.08M|        const int left = pos_x >> 10;
 1005|  1.08M|        const int top = pos_y >> 10;
 1006|  1.08M|        const int right =
 1007|  1.08M|            ((pos_x + (bw4 * h_mul - 1) * f->svc[refidx][0].step) >> 10) + 1;
 1008|  1.08M|        const int bottom =
 1009|  1.08M|            ((pos_y + (bh4 * v_mul - 1) * f->svc[refidx][1].step) >> 10) + 1;
 1010|       |
 1011|  1.08M|        if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.08M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.08M]
  |  |  ------------------
  |  |   35|  1.08M|        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.08M|        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|  1.08M|        const int w = (refp->p.p.w + ss_hor) >> ss_hor;
 1018|  1.08M|        const int h = (refp->p.p.h + ss_ver) >> ss_ver;
 1019|  1.08M|        if (left < 3 || top < 3 || right + 4 > w || bottom + 4 > h) {
  ------------------
  |  Branch (1019:13): [True: 97.4k, False: 988k]
  |  Branch (1019:25): [True: 266k, False: 722k]
  |  Branch (1019:36): [True: 86.7k, False: 635k]
  |  Branch (1019:53): [True: 64.3k, False: 571k]
  ------------------
 1020|   514k|            pixel *const emu_edge_buf = bitfn(t->scratch.emu_edge);
  ------------------
  |  |   51|   514k|#define bitfn(x) x##_8bpc
  ------------------
 1021|   514k|            f->dsp->mc.emu_edge(right - left + 7, bottom - top + 7,
 1022|   514k|                                w, h, left - 3, top - 3,
 1023|   514k|                                emu_edge_buf, 320 * sizeof(pixel),
 1024|   514k|                                refp->p.data[pl], ref_stride);
 1025|   514k|            ref = &emu_edge_buf[320 * 3 + 3];
 1026|   514k|            ref_stride = 320 * sizeof(pixel);
 1027|   514k|            if (DEBUG_BLOCK_INFO) printf("Emu\n");
  ------------------
  |  |   34|   514k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 514k]
  |  |  ------------------
  |  |   35|   514k|        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|   514k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1028|   571k|        } else {
 1029|   571k|            ref = ((pixel *) refp->p.data[pl]) + PXSTRIDE(ref_stride) * top + left;
  ------------------
  |  |   53|   571k|#define PXSTRIDE(x) (x)
  ------------------
 1030|   571k|        }
 1031|       |
 1032|  1.08M|        if (dst8 != NULL) {
  ------------------
  |  Branch (1032:13): [True: 756k, False: 329k]
  ------------------
 1033|   756k|            f->dsp->mc.mc_scaled[filter_2d](dst8, dst_stride, ref, ref_stride,
 1034|   756k|                                            bw4 * h_mul, bh4 * v_mul,
 1035|   756k|                                            pos_x & 0x3ff, pos_y & 0x3ff,
 1036|   756k|                                            f->svc[refidx][0].step,
 1037|   756k|                                            f->svc[refidx][1].step
 1038|   756k|                                            HIGHBD_CALL_SUFFIX);
 1039|   756k|        } else {
 1040|   329k|            f->dsp->mc.mct_scaled[filter_2d](dst16, ref, ref_stride,
 1041|   329k|                                             bw4 * h_mul, bh4 * v_mul,
 1042|   329k|                                             pos_x & 0x3ff, pos_y & 0x3ff,
 1043|   329k|                                             f->svc[refidx][0].step,
 1044|   329k|                                             f->svc[refidx][1].step
 1045|   329k|                                             HIGHBD_CALL_SUFFIX);
 1046|   329k|        }
 1047|  1.08M|    }
 1048|       |
 1049|  4.05M|    return 0;
 1050|  4.05M|}
recon_tmpl.c:warp_affine:
 1120|   107k|{
 1121|   107k|    assert((dst8 != NULL) ^ (dst16 != NULL));
  ------------------
  |  Branch (1121:5): [True: 107k, False: 0]
  ------------------
 1122|   107k|    const Dav1dFrameContext *const f = t->f;
 1123|   107k|    const Dav1dDSPContext *const dsp = f->dsp;
 1124|   107k|    const int ss_ver = !!pl && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (1124:24): [True: 35.6k, False: 71.7k]
  |  Branch (1124:32): [True: 24.5k, False: 11.1k]
  ------------------
 1125|   107k|    const int ss_hor = !!pl && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (1125:24): [True: 35.6k, False: 71.7k]
  |  Branch (1125:32): [True: 24.5k, False: 11.1k]
  ------------------
 1126|   107k|    const int h_mul = 4 >> ss_hor, v_mul = 4 >> ss_ver;
 1127|   107k|    assert(!((b_dim[0] * h_mul) & 7) && !((b_dim[1] * v_mul) & 7));
  ------------------
  |  Branch (1127:5): [True: 107k, False: 0]
  |  Branch (1127:5): [True: 107k, False: 0]
  ------------------
 1128|   107k|    const int32_t *const mat = wmp->matrix;
 1129|   107k|    const int width = (refp->p.p.w + ss_hor) >> ss_hor;
 1130|   107k|    const int height = (refp->p.p.h + ss_ver) >> ss_ver;
 1131|       |
 1132|   668k|    for (int y = 0; y < b_dim[1] * v_mul; y += 8) {
  ------------------
  |  Branch (1132:21): [True: 561k, False: 107k]
  ------------------
 1133|   561k|        const int src_y = t->by * 4 + ((y + 4) << ss_ver);
 1134|   561k|        const int64_t mat3_y = (int64_t) mat[3] * src_y + mat[0];
 1135|   561k|        const int64_t mat5_y = (int64_t) mat[5] * src_y + mat[1];
 1136|  4.25M|        for (int x = 0; x < b_dim[0] * h_mul; x += 8) {
  ------------------
  |  Branch (1136:25): [True: 3.69M, False: 561k]
  ------------------
 1137|       |            // calculate transformation relative to center of 8x8 block in
 1138|       |            // luma pixel units
 1139|  3.69M|            const int src_x = t->bx * 4 + ((x + 4) << ss_hor);
 1140|  3.69M|            const int64_t mvx = ((int64_t) mat[2] * src_x + mat3_y) >> ss_hor;
 1141|  3.69M|            const int64_t mvy = ((int64_t) mat[4] * src_x + mat5_y) >> ss_ver;
 1142|       |
 1143|  3.69M|            const int dx = (int) (mvx >> 16) - 4;
 1144|  3.69M|            const int mx = (((int) mvx & 0xffff) - wmp->u.p.alpha * 4 -
 1145|  3.69M|                                                   wmp->u.p.beta  * 7) & ~0x3f;
 1146|  3.69M|            const int dy = (int) (mvy >> 16) - 4;
 1147|  3.69M|            const int my = (((int) mvy & 0xffff) - wmp->u.p.gamma * 4 -
 1148|  3.69M|                                                   wmp->u.p.delta * 4) & ~0x3f;
 1149|       |
 1150|  3.69M|            const pixel *ref_ptr;
 1151|  3.69M|            ptrdiff_t ref_stride = refp->p.stride[!!pl];
 1152|       |
 1153|  3.69M|            if (dx < 3 || dx + 8 + 4 > width || dy < 3 || dy + 8 + 4 > height) {
  ------------------
  |  Branch (1153:17): [True: 491k, False: 3.19M]
  |  Branch (1153:27): [True: 780k, False: 2.41M]
  |  Branch (1153:49): [True: 62.0k, False: 2.35M]
  |  Branch (1153:59): [True: 167k, False: 2.18M]
  ------------------
 1154|  1.50M|                pixel *const emu_edge_buf = bitfn(t->scratch.emu_edge);
  ------------------
  |  |   51|  1.50M|#define bitfn(x) x##_8bpc
  ------------------
 1155|  1.50M|                f->dsp->mc.emu_edge(15, 15, width, height, dx - 3, dy - 3,
 1156|  1.50M|                                    emu_edge_buf, 32 * sizeof(pixel),
 1157|  1.50M|                                    refp->p.data[pl], ref_stride);
 1158|  1.50M|                ref_ptr = &emu_edge_buf[32 * 3 + 3];
 1159|  1.50M|                ref_stride = 32 * sizeof(pixel);
 1160|  2.18M|            } else {
 1161|  2.18M|                ref_ptr = ((pixel *) refp->p.data[pl]) + PXSTRIDE(ref_stride) * dy + dx;
  ------------------
  |  |   53|  2.18M|#define PXSTRIDE(x) (x)
  ------------------
 1162|  2.18M|            }
 1163|  3.69M|            if (dst16 != NULL)
  ------------------
  |  Branch (1163:17): [True: 46.4k, False: 3.64M]
  ------------------
 1164|  46.4k|                dsp->mc.warp8x8t(&dst16[x], dstride, ref_ptr, ref_stride,
 1165|  46.4k|                                 wmp->u.abcd, mx, my HIGHBD_CALL_SUFFIX);
 1166|  3.64M|            else
 1167|  3.64M|                dsp->mc.warp8x8(&dst8[x], dstride, ref_ptr, ref_stride,
 1168|  3.64M|                                wmp->u.abcd, mx, my HIGHBD_CALL_SUFFIX);
 1169|  3.69M|        }
 1170|   561k|        if (dst8) dst8  += 8 * PXSTRIDE(dstride);
  ------------------
  |  |   53|   550k|#define PXSTRIDE(x) (x)
  ------------------
  |  Branch (1170:13): [True: 550k, False: 10.8k]
  ------------------
 1171|  10.8k|        else      dst16 += 8 * dstride;
 1172|   561k|    }
 1173|   107k|    return 0;
 1174|   107k|}
recon_tmpl.c:obmc:
 1056|   319k|{
 1057|   319k|    assert(!(t->bx & 1) && !(t->by & 1));
  ------------------
  |  Branch (1057:5): [True: 319k, False: 0]
  |  Branch (1057:5): [True: 319k, False: 0]
  ------------------
 1058|   319k|    const Dav1dFrameContext *const f = t->f;
 1059|   319k|    /*const*/ refmvs_block **r = &t->rt.r[(t->by & 31) + 5];
 1060|   319k|    pixel *const lap = bitfn(t->scratch.lap);
  ------------------
  |  |   51|   319k|#define bitfn(x) x##_8bpc
  ------------------
 1061|   319k|    const int ss_ver = !!pl && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (1061:24): [True: 156k, False: 163k]
  |  Branch (1061:32): [True: 88.5k, False: 67.5k]
  ------------------
 1062|   319k|    const int ss_hor = !!pl && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (1062:24): [True: 156k, False: 163k]
  |  Branch (1062:32): [True: 88.5k, False: 67.5k]
  ------------------
 1063|   319k|    const int h_mul = 4 >> ss_hor, v_mul = 4 >> ss_ver;
 1064|   319k|    int res;
 1065|       |
 1066|   319k|    if (t->by > t->ts->tiling.row_start &&
  ------------------
  |  Branch (1066:9): [True: 294k, False: 24.9k]
  ------------------
 1067|   294k|        (!pl || b_dim[0] * h_mul + b_dim[1] * v_mul >= 16))
  ------------------
  |  Branch (1067:10): [True: 153k, False: 141k]
  |  Branch (1067:17): [True: 80.5k, False: 60.8k]
  ------------------
 1068|   233k|    {
 1069|   493k|        for (int i = 0, x = 0; x < w4 && i < imin(b_dim[2], 4); ) {
  ------------------
  |  Branch (1069:32): [True: 261k, False: 232k]
  |  Branch (1069:42): [True: 260k, False: 1.07k]
  ------------------
 1070|       |            // only odd blocks are considered for overlap handling, hence +1
 1071|   260k|            const refmvs_block *const a_r = &r[-1][t->bx + x + 1];
 1072|   260k|            const uint8_t *const a_b_dim = dav1d_block_dimensions[a_r->bs];
 1073|   260k|            const int step4 = iclip(a_b_dim[0], 2, 16);
 1074|       |
 1075|   260k|            if (a_r->ref.ref[0] > 0) {
  ------------------
  |  Branch (1075:17): [True: 251k, False: 9.11k]
  ------------------
 1076|   251k|                const int ow4 = imin(step4, b_dim[0]);
 1077|   251k|                const int oh4 = imin(b_dim[1], 16) >> 1;
 1078|   251k|                res = mc(t, lap, NULL, ow4 * h_mul * sizeof(pixel), ow4, (oh4 * 3 + 3) >> 2,
 1079|   251k|                         t->bx + x, t->by, pl, a_r->mv.mv[0],
 1080|   251k|                         &f->refp[a_r->ref.ref[0] - 1], a_r->ref.ref[0] - 1,
 1081|   251k|                         dav1d_filter_2d[t->a->filter[1][bx4 + x + 1]][t->a->filter[0][bx4 + x + 1]]);
 1082|   251k|                if (res) return res;
  ------------------
  |  Branch (1082:21): [True: 0, False: 251k]
  ------------------
 1083|   251k|                f->dsp->mc.blend_h(&dst[x * h_mul], dst_stride, lap,
 1084|   251k|                                   h_mul * ow4, v_mul * oh4);
 1085|   251k|                i++;
 1086|   251k|            }
 1087|   260k|            x += step4;
 1088|   260k|        }
 1089|   233k|    }
 1090|       |
 1091|   319k|    if (t->bx > t->ts->tiling.col_start)
  ------------------
  |  Branch (1091:9): [True: 309k, False: 9.89k]
  ------------------
 1092|   648k|        for (int i = 0, y = 0; y < h4 && i < imin(b_dim[3], 4); ) {
  ------------------
  |  Branch (1092:32): [True: 340k, False: 307k]
  |  Branch (1092:42): [True: 338k, False: 1.72k]
  ------------------
 1093|       |            // only odd blocks are considered for overlap handling, hence +1
 1094|   338k|            const refmvs_block *const l_r = &r[y + 1][t->bx - 1];
 1095|   338k|            const uint8_t *const l_b_dim = dav1d_block_dimensions[l_r->bs];
 1096|   338k|            const int step4 = iclip(l_b_dim[1], 2, 16);
 1097|       |
 1098|   338k|            if (l_r->ref.ref[0] > 0) {
  ------------------
  |  Branch (1098:17): [True: 326k, False: 12.4k]
  ------------------
 1099|   326k|                const int ow4 = imin(b_dim[0], 16) >> 1;
 1100|   326k|                const int oh4 = imin(step4, b_dim[1]);
 1101|   326k|                res = mc(t, lap, NULL, h_mul * ow4 * sizeof(pixel), ow4, oh4,
 1102|   326k|                         t->bx, t->by + y, pl, l_r->mv.mv[0],
 1103|   326k|                         &f->refp[l_r->ref.ref[0] - 1], l_r->ref.ref[0] - 1,
 1104|   326k|                         dav1d_filter_2d[t->l.filter[1][by4 + y + 1]][t->l.filter[0][by4 + y + 1]]);
 1105|   326k|                if (res) return res;
  ------------------
  |  Branch (1105:21): [True: 0, False: 326k]
  ------------------
 1106|   326k|                f->dsp->mc.blend_v(&dst[y * v_mul * PXSTRIDE(dst_stride)],
  ------------------
  |  |   53|   326k|#define PXSTRIDE(x) (x)
  ------------------
 1107|   326k|                                   dst_stride, lap, h_mul * ow4, v_mul * oh4);
 1108|   326k|                i++;
 1109|   326k|            }
 1110|   338k|            y += step4;
 1111|   338k|        }
 1112|   319k|    return 0;
 1113|   319k|}
dav1d_recon_b_intra_16bpc:
 1179|  1.57M|{
 1180|  1.57M|    Dav1dTileState *const ts = t->ts;
 1181|  1.57M|    const Dav1dFrameContext *const f = t->f;
 1182|  1.57M|    const Dav1dDSPContext *const dsp = f->dsp;
 1183|  1.57M|    const int bx4 = t->bx & 31, by4 = t->by & 31;
 1184|  1.57M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1185|  1.57M|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 1186|  1.57M|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
 1187|  1.57M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
 1188|  1.57M|    const int bw4 = b_dim[0], bh4 = b_dim[1];
 1189|  1.57M|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
 1190|  1.57M|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
 1191|  1.57M|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (1191:28): [True: 1.04M, False: 520k]
  ------------------
 1192|  1.04M|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (1192:29): [True: 1.01M, False: 32.7k]
  |  Branch (1192:45): [True: 16.7k, False: 16.0k]
  ------------------
 1193|  1.03M|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (1193:29): [True: 1.00M, False: 27.4k]
  |  Branch (1193:45): [True: 14.3k, False: 13.1k]
  ------------------
 1194|  1.57M|    const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[b->tx];
 1195|  1.57M|    const TxfmInfo *const uv_t_dim = &dav1d_txfm_dimensions[b->uvtx];
 1196|       |
 1197|       |    // coefficient coding
 1198|  1.57M|    pixel *const edge = bitfn(t->scratch.edge) + 128;
  ------------------
  |  |   77|  1.57M|#define bitfn(x) x##_16bpc
  ------------------
 1199|  1.57M|    const int cbw4 = (bw4 + ss_hor) >> ss_hor, cbh4 = (bh4 + ss_ver) >> ss_ver;
 1200|       |
 1201|  1.57M|    const int intra_edge_filter_flag = f->seq_hdr->intra_edge_filter << 10;
 1202|       |
 1203|  3.20M|    for (int init_y = 0; init_y < h4; init_y += 16) {
  ------------------
  |  Branch (1203:26): [True: 1.63M, False: 1.57M]
  ------------------
 1204|  1.63M|        const int sub_h4 = imin(h4, 16 + init_y);
 1205|  1.63M|        const int sub_ch4 = imin(ch4, (init_y + 16) >> ss_ver);
 1206|  3.38M|        for (int init_x = 0; init_x < w4; init_x += 16) {
  ------------------
  |  Branch (1206:30): [True: 1.75M, False: 1.63M]
  ------------------
 1207|  1.75M|            if (b->pal_sz[0]) {
  ------------------
  |  Branch (1207:17): [True: 52.2k, False: 1.70M]
  ------------------
 1208|  52.2k|                pixel *dst = ((pixel *) f->cur.data[0]) +
 1209|  52.2k|                             4 * (t->by * PXSTRIDE(f->cur.stride[0]) + t->bx);
 1210|  52.2k|                const uint8_t *pal_idx;
 1211|  52.2k|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (1211:21): [True: 0, False: 52.2k]
  ------------------
 1212|      0|                    const int p = t->frame_thread.pass & 1;
 1213|      0|                    assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  Branch (1213:21): [True: 0, False: 0]
  ------------------
 1214|      0|                    pal_idx = ts->frame_thread[p].pal_idx;
 1215|      0|                    ts->frame_thread[p].pal_idx += bw4 * bh4 * 8;
 1216|  52.2k|                } else {
 1217|  52.2k|                    pal_idx = t->scratch.pal_idx_y;
 1218|  52.2k|                }
 1219|  52.2k|                const pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (1219:42): [True: 0, False: 52.2k]
  ------------------
 1220|      0|                    f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 1221|      0|                                        ((t->bx >> 1) + (t->by & 1))][0] :
 1222|  52.2k|                    bytefn(t->scratch.pal)[0];
  ------------------
  |  |   87|  52.2k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  52.2k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1223|  52.2k|                f->dsp->ipred.pal_pred(dst, f->cur.stride[0], pal,
 1224|  52.2k|                                       pal_idx, bw4 * 4, bh4 * 4);
 1225|  52.2k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|  52.2k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 52.2k]
  |  |  ------------------
  |  |   35|  52.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|  52.2k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1226|      0|                    hex_dump(dst, PXSTRIDE(f->cur.stride[0]),
 1227|      0|                             bw4 * 4, bh4 * 4, "y-pal-pred");
 1228|  52.2k|            }
 1229|       |
 1230|  1.75M|            const int intra_flags = (sm_flag(t->a, bx4) |
 1231|  1.75M|                                     sm_flag(&t->l, by4) |
 1232|  1.75M|                                     intra_edge_filter_flag);
 1233|  1.75M|            const int sb_has_tr = init_x + 16 < w4 ? 1 : init_y ? 0 :
  ------------------
  |  Branch (1233:35): [True: 126k, False: 1.63M]
  |  Branch (1233:58): [True: 60.6k, False: 1.57M]
  ------------------
 1234|  1.63M|                              intra_edge_flags & EDGE_I444_TOP_HAS_RIGHT;
 1235|  1.75M|            const int sb_has_bl = init_x ? 0 : init_y + 16 < h4 ? 1 :
  ------------------
  |  Branch (1235:35): [True: 126k, False: 1.63M]
  |  Branch (1235:48): [True: 60.6k, False: 1.57M]
  ------------------
 1236|  1.63M|                              intra_edge_flags & EDGE_I444_LEFT_HAS_BOTTOM;
 1237|  1.75M|            int y, x;
 1238|  1.75M|            const int sub_w4 = imin(w4, init_x + 16);
 1239|  3.99M|            for (y = init_y, t->by += init_y; y < sub_h4;
  ------------------
  |  Branch (1239:47): [True: 2.23M, False: 1.75M]
  ------------------
 1240|  2.23M|                 y += t_dim->h, t->by += t_dim->h)
 1241|  2.23M|            {
 1242|  2.23M|                pixel *dst = ((pixel *) f->cur.data[0]) +
 1243|  2.23M|                               4 * (t->by * PXSTRIDE(f->cur.stride[0]) +
 1244|  2.23M|                                    t->bx + init_x);
 1245|  6.38M|                for (x = init_x, t->bx += init_x; x < sub_w4;
  ------------------
  |  Branch (1245:51): [True: 4.14M, False: 2.23M]
  ------------------
 1246|  4.14M|                     x += t_dim->w, t->bx += t_dim->w)
 1247|  4.14M|                {
 1248|  4.14M|                    if (b->pal_sz[0]) goto skip_y_pred;
  ------------------
  |  Branch (1248:25): [True: 63.8k, False: 4.08M]
  ------------------
 1249|       |
 1250|  4.08M|                    int angle = b->y_angle;
 1251|  4.08M|                    const enum EdgeFlags edge_flags =
 1252|  4.08M|                        (((y > init_y || !sb_has_tr) && (x + t_dim->w >= sub_w4)) ?
  ------------------
  |  Branch (1252:28): [True: 2.06M, False: 2.02M]
  |  Branch (1252:42): [True: 582k, False: 1.43M]
  |  Branch (1252:57): [True: 1.00M, False: 1.63M]
  ------------------
 1253|  3.07M|                             0 : EDGE_I444_TOP_HAS_RIGHT) |
 1254|  4.08M|                        ((x > init_x || (!sb_has_bl && y + t_dim->h >= sub_h4)) ?
  ------------------
  |  Branch (1254:27): [True: 1.89M, False: 2.18M]
  |  Branch (1254:42): [True: 1.29M, False: 886k]
  |  Branch (1254:56): [True: 928k, False: 371k]
  ------------------
 1255|  2.82M|                             0 : EDGE_I444_LEFT_HAS_BOTTOM);
 1256|  4.08M|                    const pixel *top_sb_edge = NULL;
 1257|  4.08M|                    if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1257:25): [True: 943k, False: 3.13M]
  ------------------
 1258|   943k|                        top_sb_edge = f->ipred_edge[0];
 1259|   943k|                        const int sby = t->by >> f->sb_shift;
 1260|   943k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1261|   943k|                    }
 1262|  4.08M|                    const enum IntraPredMode m =
 1263|  4.08M|                        bytefn(dav1d_prepare_intra_edges)(t->bx,
  ------------------
  |  |   87|  4.08M|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  4.08M|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1264|  4.08M|                                                          t->bx > ts->tiling.col_start,
 1265|  4.08M|                                                          t->by,
 1266|  4.08M|                                                          t->by > ts->tiling.row_start,
 1267|  4.08M|                                                          ts->tiling.col_end,
 1268|  4.08M|                                                          ts->tiling.row_end,
 1269|  4.08M|                                                          edge_flags, dst,
 1270|  4.08M|                                                          f->cur.stride[0], top_sb_edge,
 1271|  4.08M|                                                          b->y_mode, &angle,
 1272|  4.08M|                                                          t_dim->w, t_dim->h,
 1273|  4.08M|                                                          f->seq_hdr->intra_edge_filter,
 1274|  4.08M|                                                          edge HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  4.08M|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1275|  4.08M|                    dsp->ipred.intra_pred[m](dst, f->cur.stride[0], edge,
 1276|  4.08M|                                             t_dim->w * 4, t_dim->h * 4,
 1277|  4.08M|                                             angle | intra_flags,
 1278|  4.08M|                                             4 * f->bw - 4 * t->bx,
 1279|  4.08M|                                             4 * f->bh - 4 * t->by
 1280|  4.08M|                                             HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  4.08M|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1281|       |
 1282|  4.08M|                    if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  4.08M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 4.08M]
  |  |  ------------------
  |  |   35|  4.08M|        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.08M|        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|  4.14M|                skip_y_pred: {}
 1293|  4.14M|                    if (!b->skip) {
  ------------------
  |  Branch (1293:25): [True: 1.73M, False: 2.40M]
  ------------------
 1294|  1.73M|                        coef *cf;
 1295|  1.73M|                        int eob;
 1296|  1.73M|                        enum TxfmType txtp;
 1297|  1.73M|                        if (t->frame_thread.pass) {
  ------------------
  |  Branch (1297:29): [True: 0, False: 1.73M]
  ------------------
 1298|      0|                            const int p = t->frame_thread.pass & 1;
 1299|      0|                            const int cbi = *ts->frame_thread[p].cbi++;
 1300|      0|                            cf = ts->frame_thread[p].cf;
 1301|      0|                            ts->frame_thread[p].cf += imin(t_dim->w, 8) * imin(t_dim->h, 8) * 16;
 1302|      0|                            eob  = cbi >> 5;
 1303|      0|                            txtp = cbi & 0x1f;
 1304|  1.73M|                        } else {
 1305|  1.73M|                            uint8_t cf_ctx;
 1306|  1.73M|                            cf = bitfn(t->cf);
  ------------------
  |  |   77|  1.73M|#define bitfn(x) x##_16bpc
  ------------------
 1307|  1.73M|                            eob = decode_coefs(t, &t->a->lcoef[bx4 + x],
 1308|  1.73M|                                               &t->l.lcoef[by4 + y], b->tx, bs,
 1309|  1.73M|                                               b, 1, 0, cf, &txtp, &cf_ctx);
 1310|  1.73M|                            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  1.73M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.73M]
  |  |  ------------------
  |  |   35|  1.73M|        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.73M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1311|      0|                                printf("Post-y-cf-blk[tx=%d,txtp=%d,eob=%d]: r=%d\n",
 1312|      0|                                       b->tx, txtp, eob, ts->msac.rng);
 1313|  1.73M|                            dav1d_memset_likely_pow2(&t->a->lcoef[bx4 + x], cf_ctx, imin(t_dim->w, f->bw - t->bx));
 1314|  1.73M|                            dav1d_memset_likely_pow2(&t->l.lcoef[by4 + y], cf_ctx, imin(t_dim->h, f->bh - t->by));
 1315|  1.73M|                        }
 1316|  1.73M|                        if (eob >= 0) {
  ------------------
  |  Branch (1316:29): [True: 1.29M, False: 444k]
  ------------------
 1317|  1.29M|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|  1.29M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.29M]
  |  |  ------------------
  |  |   35|  1.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|  1.29M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                          if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1318|      0|                                coef_dump(cf, imin(t_dim->h, 8) * 4,
 1319|      0|                                          imin(t_dim->w, 8) * 4, 3, "dq");
 1320|  1.29M|                            dsp->itx.itxfm_add[b->tx]
 1321|  1.29M|                                              [txtp](dst,
 1322|  1.29M|                                                     f->cur.stride[0],
 1323|  1.29M|                                                     cf, eob HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  1.29M|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1324|  1.29M|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|  1.29M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.29M]
  |  |  ------------------
  |  |   35|  1.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|  1.29M|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                          if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   37|      0|#define DEBUG_B_PIXELS 0
  |  |  ------------------
  |  |  |  Branch (37:24): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1325|      0|                                hex_dump(dst, f->cur.stride[0],
 1326|      0|                                         t_dim->w * 4, t_dim->h * 4, "recon");
 1327|  1.29M|                        }
 1328|  2.40M|                    } else if (!t->frame_thread.pass) {
  ------------------
  |  Branch (1328:32): [True: 2.40M, False: 0]
  ------------------
 1329|  2.40M|                        dav1d_memset_pow2[t_dim->lw](&t->a->lcoef[bx4 + x], 0x40);
 1330|  2.40M|                        dav1d_memset_pow2[t_dim->lh](&t->l.lcoef[by4 + y], 0x40);
 1331|  2.40M|                    }
 1332|  4.14M|                    dst += 4 * t_dim->w;
 1333|  4.14M|                }
 1334|  2.23M|                t->bx -= x;
 1335|  2.23M|            }
 1336|  1.75M|            t->by -= y;
 1337|       |
 1338|  1.75M|            if (!has_chroma) continue;
  ------------------
  |  Branch (1338:17): [True: 624k, False: 1.13M]
  ------------------
 1339|       |
 1340|  1.13M|            const ptrdiff_t stride = f->cur.stride[1];
 1341|       |
 1342|  1.13M|            if (b->uv_mode == CFL_PRED) {
  ------------------
  |  Branch (1342:17): [True: 226k, False: 905k]
  ------------------
 1343|   226k|                assert(!init_x && !init_y);
  ------------------
  |  Branch (1343:17): [True: 226k, False: 0]
  |  Branch (1343:17): [True: 226k, False: 0]
  ------------------
 1344|       |
 1345|   226k|                int16_t *const ac = t->scratch.ac;
 1346|   226k|                pixel *y_src = ((pixel *) f->cur.data[0]) + 4 * (t->bx & ~ss_hor) +
 1347|   226k|                                 4 * (t->by & ~ss_ver) * PXSTRIDE(f->cur.stride[0]);
 1348|   226k|                const ptrdiff_t uv_off = 4 * ((t->bx >> ss_hor) +
 1349|   226k|                                              (t->by >> ss_ver) * PXSTRIDE(stride));
 1350|   226k|                pixel *const uv_dst[2] = { ((pixel *) f->cur.data[1]) + uv_off,
 1351|   226k|                                           ((pixel *) f->cur.data[2]) + uv_off };
 1352|       |
 1353|   226k|                const int furthest_r =
 1354|   226k|                    ((cw4 << ss_hor) + t_dim->w - 1) & ~(t_dim->w - 1);
 1355|   226k|                const int furthest_b =
 1356|   226k|                    ((ch4 << ss_ver) + t_dim->h - 1) & ~(t_dim->h - 1);
 1357|   226k|                dsp->ipred.cfl_ac[f->cur.p.layout - 1](ac, y_src, f->cur.stride[0],
 1358|   226k|                                                         cbw4 - (furthest_r >> ss_hor),
 1359|   226k|                                                         cbh4 - (furthest_b >> ss_ver),
 1360|   226k|                                                         cbw4 * 4, cbh4 * 4);
 1361|   680k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1361:34): [True: 453k, False: 226k]
  ------------------
 1362|   453k|                    if (!b->cfl_alpha[pl]) continue;
  ------------------
  |  Branch (1362:25): [True: 91.0k, False: 362k]
  ------------------
 1363|   362k|                    int angle = 0;
 1364|   362k|                    const pixel *top_sb_edge = NULL;
 1365|   362k|                    if (!((t->by & ~ss_ver) & (f->sb_step - 1))) {
  ------------------
  |  Branch (1365:25): [True: 116k, False: 246k]
  ------------------
 1366|   116k|                        top_sb_edge = f->ipred_edge[pl + 1];
 1367|   116k|                        const int sby = t->by >> f->sb_shift;
 1368|   116k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1369|   116k|                    }
 1370|   362k|                    const int xpos = t->bx >> ss_hor, ypos = t->by >> ss_ver;
 1371|   362k|                    const int xstart = ts->tiling.col_start >> ss_hor;
 1372|   362k|                    const int ystart = ts->tiling.row_start >> ss_ver;
 1373|   362k|                    const enum IntraPredMode m =
 1374|   362k|                        bytefn(dav1d_prepare_intra_edges)(xpos, xpos > xstart,
  ------------------
  |  |   87|   362k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|   362k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1375|   362k|                                                          ypos, ypos > ystart,
 1376|   362k|                                                          ts->tiling.col_end >> ss_hor,
 1377|   362k|                                                          ts->tiling.row_end >> ss_ver,
 1378|   362k|                                                          0, uv_dst[pl], stride,
 1379|   362k|                                                          top_sb_edge, DC_PRED, &angle,
 1380|   362k|                                                          uv_t_dim->w, uv_t_dim->h, 0,
 1381|   362k|                                                          edge HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   362k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1382|   362k|                    dsp->ipred.cfl_pred[m](uv_dst[pl], stride, edge,
 1383|   362k|                                           uv_t_dim->w * 4,
 1384|   362k|                                           uv_t_dim->h * 4,
 1385|   362k|                                           ac, b->cfl_alpha[pl]
 1386|   362k|                                           HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   362k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1387|   362k|                }
 1388|   226k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|   226k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 226k]
  |  |  ------------------
  |  |   35|   226k|        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|   226k|        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|   905k|            } else if (b->pal_sz[1]) {
  ------------------
  |  Branch (1393:24): [True: 11.2k, False: 894k]
  ------------------
 1394|  11.2k|                const ptrdiff_t uv_dstoff = 4 * ((t->bx >> ss_hor) +
 1395|  11.2k|                                              (t->by >> ss_ver) * PXSTRIDE(f->cur.stride[1]));
 1396|  11.2k|                const pixel (*pal)[8];
 1397|  11.2k|                const uint8_t *pal_idx;
 1398|  11.2k|                if (t->frame_thread.pass) {
  ------------------
  |  Branch (1398:21): [True: 0, False: 11.2k]
  ------------------
 1399|      0|                    const int p = t->frame_thread.pass & 1;
 1400|      0|                    assert(ts->frame_thread[p].pal_idx);
  ------------------
  |  Branch (1400:21): [True: 0, False: 0]
  ------------------
 1401|      0|                    pal = f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 1402|      0|                                              ((t->bx >> 1) + (t->by & 1))];
 1403|      0|                    pal_idx = ts->frame_thread[p].pal_idx;
 1404|      0|                    ts->frame_thread[p].pal_idx += cbw4 * cbh4 * 8;
 1405|  11.2k|                } else {
 1406|  11.2k|                    pal = bytefn(t->scratch.pal);
  ------------------
  |  |   87|  11.2k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  11.2k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1407|  11.2k|                    pal_idx = t->scratch.pal_idx_uv;
 1408|  11.2k|                }
 1409|       |
 1410|  11.2k|                f->dsp->ipred.pal_pred(((pixel *) f->cur.data[1]) + uv_dstoff,
 1411|  11.2k|                                       f->cur.stride[1], pal[1],
 1412|  11.2k|                                       pal_idx, cbw4 * 4, cbh4 * 4);
 1413|  11.2k|                f->dsp->ipred.pal_pred(((pixel *) f->cur.data[2]) + uv_dstoff,
 1414|  11.2k|                                       f->cur.stride[1], pal[2],
 1415|  11.2k|                                       pal_idx, cbw4 * 4, cbh4 * 4);
 1416|  11.2k|                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  11.2k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 11.2k]
  |  |  ------------------
  |  |   35|  11.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|  11.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]
  |  |  ------------------
  ------------------
 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|  11.2k|            }
 1425|       |
 1426|  1.13M|            const int sm_uv_fl = sm_uv_flag(t->a, cbx4) |
 1427|  1.13M|                                 sm_uv_flag(&t->l, cby4);
 1428|  1.13M|            const int uv_sb_has_tr =
 1429|  1.13M|                ((init_x + 16) >> ss_hor) < cw4 ? 1 : init_y ? 0 :
  ------------------
  |  Branch (1429:17): [True: 75.0k, False: 1.05M]
  |  Branch (1429:55): [True: 36.9k, False: 1.02M]
  ------------------
 1430|  1.05M|                intra_edge_flags & (EDGE_I420_TOP_HAS_RIGHT >> (f->cur.p.layout - 1));
 1431|  1.13M|            const int uv_sb_has_bl =
 1432|  1.13M|                init_x ? 0 : ((init_y + 16) >> ss_ver) < ch4 ? 1 :
  ------------------
  |  Branch (1432:17): [True: 75.0k, False: 1.05M]
  |  Branch (1432:30): [True: 36.9k, False: 1.02M]
  ------------------
 1433|  1.05M|                intra_edge_flags & (EDGE_I420_LEFT_HAS_BOTTOM >> (f->cur.p.layout - 1));
 1434|  1.13M|            const int sub_cw4 = imin(cw4, (init_x + 16) >> ss_hor);
 1435|  3.39M|            for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1435:30): [True: 2.26M, False: 1.13M]
  ------------------
 1436|  4.83M|                for (y = init_y >> ss_ver, t->by += init_y; y < sub_ch4;
  ------------------
  |  Branch (1436:61): [True: 2.56M, False: 2.26M]
  ------------------
 1437|  2.56M|                     y += uv_t_dim->h, t->by += uv_t_dim->h << ss_ver)
 1438|  2.56M|                {
 1439|  2.56M|                    pixel *dst = ((pixel *) f->cur.data[1 + pl]) +
 1440|  2.56M|                                   4 * ((t->by >> ss_ver) * PXSTRIDE(stride) +
 1441|  2.56M|                                        ((t->bx + init_x) >> ss_hor));
 1442|  6.40M|                    for (x = init_x >> ss_hor, t->bx += init_x; x < sub_cw4;
  ------------------
  |  Branch (1442:65): [True: 3.83M, False: 2.56M]
  ------------------
 1443|  3.83M|                         x += uv_t_dim->w, t->bx += uv_t_dim->w << ss_hor)
 1444|  3.83M|                    {
 1445|  3.83M|                        if ((b->uv_mode == CFL_PRED && b->cfl_alpha[pl]) ||
  ------------------
  |  Branch (1445:30): [True: 453k, False: 3.38M]
  |  Branch (1445:56): [True: 362k, False: 91.0k]
  ------------------
 1446|  3.47M|                            b->pal_sz[1])
  ------------------
  |  Branch (1446:29): [True: 25.6k, False: 3.44M]
  ------------------
 1447|   387k|                        {
 1448|   387k|                            goto skip_uv_pred;
 1449|   387k|                        }
 1450|       |
 1451|  3.44M|                        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|  3.44M|                        const enum EdgeFlags edge_flags =
 1456|  3.44M|                            (((y > (init_y >> ss_ver) || !uv_sb_has_tr) &&
  ------------------
  |  Branch (1456:32): [True: 1.32M, False: 2.12M]
  |  Branch (1456:58): [True: 706k, False: 1.42M]
  ------------------
 1457|  2.02M|                              (x + uv_t_dim->w >= sub_cw4)) ?
  ------------------
  |  Branch (1457:31): [True: 960k, False: 1.06M]
  ------------------
 1458|  2.48M|                                 0 : EDGE_I444_TOP_HAS_RIGHT) |
 1459|  3.44M|                            ((x > (init_x >> ss_hor) ||
  ------------------
  |  Branch (1459:31): [True: 1.26M, False: 2.18M]
  ------------------
 1460|  2.18M|                              (!uv_sb_has_bl && y + uv_t_dim->h >= sub_ch4)) ?
  ------------------
  |  Branch (1460:32): [True: 1.21M, False: 971k]
  |  Branch (1460:49): [True: 986k, False: 223k]
  ------------------
 1461|  2.25M|                                 0 : EDGE_I444_LEFT_HAS_BOTTOM);
 1462|  3.44M|                        const pixel *top_sb_edge = NULL;
 1463|  3.44M|                        if (!((t->by & ~ss_ver) & (f->sb_step - 1))) {
  ------------------
  |  Branch (1463:29): [True: 835k, False: 2.61M]
  ------------------
 1464|   835k|                            top_sb_edge = f->ipred_edge[1 + pl];
 1465|   835k|                            const int sby = t->by >> f->sb_shift;
 1466|   835k|                            top_sb_edge += f->sb128w * 128 * (sby - 1);
 1467|   835k|                        }
 1468|  3.44M|                        const enum IntraPredMode uv_mode =
 1469|  3.44M|                             b->uv_mode == CFL_PRED ? DC_PRED : b->uv_mode;
  ------------------
  |  Branch (1469:30): [True: 91.0k, False: 3.35M]
  ------------------
 1470|  3.44M|                        const int xpos = t->bx >> ss_hor, ypos = t->by >> ss_ver;
 1471|  3.44M|                        const int xstart = ts->tiling.col_start >> ss_hor;
 1472|  3.44M|                        const int ystart = ts->tiling.row_start >> ss_ver;
 1473|  3.44M|                        const enum IntraPredMode m =
 1474|  3.44M|                            bytefn(dav1d_prepare_intra_edges)(xpos, xpos > xstart,
  ------------------
  |  |   87|  3.44M|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  3.44M|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1475|  3.44M|                                                              ypos, ypos > ystart,
 1476|  3.44M|                                                              ts->tiling.col_end >> ss_hor,
 1477|  3.44M|                                                              ts->tiling.row_end >> ss_ver,
 1478|  3.44M|                                                              edge_flags, dst, stride,
 1479|  3.44M|                                                              top_sb_edge, uv_mode,
 1480|  3.44M|                                                              &angle, uv_t_dim->w,
 1481|  3.44M|                                                              uv_t_dim->h,
 1482|  3.44M|                                                              f->seq_hdr->intra_edge_filter,
 1483|  3.44M|                                                              edge HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  3.44M|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1484|  3.44M|                        angle |= intra_edge_filter_flag;
 1485|  3.44M|                        dsp->ipred.intra_pred[m](dst, stride, edge,
 1486|  3.44M|                                                 uv_t_dim->w * 4,
 1487|  3.44M|                                                 uv_t_dim->h * 4,
 1488|  3.44M|                                                 angle | sm_uv_fl,
 1489|  3.44M|                                                 (4 * f->bw + ss_hor -
 1490|  3.44M|                                                  4 * (t->bx & ~ss_hor)) >> ss_hor,
 1491|  3.44M|                                                 (4 * f->bh + ss_ver -
 1492|  3.44M|                                                  4 * (t->by & ~ss_ver)) >> ss_ver
 1493|  3.44M|                                                 HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  3.44M|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1494|  3.44M|                        if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  3.44M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 3.44M]
  |  |  ------------------
  |  |   35|  3.44M|        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.44M|        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|  3.83M|                    skip_uv_pred: {}
 1505|  3.83M|                        if (!b->skip) {
  ------------------
  |  Branch (1505:29): [True: 2.02M, False: 1.80M]
  ------------------
 1506|  2.02M|                            enum TxfmType txtp;
 1507|  2.02M|                            int eob;
 1508|  2.02M|                            coef *cf;
 1509|  2.02M|                            if (t->frame_thread.pass) {
  ------------------
  |  Branch (1509:33): [True: 0, False: 2.02M]
  ------------------
 1510|      0|                                const int p = t->frame_thread.pass & 1;
 1511|      0|                                const int cbi = *ts->frame_thread[p].cbi++;
 1512|      0|                                cf = ts->frame_thread[p].cf;
 1513|      0|                                ts->frame_thread[p].cf += uv_t_dim->w * uv_t_dim->h * 16;
 1514|      0|                                eob  = cbi >> 5;
 1515|      0|                                txtp = cbi & 0x1f;
 1516|  2.02M|                            } else {
 1517|  2.02M|                                uint8_t cf_ctx;
 1518|  2.02M|                                cf = bitfn(t->cf);
  ------------------
  |  |   77|  2.02M|#define bitfn(x) x##_16bpc
  ------------------
 1519|  2.02M|                                eob = decode_coefs(t, &t->a->ccoef[pl][cbx4 + x],
 1520|  2.02M|                                                   &t->l.ccoef[pl][cby4 + y],
 1521|  2.02M|                                                   b->uvtx, bs, b, 1, 1 + pl, cf,
 1522|  2.02M|                                                   &txtp, &cf_ctx);
 1523|  2.02M|                                if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|  2.02M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 2.02M]
  |  |  ------------------
  |  |   35|  2.02M|        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.02M|        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|  2.02M|                                int ctw = imin(uv_t_dim->w, (f->bw - t->bx + ss_hor) >> ss_hor);
 1528|  2.02M|                                int cth = imin(uv_t_dim->h, (f->bh - t->by + ss_ver) >> ss_ver);
 1529|  2.02M|                                dav1d_memset_likely_pow2(&t->a->ccoef[pl][cbx4 + x], cf_ctx, ctw);
 1530|  2.02M|                                dav1d_memset_likely_pow2(&t->l.ccoef[pl][cby4 + y], cf_ctx, cth);
 1531|  2.02M|                            }
 1532|  2.02M|                            if (eob >= 0) {
  ------------------
  |  Branch (1532:33): [True: 559k, False: 1.46M]
  ------------------
 1533|   559k|                                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   559k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 559k]
  |  |  ------------------
  |  |   35|   559k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   559k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                              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|   559k|                                dsp->itx.itxfm_add[b->uvtx]
 1537|   559k|                                                  [txtp](dst, stride,
 1538|   559k|                                                         cf, eob HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   559k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1539|   559k|                                if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   559k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 559k]
  |  |  ------------------
  |  |   35|   559k|        f->frame_hdr->frame_offset == 2 && t->by >= 0 && t->by < 4 && \
  |  |  ------------------
  |  |  |  Branch (35:9): [True: 0, False: 0]
  |  |  |  Branch (35:44): [True: 0, False: 0]
  |  |  |  Branch (35:58): [True: 0, False: 0]
  |  |  ------------------
  |  |   36|   559k|        t->bx >= 8 && t->bx < 12
  |  |  ------------------
  |  |  |  Branch (36:9): [True: 0, False: 0]
  |  |  |  Branch (36:23): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                              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|   559k|                            }
 1543|  2.02M|                        } else if (!t->frame_thread.pass) {
  ------------------
  |  Branch (1543:36): [True: 1.80M, False: 0]
  ------------------
 1544|  1.80M|                            dav1d_memset_pow2[uv_t_dim->lw](&t->a->ccoef[pl][cbx4 + x], 0x40);
 1545|  1.80M|                            dav1d_memset_pow2[uv_t_dim->lh](&t->l.ccoef[pl][cby4 + y], 0x40);
 1546|  1.80M|                        }
 1547|  3.83M|                        dst += uv_t_dim->w * 4;
 1548|  3.83M|                    }
 1549|  2.56M|                    t->bx -= x << ss_hor;
 1550|  2.56M|                }
 1551|  2.26M|                t->by -= y << ss_ver;
 1552|  2.26M|            }
 1553|  1.13M|        }
 1554|  1.63M|    }
 1555|  1.57M|}
dav1d_recon_b_inter_16bpc:
 1559|  1.05M|{
 1560|  1.05M|    Dav1dTileState *const ts = t->ts;
 1561|  1.05M|    const Dav1dFrameContext *const f = t->f;
 1562|  1.05M|    const Dav1dDSPContext *const dsp = f->dsp;
 1563|  1.05M|    const int bx4 = t->bx & 31, by4 = t->by & 31;
 1564|  1.05M|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1565|  1.05M|    const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 1566|  1.05M|    const int cbx4 = bx4 >> ss_hor, cby4 = by4 >> ss_ver;
 1567|  1.05M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
 1568|  1.05M|    const int bw4 = b_dim[0], bh4 = b_dim[1];
 1569|  1.05M|    const int w4 = imin(bw4, f->bw - t->bx), h4 = imin(bh4, f->bh - t->by);
 1570|  1.05M|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400 &&
  ------------------
  |  Branch (1570:28): [True: 435k, False: 623k]
  ------------------
 1571|   435k|                           (bw4 > ss_hor || t->bx & 1) &&
  ------------------
  |  Branch (1571:29): [True: 315k, False: 120k]
  |  Branch (1571:45): [True: 60.0k, False: 60.6k]
  ------------------
 1572|   375k|                           (bh4 > ss_ver || t->by & 1);
  ------------------
  |  Branch (1572:29): [True: 363k, False: 11.3k]
  |  Branch (1572:45): [True: 5.09k, False: 6.26k]
  ------------------
 1573|  1.05M|    const int chr_layout_idx = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I400 ? 0 :
  ------------------
  |  Branch (1573:32): [True: 623k, False: 435k]
  ------------------
 1574|  1.05M|                               DAV1D_PIXEL_LAYOUT_I444 - f->cur.p.layout;
 1575|  1.05M|    int res;
 1576|       |
 1577|       |    // prediction
 1578|  1.05M|    const int cbh4 = (bh4 + ss_ver) >> ss_ver, cbw4 = (bw4 + ss_hor) >> ss_hor;
 1579|  1.05M|    pixel *dst = ((pixel *) f->cur.data[0]) +
 1580|  1.05M|        4 * (t->by * PXSTRIDE(f->cur.stride[0]) + t->bx);
 1581|  1.05M|    const ptrdiff_t uvdstoff =
 1582|  1.05M|        4 * ((t->bx >> ss_hor) + (t->by >> ss_ver) * PXSTRIDE(f->cur.stride[1]));
 1583|  1.05M|    if (IS_KEY_OR_INTRA(f->frame_hdr)) {
  ------------------
  |  |   43|  1.05M|    (!IS_INTER_OR_SWITCH(frame_header))
  |  |  ------------------
  |  |  |  |   36|  1.05M|    ((frame_header)->frame_type & 1)
  |  |  ------------------
  |  |  |  Branch (43:5): [True: 582k, False: 476k]
  |  |  ------------------
  ------------------
 1584|       |        // intrabc
 1585|   582k|        assert(!f->frame_hdr->super_res.enabled);
  ------------------
  |  Branch (1585:9): [True: 582k, False: 0]
  ------------------
 1586|   582k|        res = mc(t, dst, NULL, f->cur.stride[0], bw4, bh4, t->bx, t->by, 0,
 1587|   582k|                 b->mv[0], &f->sr_cur, 0 /* unused */, FILTER_2D_BILINEAR);
 1588|   582k|        if (res) return res;
  ------------------
  |  Branch (1588:13): [True: 0, False: 582k]
  ------------------
 1589|   685k|        if (has_chroma) for (int pl = 1; pl < 3; pl++) {
  ------------------
  |  Branch (1589:13): [True: 228k, False: 354k]
  |  Branch (1589:42): [True: 456k, False: 228k]
  ------------------
 1590|   456k|            res = mc(t, ((pixel *)f->cur.data[pl]) + uvdstoff, NULL, f->cur.stride[1],
 1591|   456k|                     bw4 << (bw4 == ss_hor), bh4 << (bh4 == ss_ver),
 1592|   456k|                     t->bx & ~ss_hor, t->by & ~ss_ver, pl, b->mv[0],
 1593|   456k|                     &f->sr_cur, 0 /* unused */, FILTER_2D_BILINEAR);
 1594|   456k|            if (res) return res;
  ------------------
  |  Branch (1594:17): [True: 0, False: 456k]
  ------------------
 1595|   456k|        }
 1596|   582k|    } else if (b->comp_type == COMP_INTER_NONE) {
  ------------------
  |  Branch (1596:16): [True: 410k, False: 66.2k]
  ------------------
 1597|   410k|        const Dav1dThreadPicture *const refp = &f->refp[b->ref[0]];
 1598|   410k|        const enum Filter2d filter_2d = b->filter2d;
 1599|       |
 1600|   410k|        if (imin(bw4, bh4) > 1 &&
  ------------------
  |  Branch (1600:13): [True: 253k, False: 157k]
  ------------------
 1601|   253k|            ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (1601:15): [True: 162k, False: 90.8k]
  |  Branch (1601:44): [True: 10.1k, False: 152k]
  ------------------
 1602|   243k|             (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (1602:15): [True: 34.9k, False: 208k]
  |  Branch (1602:44): [True: 32.4k, False: 2.41k]
  ------------------
 1603|  42.6k|        {
 1604|  42.6k|            res = warp_affine(t, dst, NULL, f->cur.stride[0], b_dim, 0, refp,
 1605|  42.6k|                              b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (1605:31): [True: 32.4k, False: 10.1k]
  ------------------
 1606|  42.6k|                                  &f->frame_hdr->gmv[b->ref[0]]);
 1607|  42.6k|            if (res) return res;
  ------------------
  |  Branch (1607:17): [True: 0, False: 42.6k]
  ------------------
 1608|   367k|        } else {
 1609|   367k|            res = mc(t, dst, NULL, f->cur.stride[0],
 1610|   367k|                     bw4, bh4, t->bx, t->by, 0, b->mv[0], refp, b->ref[0], filter_2d);
 1611|   367k|            if (res) return res;
  ------------------
  |  Branch (1611:17): [True: 0, False: 367k]
  ------------------
 1612|   367k|            if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (1612:17): [True: 85.6k, False: 282k]
  ------------------
 1613|  85.6k|                res = obmc(t, dst, f->cur.stride[0], b_dim, 0, bx4, by4, w4, h4);
 1614|  85.6k|                if (res) return res;
  ------------------
  |  Branch (1614:21): [True: 0, False: 85.6k]
  ------------------
 1615|  85.6k|            }
 1616|   367k|        }
 1617|   410k|        if (b->interintra_type) {
  ------------------
  |  Branch (1617:13): [True: 16.9k, False: 393k]
  ------------------
 1618|  16.9k|            pixel *const tl_edge = bitfn(t->scratch.edge) + 32;
  ------------------
  |  |   77|  16.9k|#define bitfn(x) x##_16bpc
  ------------------
 1619|  16.9k|            enum IntraPredMode m = b->interintra_mode == II_SMOOTH_PRED ?
  ------------------
  |  Branch (1619:36): [True: 2.69k, False: 14.2k]
  ------------------
 1620|  14.2k|                                   SMOOTH_PRED : b->interintra_mode;
 1621|  16.9k|            pixel *const tmp = bitfn(t->scratch.interintra);
  ------------------
  |  |   77|  16.9k|#define bitfn(x) x##_16bpc
  ------------------
 1622|  16.9k|            int angle = 0;
 1623|  16.9k|            const pixel *top_sb_edge = NULL;
 1624|  16.9k|            if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1624:17): [True: 2.38k, False: 14.6k]
  ------------------
 1625|  2.38k|                top_sb_edge = f->ipred_edge[0];
 1626|  2.38k|                const int sby = t->by >> f->sb_shift;
 1627|  2.38k|                top_sb_edge += f->sb128w * 128 * (sby - 1);
 1628|  2.38k|            }
 1629|  16.9k|            m = bytefn(dav1d_prepare_intra_edges)(t->bx, t->bx > ts->tiling.col_start,
  ------------------
  |  |   87|  16.9k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  16.9k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1630|  16.9k|                                                  t->by, t->by > ts->tiling.row_start,
 1631|  16.9k|                                                  ts->tiling.col_end, ts->tiling.row_end,
 1632|  16.9k|                                                  0, dst, f->cur.stride[0], top_sb_edge,
 1633|  16.9k|                                                  m, &angle, bw4, bh4, 0, tl_edge
 1634|  16.9k|                                                  HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  16.9k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1635|  16.9k|            dsp->ipred.intra_pred[m](tmp, 4 * bw4 * sizeof(pixel),
 1636|  16.9k|                                     tl_edge, bw4 * 4, bh4 * 4, 0, 0, 0
 1637|  16.9k|                                     HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  16.9k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1638|  16.9k|            dsp->mc.blend(dst, f->cur.stride[0], tmp,
 1639|  16.9k|                          bw4 * 4, bh4 * 4, II_MASK(0, bs, b));
  ------------------
  |  |   83|  16.9k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   84|  16.9k|    (size_t)((b)->interintra_type == INTER_INTRA_BLEND ? \
  |  |  ------------------
  |  |  |  Branch (84:14): [True: 12.5k, False: 4.40k]
  |  |  ------------------
  |  |   85|  16.9k|    dav1d_masks.offsets[c][(bs)-BS_32x32].ii[(b)->interintra_mode] : \
  |  |   86|  16.9k|    dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
  ------------------
 1640|  16.9k|        }
 1641|       |
 1642|   410k|        if (!has_chroma) goto skip_inter_chroma_pred;
  ------------------
  |  Branch (1642:13): [True: 309k, False: 100k]
  ------------------
 1643|       |
 1644|       |        // sub8x8 derivation
 1645|   100k|        int is_sub8x8 = bw4 == ss_hor || bh4 == ss_ver;
  ------------------
  |  Branch (1645:25): [True: 3.47k, False: 97.4k]
  |  Branch (1645:42): [True: 1.77k, False: 95.6k]
  ------------------
 1646|   100k|        refmvs_block *const *r;
 1647|   100k|        if (is_sub8x8) {
  ------------------
  |  Branch (1647:13): [True: 5.25k, False: 95.6k]
  ------------------
 1648|  5.25k|            assert(ss_hor == 1);
  ------------------
  |  Branch (1648:13): [True: 5.25k, False: 0]
  ------------------
 1649|  5.25k|            r = &t->rt.r[(t->by & 31) + 5];
 1650|  5.25k|            if (bw4 == 1) is_sub8x8 &= r[0][t->bx - 1].ref.ref[0] > 0;
  ------------------
  |  Branch (1650:17): [True: 3.47k, False: 1.77k]
  ------------------
 1651|  5.25k|            if (bh4 == ss_ver) is_sub8x8 &= r[-1][t->bx].ref.ref[0] > 0;
  ------------------
  |  Branch (1651:17): [True: 3.57k, False: 1.67k]
  ------------------
 1652|  5.25k|            if (bw4 == 1 && bh4 == ss_ver)
  ------------------
  |  Branch (1652:17): [True: 3.47k, False: 1.77k]
  |  Branch (1652:29): [True: 1.80k, False: 1.67k]
  ------------------
 1653|  1.80k|                is_sub8x8 &= r[-1][t->bx - 1].ref.ref[0] > 0;
 1654|  5.25k|        }
 1655|       |
 1656|       |        // chroma prediction
 1657|   100k|        if (is_sub8x8) {
  ------------------
  |  Branch (1657:13): [True: 5.11k, False: 95.7k]
  ------------------
 1658|  5.11k|            assert(ss_hor == 1);
  ------------------
  |  Branch (1658:13): [True: 5.11k, False: 0]
  ------------------
 1659|  5.11k|            ptrdiff_t h_off = 0, v_off = 0;
 1660|  5.11k|            if (bw4 == 1 && bh4 == ss_ver) {
  ------------------
  |  Branch (1660:17): [True: 3.40k, False: 1.71k]
  |  Branch (1660:29): [True: 1.76k, False: 1.63k]
  ------------------
 1661|  5.30k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1661:34): [True: 3.53k, False: 1.76k]
  ------------------
 1662|  3.53k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1663|  3.53k|                             NULL, f->cur.stride[1],
 1664|  3.53k|                             bw4, bh4, t->bx - 1, t->by - 1, 1 + pl,
 1665|  3.53k|                             r[-1][t->bx - 1].mv.mv[0],
 1666|  3.53k|                             &f->refp[r[-1][t->bx - 1].ref.ref[0] - 1],
 1667|  3.53k|                             r[-1][t->bx - 1].ref.ref[0] - 1,
 1668|  3.53k|                             t->frame_thread.pass != 2 ? t->tl_4x4_filter :
  ------------------
  |  Branch (1668:30): [True: 3.53k, False: 0]
  ------------------
 1669|  3.53k|                                 f->frame_thread.b[((t->by - 1) * f->b4_stride) + t->bx - 1].filter2d);
 1670|  3.53k|                    if (res) return res;
  ------------------
  |  Branch (1670:25): [True: 0, False: 3.53k]
  ------------------
 1671|  3.53k|                }
 1672|  1.76k|                v_off = 2 * PXSTRIDE(f->cur.stride[1]);
 1673|  1.76k|                h_off = 2;
 1674|  1.76k|            }
 1675|  5.11k|            if (bw4 == 1) {
  ------------------
  |  Branch (1675:17): [True: 3.40k, False: 1.71k]
  ------------------
 1676|  3.40k|                const enum Filter2d left_filter_2d =
 1677|  3.40k|                    dav1d_filter_2d[t->l.filter[1][by4]][t->l.filter[0][by4]];
 1678|  10.2k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1678:34): [True: 6.80k, False: 3.40k]
  ------------------
 1679|  6.80k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + v_off, NULL,
 1680|  6.80k|                             f->cur.stride[1], bw4, bh4, t->bx - 1,
 1681|  6.80k|                             t->by, 1 + pl, r[0][t->bx - 1].mv.mv[0],
 1682|  6.80k|                             &f->refp[r[0][t->bx - 1].ref.ref[0] - 1],
 1683|  6.80k|                             r[0][t->bx - 1].ref.ref[0] - 1,
 1684|  6.80k|                             t->frame_thread.pass != 2 ? left_filter_2d :
  ------------------
  |  Branch (1684:30): [True: 6.80k, False: 0]
  ------------------
 1685|  6.80k|                                 f->frame_thread.b[(t->by * f->b4_stride) + t->bx - 1].filter2d);
 1686|  6.80k|                    if (res) return res;
  ------------------
  |  Branch (1686:25): [True: 0, False: 6.80k]
  ------------------
 1687|  6.80k|                }
 1688|  3.40k|                h_off = 2;
 1689|  3.40k|            }
 1690|  5.11k|            if (bh4 == ss_ver) {
  ------------------
  |  Branch (1690:17): [True: 3.48k, False: 1.63k]
  ------------------
 1691|  3.48k|                const enum Filter2d top_filter_2d =
 1692|  3.48k|                    dav1d_filter_2d[t->a->filter[1][bx4]][t->a->filter[0][bx4]];
 1693|  10.4k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1693:34): [True: 6.96k, False: 3.48k]
  ------------------
 1694|  6.96k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + h_off, NULL,
 1695|  6.96k|                             f->cur.stride[1], bw4, bh4, t->bx, t->by - 1,
 1696|  6.96k|                             1 + pl, r[-1][t->bx].mv.mv[0],
 1697|  6.96k|                             &f->refp[r[-1][t->bx].ref.ref[0] - 1],
 1698|  6.96k|                             r[-1][t->bx].ref.ref[0] - 1,
 1699|  6.96k|                             t->frame_thread.pass != 2 ? top_filter_2d :
  ------------------
  |  Branch (1699:30): [True: 6.96k, False: 0]
  ------------------
 1700|  6.96k|                                 f->frame_thread.b[((t->by - 1) * f->b4_stride) + t->bx].filter2d);
 1701|  6.96k|                    if (res) return res;
  ------------------
  |  Branch (1701:25): [True: 0, False: 6.96k]
  ------------------
 1702|  6.96k|                }
 1703|  3.48k|                v_off = 2 * PXSTRIDE(f->cur.stride[1]);
 1704|  3.48k|            }
 1705|  15.3k|            for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1705:30): [True: 10.2k, False: 5.11k]
  ------------------
 1706|  10.2k|                res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff + h_off + v_off, NULL, f->cur.stride[1],
 1707|  10.2k|                         bw4, bh4, t->bx, t->by, 1 + pl, b->mv[0],
 1708|  10.2k|                         refp, b->ref[0], filter_2d);
 1709|  10.2k|                if (res) return res;
  ------------------
  |  Branch (1709:21): [True: 0, False: 10.2k]
  ------------------
 1710|  10.2k|            }
 1711|  95.7k|        } else {
 1712|  95.7k|            if (imin(cbw4, cbh4) > 1 &&
  ------------------
  |  Branch (1712:17): [True: 55.0k, False: 40.7k]
  ------------------
 1713|  55.0k|                ((b->inter_mode == GLOBALMV && f->gmv_warp_allowed[b->ref[0]]) ||
  ------------------
  |  Branch (1713:19): [True: 22.0k, False: 33.0k]
  |  Branch (1713:48): [True: 4.46k, False: 17.5k]
  ------------------
 1714|  50.6k|                 (b->motion_mode == MM_WARP && t->warpmv.type > DAV1D_WM_TYPE_TRANSLATION)))
  ------------------
  |  Branch (1714:19): [True: 4.10k, False: 46.4k]
  |  Branch (1714:48): [True: 2.78k, False: 1.32k]
  ------------------
 1715|  7.24k|            {
 1716|  21.7k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1716:34): [True: 14.4k, False: 7.24k]
  ------------------
 1717|  14.4k|                    res = warp_affine(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff, NULL,
 1718|  14.4k|                                      f->cur.stride[1], b_dim, 1 + pl, refp,
 1719|  14.4k|                                      b->motion_mode == MM_WARP ? &t->warpmv :
  ------------------
  |  Branch (1719:39): [True: 5.56k, False: 8.92k]
  ------------------
 1720|  14.4k|                                          &f->frame_hdr->gmv[b->ref[0]]);
 1721|  14.4k|                    if (res) return res;
  ------------------
  |  Branch (1721:25): [True: 0, False: 14.4k]
  ------------------
 1722|  14.4k|                }
 1723|  88.5k|            } else {
 1724|   265k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1724:34): [True: 177k, False: 88.5k]
  ------------------
 1725|   177k|                    res = mc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1726|   177k|                             NULL, f->cur.stride[1],
 1727|   177k|                             bw4 << (bw4 == ss_hor), bh4 << (bh4 == ss_ver),
 1728|   177k|                             t->bx & ~ss_hor, t->by & ~ss_ver,
 1729|   177k|                             1 + pl, b->mv[0], refp, b->ref[0], filter_2d);
 1730|   177k|                    if (res) return res;
  ------------------
  |  Branch (1730:25): [True: 0, False: 177k]
  ------------------
 1731|   177k|                    if (b->motion_mode == MM_OBMC) {
  ------------------
  |  Branch (1731:25): [True: 36.3k, False: 140k]
  ------------------
 1732|  36.3k|                        res = obmc(t, ((pixel *) f->cur.data[1 + pl]) + uvdstoff,
 1733|  36.3k|                                   f->cur.stride[1], b_dim, 1 + pl, bx4, by4, w4, h4);
 1734|  36.3k|                        if (res) return res;
  ------------------
  |  Branch (1734:29): [True: 0, False: 36.3k]
  ------------------
 1735|  36.3k|                    }
 1736|   177k|                }
 1737|  88.5k|            }
 1738|  95.7k|            if (b->interintra_type) {
  ------------------
  |  Branch (1738:17): [True: 6.97k, False: 88.8k]
  ------------------
 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|  6.97k|                const uint8_t *const ii_mask = II_MASK(chr_layout_idx, bs, b);
  ------------------
  |  |   83|  6.97k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   84|  6.97k|    (size_t)((b)->interintra_type == INTER_INTRA_BLEND ? \
  |  |  ------------------
  |  |  |  Branch (84:14): [True: 5.30k, False: 1.66k]
  |  |  ------------------
  |  |   85|  6.97k|    dav1d_masks.offsets[c][(bs)-BS_32x32].ii[(b)->interintra_mode] : \
  |  |   86|  6.97k|    dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
  ------------------
 1743|       |
 1744|  20.9k|                for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1744:34): [True: 13.9k, False: 6.97k]
  ------------------
 1745|  13.9k|                    pixel *const tmp = bitfn(t->scratch.interintra);
  ------------------
  |  |   77|  13.9k|#define bitfn(x) x##_16bpc
  ------------------
 1746|  13.9k|                    pixel *const tl_edge = bitfn(t->scratch.edge) + 32;
  ------------------
  |  |   77|  13.9k|#define bitfn(x) x##_16bpc
  ------------------
 1747|  13.9k|                    enum IntraPredMode m =
 1748|  13.9k|                        b->interintra_mode == II_SMOOTH_PRED ?
  ------------------
  |  Branch (1748:25): [True: 2.28k, False: 11.6k]
  ------------------
 1749|  11.6k|                        SMOOTH_PRED : b->interintra_mode;
 1750|  13.9k|                    int angle = 0;
 1751|  13.9k|                    pixel *const uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff;
 1752|  13.9k|                    const pixel *top_sb_edge = NULL;
 1753|  13.9k|                    if (!(t->by & (f->sb_step - 1))) {
  ------------------
  |  Branch (1753:25): [True: 2.77k, False: 11.1k]
  ------------------
 1754|  2.77k|                        top_sb_edge = f->ipred_edge[pl + 1];
 1755|  2.77k|                        const int sby = t->by >> f->sb_shift;
 1756|  2.77k|                        top_sb_edge += f->sb128w * 128 * (sby - 1);
 1757|  2.77k|                    }
 1758|  13.9k|                    m = bytefn(dav1d_prepare_intra_edges)(t->bx >> ss_hor,
  ------------------
  |  |   87|  13.9k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  13.9k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 1759|  13.9k|                                                          (t->bx >> ss_hor) >
 1760|  13.9k|                                                              (ts->tiling.col_start >> ss_hor),
 1761|  13.9k|                                                          t->by >> ss_ver,
 1762|  13.9k|                                                          (t->by >> ss_ver) >
 1763|  13.9k|                                                              (ts->tiling.row_start >> ss_ver),
 1764|  13.9k|                                                          ts->tiling.col_end >> ss_hor,
 1765|  13.9k|                                                          ts->tiling.row_end >> ss_ver,
 1766|  13.9k|                                                          0, uvdst, f->cur.stride[1],
 1767|  13.9k|                                                          top_sb_edge, m,
 1768|  13.9k|                                                          &angle, cbw4, cbh4, 0, tl_edge
 1769|  13.9k|                                                          HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  13.9k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1770|  13.9k|                    dsp->ipred.intra_pred[m](tmp, cbw4 * 4 * sizeof(pixel),
 1771|  13.9k|                                             tl_edge, cbw4 * 4, cbh4 * 4, 0, 0, 0
 1772|  13.9k|                                             HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  13.9k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1773|  13.9k|                    dsp->mc.blend(uvdst, f->cur.stride[1], tmp,
 1774|  13.9k|                                  cbw4 * 4, cbh4 * 4, ii_mask);
 1775|  13.9k|                }
 1776|  6.97k|            }
 1777|  95.7k|        }
 1778|       |
 1779|   410k|    skip_inter_chroma_pred: {}
 1780|   410k|        t->tl_4x4_filter = filter_2d;
 1781|   410k|    } else {
 1782|  66.2k|        const enum Filter2d filter_2d = b->filter2d;
 1783|       |        // Maximum super block size is 128x128
 1784|  66.2k|        int16_t (*tmp)[128 * 128] = t->scratch.compinter;
 1785|  66.2k|        int jnt_weight;
 1786|  66.2k|        uint8_t *const seg_mask = t->scratch.seg_mask;
 1787|  66.2k|        const uint8_t *mask;
 1788|       |
 1789|   198k|        for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1789:25): [True: 132k, False: 66.2k]
  ------------------
 1790|   132k|            const Dav1dThreadPicture *const refp = &f->refp[b->ref[i]];
 1791|       |
 1792|   132k|            if (b->inter_mode == GLOBALMV_GLOBALMV && f->gmv_warp_allowed[b->ref[i]]) {
  ------------------
  |  Branch (1792:17): [True: 11.4k, False: 121k]
  |  Branch (1792:55): [True: 654, False: 10.7k]
  ------------------
 1793|    654|                res = warp_affine(t, NULL, tmp[i], bw4 * 4, b_dim, 0, refp,
 1794|    654|                                  &f->frame_hdr->gmv[b->ref[i]]);
 1795|    654|                if (res) return res;
  ------------------
  |  Branch (1795:21): [True: 0, False: 654]
  ------------------
 1796|   131k|            } else {
 1797|   131k|                res = mc(t, NULL, tmp[i], 0, bw4, bh4, t->bx, t->by, 0,
 1798|   131k|                         b->mv[i], refp, b->ref[i], filter_2d);
 1799|   131k|                if (res) return res;
  ------------------
  |  Branch (1799:21): [True: 0, False: 131k]
  ------------------
 1800|   131k|            }
 1801|   132k|        }
 1802|  66.2k|        switch (b->comp_type) {
  ------------------
  |  Branch (1802:17): [True: 66.2k, False: 0]
  ------------------
 1803|  40.2k|        case COMP_INTER_AVG:
  ------------------
  |  Branch (1803:9): [True: 40.2k, False: 26.0k]
  ------------------
 1804|  40.2k|            dsp->mc.avg(dst, f->cur.stride[0], tmp[0], tmp[1],
 1805|  40.2k|                        bw4 * 4, bh4 * 4 HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  40.2k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1806|  40.2k|            break;
 1807|  8.26k|        case COMP_INTER_WEIGHTED_AVG:
  ------------------
  |  Branch (1807:9): [True: 8.26k, False: 57.9k]
  ------------------
 1808|  8.26k|            jnt_weight = f->jnt_weights[b->ref[0]][b->ref[1]];
 1809|  8.26k|            dsp->mc.w_avg(dst, f->cur.stride[0], tmp[0], tmp[1],
 1810|  8.26k|                          bw4 * 4, bh4 * 4, jnt_weight HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  8.26k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1811|  8.26k|            break;
 1812|  12.1k|        case COMP_INTER_SEG:
  ------------------
  |  Branch (1812:9): [True: 12.1k, False: 54.1k]
  ------------------
 1813|  12.1k|            dsp->mc.w_mask[chr_layout_idx](dst, f->cur.stride[0],
 1814|  12.1k|                                           tmp[b->mask_sign], tmp[!b->mask_sign],
 1815|  12.1k|                                           bw4 * 4, bh4 * 4, seg_mask,
 1816|  12.1k|                                           b->mask_sign HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  12.1k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1817|  12.1k|            mask = seg_mask;
 1818|  12.1k|            break;
 1819|  5.62k|        case COMP_INTER_WEDGE:
  ------------------
  |  Branch (1819:9): [True: 5.62k, False: 60.6k]
  ------------------
 1820|  5.62k|            mask = WEDGE_MASK(0, bs, 0, b->wedge_idx);
  ------------------
  |  |   89|  5.62k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   90|  5.62k|    (size_t)dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
  ------------------
 1821|  5.62k|            dsp->mc.mask(dst, f->cur.stride[0],
 1822|  5.62k|                         tmp[b->mask_sign], tmp[!b->mask_sign],
 1823|  5.62k|                         bw4 * 4, bh4 * 4, mask HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  5.62k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1824|  5.62k|            if (has_chroma)
  ------------------
  |  Branch (1824:17): [True: 2.86k, False: 2.75k]
  ------------------
 1825|  2.86k|                mask = WEDGE_MASK(chr_layout_idx, bs, b->mask_sign, b->wedge_idx);
  ------------------
  |  |   89|  2.86k|    ((const uint8_t*)((uintptr_t)&dav1d_masks + \
  |  |   90|  2.86k|    (size_t)dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
  ------------------
 1826|  5.62k|            break;
 1827|  66.2k|        }
 1828|       |
 1829|       |        // chroma
 1830|   118k|        if (has_chroma) for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1830:13): [True: 39.5k, False: 26.6k]
  |  Branch (1830:42): [True: 79.1k, False: 39.5k]
  ------------------
 1831|   237k|            for (int i = 0; i < 2; i++) {
  ------------------
  |  Branch (1831:29): [True: 158k, False: 79.1k]
  ------------------
 1832|   158k|                const Dav1dThreadPicture *const refp = &f->refp[b->ref[i]];
 1833|   158k|                if (b->inter_mode == GLOBALMV_GLOBALMV &&
  ------------------
  |  Branch (1833:21): [True: 14.4k, False: 143k]
  ------------------
 1834|  14.4k|                    imin(cbw4, cbh4) > 1 && f->gmv_warp_allowed[b->ref[i]])
  ------------------
  |  Branch (1834:21): [True: 13.1k, False: 1.35k]
  |  Branch (1834:45): [True: 710, False: 12.3k]
  ------------------
 1835|    710|                {
 1836|    710|                    res = warp_affine(t, NULL, tmp[i], bw4 * 4 >> ss_hor,
 1837|    710|                                      b_dim, 1 + pl,
 1838|    710|                                      refp, &f->frame_hdr->gmv[b->ref[i]]);
 1839|    710|                    if (res) return res;
  ------------------
  |  Branch (1839:25): [True: 0, False: 710]
  ------------------
 1840|   157k|                } else {
 1841|   157k|                    res = mc(t, NULL, tmp[i], 0, bw4, bh4, t->bx, t->by,
 1842|   157k|                             1 + pl, b->mv[i], refp, b->ref[i], filter_2d);
 1843|   157k|                    if (res) return res;
  ------------------
  |  Branch (1843:25): [True: 0, False: 157k]
  ------------------
 1844|   157k|                }
 1845|   158k|            }
 1846|  79.1k|            pixel *const uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff;
 1847|  79.1k|            switch (b->comp_type) {
  ------------------
  |  Branch (1847:21): [True: 79.1k, False: 0]
  ------------------
 1848|  46.5k|            case COMP_INTER_AVG:
  ------------------
  |  Branch (1848:13): [True: 46.5k, False: 32.6k]
  ------------------
 1849|  46.5k|                dsp->mc.avg(uvdst, f->cur.stride[1], tmp[0], tmp[1],
 1850|  46.5k|                            bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver
 1851|  46.5k|                            HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  46.5k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1852|  46.5k|                break;
 1853|  13.2k|            case COMP_INTER_WEIGHTED_AVG:
  ------------------
  |  Branch (1853:13): [True: 13.2k, False: 65.8k]
  ------------------
 1854|  13.2k|                dsp->mc.w_avg(uvdst, f->cur.stride[1], tmp[0], tmp[1],
 1855|  13.2k|                              bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver, jnt_weight
 1856|  13.2k|                              HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  13.2k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1857|  13.2k|                break;
 1858|  5.72k|            case COMP_INTER_WEDGE:
  ------------------
  |  Branch (1858:13): [True: 5.72k, False: 73.4k]
  ------------------
 1859|  19.3k|            case COMP_INTER_SEG:
  ------------------
  |  Branch (1859:13): [True: 13.6k, False: 65.5k]
  ------------------
 1860|  19.3k|                dsp->mc.mask(uvdst, f->cur.stride[1],
 1861|  19.3k|                             tmp[b->mask_sign], tmp[!b->mask_sign],
 1862|  19.3k|                             bw4 * 4 >> ss_hor, bh4 * 4 >> ss_ver, mask
 1863|  19.3k|                             HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  19.3k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1864|  19.3k|                break;
 1865|  79.1k|            }
 1866|  79.1k|        }
 1867|  66.2k|    }
 1868|       |
 1869|  1.05M|    if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS) {
  ------------------
  |  |   34|  1.05M|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 1.05M]
  |  |  ------------------
  |  |   35|  1.05M|        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.05M|        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.05M|    const int cw4 = (w4 + ss_hor) >> ss_hor, ch4 = (h4 + ss_ver) >> ss_ver;
 1880|       |
 1881|  1.05M|    if (b->skip) {
  ------------------
  |  Branch (1881:9): [True: 867k, False: 191k]
  ------------------
 1882|       |        // reset coef contexts
 1883|   867k|        BlockContext *const a = t->a;
 1884|   867k|        dav1d_memset_pow2[b_dim[2]](&a->lcoef[bx4], 0x40);
 1885|   867k|        dav1d_memset_pow2[b_dim[3]](&t->l.lcoef[by4], 0x40);
 1886|   867k|        if (has_chroma) {
  ------------------
  |  Branch (1886:13): [True: 260k, False: 607k]
  ------------------
 1887|   260k|            dav1d_memset_pow2_fn memset_cw = dav1d_memset_pow2[ulog2(cbw4)];
 1888|   260k|            dav1d_memset_pow2_fn memset_ch = dav1d_memset_pow2[ulog2(cbh4)];
 1889|   260k|            memset_cw(&a->ccoef[0][cbx4], 0x40);
 1890|   260k|            memset_cw(&a->ccoef[1][cbx4], 0x40);
 1891|   260k|            memset_ch(&t->l.ccoef[0][cby4], 0x40);
 1892|   260k|            memset_ch(&t->l.ccoef[1][cby4], 0x40);
 1893|   260k|        }
 1894|   867k|        return 0;
 1895|   867k|    }
 1896|       |
 1897|   191k|    const TxfmInfo *const uvtx = &dav1d_txfm_dimensions[b->uvtx];
 1898|   191k|    const TxfmInfo *const ytx = &dav1d_txfm_dimensions[b->max_ytx];
 1899|   191k|    const uint16_t tx_split[2] = { b->tx_split0, b->tx_split1 };
 1900|       |
 1901|   386k|    for (int init_y = 0; init_y < bh4; init_y += 16) {
  ------------------
  |  Branch (1901:26): [True: 194k, False: 191k]
  ------------------
 1902|   395k|        for (int init_x = 0; init_x < bw4; init_x += 16) {
  ------------------
  |  Branch (1902:30): [True: 200k, False: 194k]
  ------------------
 1903|       |            // coefficient coding & inverse transforms
 1904|   200k|            int y_off = !!init_y, y;
 1905|   200k|            dst += PXSTRIDE(f->cur.stride[0]) * 4 * init_y;
 1906|   432k|            for (y = init_y, t->by += init_y; y < imin(h4, init_y + 16);
  ------------------
  |  Branch (1906:47): [True: 231k, False: 200k]
  ------------------
 1907|   231k|                 y += ytx->h, y_off++)
 1908|   231k|            {
 1909|   231k|                int x, x_off = !!init_x;
 1910|   649k|                for (x = init_x, t->bx += init_x; x < imin(w4, init_x + 16);
  ------------------
  |  Branch (1910:51): [True: 417k, False: 231k]
  ------------------
 1911|   417k|                     x += ytx->w, x_off++)
 1912|   417k|                {
 1913|   417k|                    read_coef_tree(t, bs, b, b->max_ytx, 0, tx_split,
 1914|   417k|                                   x_off, y_off, &dst[x * 4]);
 1915|   417k|                    t->bx += ytx->w;
 1916|   417k|                }
 1917|   231k|                dst += PXSTRIDE(f->cur.stride[0]) * 4 * ytx->h;
 1918|   231k|                t->bx -= x;
 1919|   231k|                t->by += ytx->h;
 1920|   231k|            }
 1921|   200k|            dst -= PXSTRIDE(f->cur.stride[0]) * 4 * y;
 1922|   200k|            t->by -= y;
 1923|       |
 1924|       |            // chroma coefs and inverse transform
 1925|   338k|            if (has_chroma) for (int pl = 0; pl < 2; pl++) {
  ------------------
  |  Branch (1925:17): [True: 112k, False: 87.5k]
  |  Branch (1925:46): [True: 225k, False: 112k]
  ------------------
 1926|   225k|                pixel *uvdst = ((pixel *) f->cur.data[1 + pl]) + uvdstoff +
 1927|   225k|                    (PXSTRIDE(f->cur.stride[1]) * init_y * 4 >> ss_ver);
 1928|   225k|                for (y = init_y >> ss_ver, t->by += init_y;
 1929|   489k|                     y < imin(ch4, (init_y + 16) >> ss_ver); y += uvtx->h)
  ------------------
  |  Branch (1929:22): [True: 263k, False: 225k]
  ------------------
 1930|   263k|                {
 1931|   263k|                    int x;
 1932|   263k|                    for (x = init_x >> ss_hor, t->bx += init_x;
 1933|   672k|                         x < imin(cw4, (init_x + 16) >> ss_hor); x += uvtx->w)
  ------------------
  |  Branch (1933:26): [True: 408k, False: 263k]
  ------------------
 1934|   408k|                    {
 1935|   408k|                        coef *cf;
 1936|   408k|                        int eob;
 1937|   408k|                        enum TxfmType txtp;
 1938|   408k|                        if (t->frame_thread.pass) {
  ------------------
  |  Branch (1938:29): [True: 0, False: 408k]
  ------------------
 1939|      0|                            const int p = t->frame_thread.pass & 1;
 1940|      0|                            const int cbi = *ts->frame_thread[p].cbi++;
 1941|      0|                            cf = ts->frame_thread[p].cf;
 1942|      0|                            ts->frame_thread[p].cf += uvtx->w * uvtx->h * 16;
 1943|      0|                            eob  = cbi >> 5;
 1944|      0|                            txtp = cbi & 0x1f;
 1945|   408k|                        } else {
 1946|   408k|                            uint8_t cf_ctx;
 1947|   408k|                            cf = bitfn(t->cf);
  ------------------
  |  |   77|   408k|#define bitfn(x) x##_16bpc
  ------------------
 1948|   408k|                            txtp = t->scratch.txtp_map[(by4 + (y << ss_ver)) * 32 +
 1949|   408k|                                                        bx4 + (x << ss_hor)];
 1950|   408k|                            eob = decode_coefs(t, &t->a->ccoef[pl][cbx4 + x],
 1951|   408k|                                               &t->l.ccoef[pl][cby4 + y],
 1952|   408k|                                               b->uvtx, bs, b, 0, 1 + pl,
 1953|   408k|                                               cf, &txtp, &cf_ctx);
 1954|   408k|                            if (DEBUG_BLOCK_INFO)
  ------------------
  |  |   34|   408k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 408k]
  |  |  ------------------
  |  |   35|   408k|        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|   408k|        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|   408k|                            int ctw = imin(uvtx->w, (f->bw - t->bx + ss_hor) >> ss_hor);
 1959|   408k|                            int cth = imin(uvtx->h, (f->bh - t->by + ss_ver) >> ss_ver);
 1960|   408k|                            dav1d_memset_likely_pow2(&t->a->ccoef[pl][cbx4 + x], cf_ctx, ctw);
 1961|   408k|                            dav1d_memset_likely_pow2(&t->l.ccoef[pl][cby4 + y], cf_ctx, cth);
 1962|   408k|                        }
 1963|   408k|                        if (eob >= 0) {
  ------------------
  |  Branch (1963:29): [True: 152k, False: 256k]
  ------------------
 1964|   152k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   152k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 152k]
  |  |  ------------------
  |  |   35|   152k|        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|   152k|        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|   152k|                            dsp->itx.itxfm_add[b->uvtx]
 1967|   152k|                                              [txtp](&uvdst[4 * x],
 1968|   152k|                                                     f->cur.stride[1],
 1969|   152k|                                                     cf, eob HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|   152k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 1970|   152k|                            if (DEBUG_BLOCK_INFO && DEBUG_B_PIXELS)
  ------------------
  |  |   34|   152k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 152k]
  |  |  ------------------
  |  |   35|   152k|        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|   152k|        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|   152k|                        }
 1974|   408k|                        t->bx += uvtx->w << ss_hor;
 1975|   408k|                    }
 1976|   263k|                    uvdst += PXSTRIDE(f->cur.stride[1]) * 4 * uvtx->h;
 1977|   263k|                    t->bx -= x << ss_hor;
 1978|   263k|                    t->by += uvtx->h << ss_ver;
 1979|   263k|                }
 1980|   225k|                t->by -= y << ss_ver;
 1981|   225k|            }
 1982|   200k|        }
 1983|   194k|    }
 1984|   191k|    return 0;
 1985|  1.05M|}
dav1d_filter_sbrow_deblock_cols_16bpc:
 1987|  71.0k|void bytefn(dav1d_filter_sbrow_deblock_cols)(Dav1dFrameContext *const f, const int sby) {
 1988|  71.0k|    if (!(f->c->inloop_filters & DAV1D_INLOOPFILTER_DEBLOCK) ||
  ------------------
  |  Branch (1988:9): [True: 0, False: 71.0k]
  ------------------
 1989|  71.0k|        (!f->frame_hdr->loopfilter.level_y[0] && !f->frame_hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (1989:10): [True: 46.4k, False: 24.6k]
  |  Branch (1989:50): [True: 42.0k, False: 4.41k]
  ------------------
 1990|  42.0k|    {
 1991|  42.0k|        return;
 1992|  42.0k|    }
 1993|  29.0k|    const int y = sby * f->sb_step * 4;
 1994|  29.0k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 1995|  29.0k|    pixel *const p[3] = {
 1996|  29.0k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
 1997|  29.0k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 1998|  29.0k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
 1999|  29.0k|    };
 2000|  29.0k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2001|  29.0k|    bytefn(dav1d_loopfilter_sbrow_cols)(f, p, mask, sby,
  ------------------
  |  |   87|  29.0k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  29.0k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2002|  29.0k|                                        f->lf.start_of_tile_row[sby]);
 2003|  29.0k|}
dav1d_filter_sbrow_deblock_rows_16bpc:
 2005|  71.0k|void bytefn(dav1d_filter_sbrow_deblock_rows)(Dav1dFrameContext *const f, const int sby) {
 2006|  71.0k|    const int y = sby * f->sb_step * 4;
 2007|  71.0k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2008|  71.0k|    pixel *const p[3] = {
 2009|  71.0k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
 2010|  71.0k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 2011|  71.0k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
 2012|  71.0k|    };
 2013|  71.0k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2014|  71.0k|    if (f->c->inloop_filters & DAV1D_INLOOPFILTER_DEBLOCK &&
  ------------------
  |  Branch (2014:9): [True: 71.0k, False: 0]
  ------------------
 2015|  71.0k|        (f->frame_hdr->loopfilter.level_y[0] || f->frame_hdr->loopfilter.level_y[1]))
  ------------------
  |  Branch (2015:10): [True: 24.6k, False: 46.4k]
  |  Branch (2015:49): [True: 4.41k, False: 42.0k]
  ------------------
 2016|  29.0k|    {
 2017|  29.0k|        bytefn(dav1d_loopfilter_sbrow_rows)(f, p, mask, sby);
  ------------------
  |  |   87|  29.0k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  29.0k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2018|  29.0k|    }
 2019|  71.0k|    if (f->lf.cdef_planes || f->lf.restore_planes) {
  ------------------
  |  Branch (2019:9): [True: 6.97k, False: 64.0k]
  |  Branch (2019:30): [True: 8.97k, False: 55.1k]
  ------------------
 2020|       |        // Store loop filtered pixels required by CDEF / LR
 2021|  15.9k|        bytefn(dav1d_copy_lpf)(f, p, sby);
  ------------------
  |  |   87|  15.9k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  15.9k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2022|  15.9k|    }
 2023|  71.0k|}
dav1d_filter_sbrow_cdef_16bpc:
 2025|  6.97k|void bytefn(dav1d_filter_sbrow_cdef)(Dav1dTaskContext *const tc, const int sby) {
 2026|  6.97k|    const Dav1dFrameContext *const f = tc->f;
 2027|  6.97k|    const int sbsz = f->sb_step;
 2028|  6.97k|    const int y = sby * sbsz * 4;
 2029|  6.97k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2030|  6.97k|    pixel *const p[3] = {
 2031|  6.97k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
 2032|  6.97k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 2033|  6.97k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
 2034|  6.97k|    };
 2035|  6.97k|    Av1Filter *prev_mask = f->lf.mask + ((sby - 1) >> !f->seq_hdr->sb128) * f->sb128w;
 2036|  6.97k|    Av1Filter *mask = f->lf.mask + (sby >> !f->seq_hdr->sb128) * f->sb128w;
 2037|  6.97k|    const int start = sby * sbsz;
 2038|  6.97k|    if (sby) {
  ------------------
  |  Branch (2038:9): [True: 6.20k, False: 770]
  ------------------
 2039|  6.20k|        const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2040|  6.20k|        pixel *p_up[3] = {
 2041|  6.20k|            p[0] - 8 * PXSTRIDE(f->cur.stride[0]),
 2042|  6.20k|            p[1] - (8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 2043|  6.20k|            p[2] - (8 * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 2044|  6.20k|        };
 2045|  6.20k|        bytefn(dav1d_cdef_brow)(tc, p_up, prev_mask, start - 2, start, 1, sby);
  ------------------
  |  |   87|  6.20k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  6.20k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2046|  6.20k|    }
 2047|  6.97k|    const int n_blks = sbsz - 2 * (sby + 1 < f->sbh);
 2048|  6.97k|    const int end = imin(start + n_blks, f->bh);
 2049|  6.97k|    bytefn(dav1d_cdef_brow)(tc, p, mask, start, end, 0, sby);
  ------------------
  |  |   87|  6.97k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  6.97k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2050|  6.97k|}
dav1d_filter_sbrow_resize_16bpc:
 2052|  8.12k|void bytefn(dav1d_filter_sbrow_resize)(Dav1dFrameContext *const f, const int sby) {
 2053|  8.12k|    const int sbsz = f->sb_step;
 2054|  8.12k|    const int y = sby * sbsz * 4;
 2055|  8.12k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2056|  8.12k|    const pixel *const p[3] = {
 2057|  8.12k|        f->lf.p[0] + y * PXSTRIDE(f->cur.stride[0]),
 2058|  8.12k|        f->lf.p[1] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver),
 2059|  8.12k|        f->lf.p[2] + (y * PXSTRIDE(f->cur.stride[1]) >> ss_ver)
 2060|  8.12k|    };
 2061|  8.12k|    pixel *const sr_p[3] = {
 2062|  8.12k|        f->lf.sr_p[0] + y * PXSTRIDE(f->sr_cur.p.stride[0]),
 2063|  8.12k|        f->lf.sr_p[1] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver),
 2064|  8.12k|        f->lf.sr_p[2] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver)
 2065|  8.12k|    };
 2066|  8.12k|    const int has_chroma = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400;
 2067|  27.0k|    for (int pl = 0; pl < 1 + 2 * has_chroma; pl++) {
  ------------------
  |  Branch (2067:22): [True: 18.9k, False: 8.12k]
  ------------------
 2068|  18.9k|        const int ss_ver = pl && f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
  ------------------
  |  Branch (2068:28): [True: 10.8k, False: 8.12k]
  |  Branch (2068:34): [True: 6.39k, False: 4.44k]
  ------------------
 2069|  18.9k|        const int h_start = 8 * !!sby >> ss_ver;
 2070|  18.9k|        const ptrdiff_t dst_stride = f->sr_cur.p.stride[!!pl];
 2071|  18.9k|        pixel *dst = sr_p[pl] - h_start * PXSTRIDE(dst_stride);
 2072|  18.9k|        const ptrdiff_t src_stride = f->cur.stride[!!pl];
 2073|  18.9k|        const pixel *src = p[pl] - h_start * PXSTRIDE(src_stride);
 2074|  18.9k|        const int h_end = 4 * (sbsz - 2 * (sby + 1 < f->sbh)) >> ss_ver;
 2075|  18.9k|        const int ss_hor = pl && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
  ------------------
  |  Branch (2075:28): [True: 10.8k, False: 8.12k]
  |  Branch (2075:34): [True: 8.32k, False: 2.51k]
  ------------------
 2076|  18.9k|        const int dst_w = (f->sr_cur.p.p.w + ss_hor) >> ss_hor;
 2077|  18.9k|        const int src_w = (4 * f->bw + ss_hor) >> ss_hor;
 2078|  18.9k|        const int img_h = (f->cur.p.h - sbsz * 4 * sby + ss_ver) >> ss_ver;
 2079|       |
 2080|  18.9k|        f->dsp->mc.resize(dst, dst_stride, src, src_stride, dst_w,
 2081|  18.9k|                          imin(img_h, h_end) + h_start, src_w,
 2082|  18.9k|                          f->resize_step[!!pl], f->resize_start[!!pl]
 2083|  18.9k|                          HIGHBD_CALL_SUFFIX);
  ------------------
  |  |   73|  18.9k|#define HIGHBD_CALL_SUFFIX , f->bitdepth_max
  ------------------
 2084|  18.9k|    }
 2085|  8.12k|}
dav1d_filter_sbrow_lr_16bpc:
 2087|  13.5k|void bytefn(dav1d_filter_sbrow_lr)(Dav1dFrameContext *const f, const int sby) {
 2088|  13.5k|    if (!(f->c->inloop_filters & DAV1D_INLOOPFILTER_RESTORATION)) return;
  ------------------
  |  Branch (2088:9): [True: 0, False: 13.5k]
  ------------------
 2089|  13.5k|    const int y = sby * f->sb_step * 4;
 2090|  13.5k|    const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2091|  13.5k|    pixel *const sr_p[3] = {
 2092|  13.5k|        f->lf.sr_p[0] + y * PXSTRIDE(f->sr_cur.p.stride[0]),
 2093|  13.5k|        f->lf.sr_p[1] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver),
 2094|  13.5k|        f->lf.sr_p[2] + (y * PXSTRIDE(f->sr_cur.p.stride[1]) >> ss_ver)
 2095|  13.5k|    };
 2096|  13.5k|    bytefn(dav1d_lr_sbrow)(f, sr_p, sby);
  ------------------
  |  |   87|  13.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  13.5k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2097|  13.5k|}
dav1d_filter_sbrow_16bpc:
 2099|  71.0k|void bytefn(dav1d_filter_sbrow)(Dav1dFrameContext *const f, const int sby) {
 2100|  71.0k|    bytefn(dav1d_filter_sbrow_deblock_cols)(f, sby);
  ------------------
  |  |   87|  71.0k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  71.0k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2101|  71.0k|    bytefn(dav1d_filter_sbrow_deblock_rows)(f, sby);
  ------------------
  |  |   87|  71.0k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  71.0k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2102|  71.0k|    if (f->lf.cdef_planes)
  ------------------
  |  Branch (2102:9): [True: 6.97k, False: 64.0k]
  ------------------
 2103|  6.97k|        bytefn(dav1d_filter_sbrow_cdef)(f->c->tc, sby);
  ------------------
  |  |   87|  6.97k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  6.97k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2104|  71.0k|    if (f->frame_hdr->width[0] != f->frame_hdr->width[1])
  ------------------
  |  Branch (2104:9): [True: 8.12k, False: 62.9k]
  ------------------
 2105|  8.12k|        bytefn(dav1d_filter_sbrow_resize)(f, sby);
  ------------------
  |  |   87|  8.12k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  8.12k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2106|  71.0k|    if (f->lf.restore_planes)
  ------------------
  |  Branch (2106:9): [True: 13.5k, False: 57.5k]
  ------------------
 2107|  13.5k|        bytefn(dav1d_filter_sbrow_lr)(f, sby);
  ------------------
  |  |   87|  13.5k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  13.5k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2108|  71.0k|}
dav1d_backup_ipred_edge_16bpc:
 2110|  82.0k|void bytefn(dav1d_backup_ipred_edge)(Dav1dTaskContext *const t) {
 2111|  82.0k|    const Dav1dFrameContext *const f = t->f;
 2112|  82.0k|    Dav1dTileState *const ts = t->ts;
 2113|  82.0k|    const int sby = t->by >> f->sb_shift;
 2114|  82.0k|    const int sby_off = f->sb128w * 128 * sby;
 2115|  82.0k|    const int x_off = ts->tiling.col_start;
 2116|       |
 2117|  82.0k|    const pixel *const y =
 2118|  82.0k|        ((const pixel *) f->cur.data[0]) + x_off * 4 +
 2119|  82.0k|                    ((t->by + f->sb_step) * 4 - 1) * PXSTRIDE(f->cur.stride[0]);
 2120|  82.0k|    pixel_copy(&f->ipred_edge[0][sby_off + x_off * 4], y,
  ------------------
  |  |   65|  82.0k|#define pixel_copy(a, b, c) memcpy(a, b, (c) << 1)
  ------------------
 2121|  82.0k|               4 * (ts->tiling.col_end - x_off));
 2122|       |
 2123|  82.0k|    if (f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I400) {
  ------------------
  |  Branch (2123:9): [True: 48.8k, False: 33.1k]
  ------------------
 2124|  48.8k|        const int ss_ver = f->cur.p.layout == DAV1D_PIXEL_LAYOUT_I420;
 2125|  48.8k|        const int ss_hor = f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444;
 2126|       |
 2127|  48.8k|        const ptrdiff_t uv_off = (x_off * 4 >> ss_hor) +
 2128|  48.8k|            (((t->by + f->sb_step) * 4 >> ss_ver) - 1) * PXSTRIDE(f->cur.stride[1]);
 2129|   146k|        for (int pl = 1; pl <= 2; pl++)
  ------------------
  |  Branch (2129:26): [True: 97.6k, False: 48.8k]
  ------------------
 2130|  97.6k|            pixel_copy(&f->ipred_edge[pl][sby_off + (x_off * 4 >> ss_hor)],
  ------------------
  |  |   65|  97.6k|#define pixel_copy(a, b, c) memcpy(a, b, (c) << 1)
  ------------------
 2131|  48.8k|                       &((const pixel *) f->cur.data[pl])[uv_off],
 2132|  48.8k|                       4 * (ts->tiling.col_end - x_off) >> ss_hor);
 2133|  48.8k|    }
 2134|  82.0k|}
dav1d_copy_pal_block_y_16bpc:
 2140|  52.2k|{
 2141|  52.2k|    const Dav1dFrameContext *const f = t->f;
 2142|  52.2k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2142:24): [True: 0, False: 52.2k]
  ------------------
 2143|      0|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2144|      0|                            ((t->bx >> 1) + (t->by & 1))][0] :
 2145|  52.2k|        bytefn(t->scratch.pal)[0];
  ------------------
  |  |   87|  52.2k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  52.2k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2146|   289k|    for (int x = 0; x < bw4; x++)
  ------------------
  |  Branch (2146:21): [True: 237k, False: 52.2k]
  ------------------
 2147|   237k|        memcpy(bytefn(t->al_pal)[0][bx4 + x][0], pal, 8 * sizeof(pixel));
  ------------------
  |  |   87|   237k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|   237k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2148|   198k|    for (int y = 0; y < bh4; y++)
  ------------------
  |  Branch (2148:21): [True: 146k, False: 52.2k]
  ------------------
 2149|   146k|        memcpy(bytefn(t->al_pal)[1][by4 + y][0], pal, 8 * sizeof(pixel));
  ------------------
  |  |   87|   146k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|   146k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2150|  52.2k|}
dav1d_copy_pal_block_uv_16bpc:
 2156|  11.2k|{
 2157|  11.2k|    const Dav1dFrameContext *const f = t->f;
 2158|  11.2k|    const pixel (*const pal)[8] = t->frame_thread.pass ?
  ------------------
  |  Branch (2158:35): [True: 0, False: 11.2k]
  ------------------
 2159|      0|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2160|      0|                            ((t->bx >> 1) + (t->by & 1))] :
 2161|  11.2k|        bytefn(t->scratch.pal);
  ------------------
  |  |   87|  11.2k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  11.2k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2162|       |    // see aomedia bug 2183 for why we use luma coordinates here
 2163|  33.7k|    for (int pl = 1; pl <= 2; pl++) {
  ------------------
  |  Branch (2163:22): [True: 22.5k, False: 11.2k]
  ------------------
 2164|   129k|        for (int x = 0; x < bw4; x++)
  ------------------
  |  Branch (2164:25): [True: 106k, False: 22.5k]
  ------------------
 2165|   106k|            memcpy(bytefn(t->al_pal)[0][bx4 + x][pl], pal[pl], 8 * sizeof(pixel));
  ------------------
  |  |   87|   106k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|   106k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2166|  96.5k|        for (int y = 0; y < bh4; y++)
  ------------------
  |  Branch (2166:25): [True: 74.0k, False: 22.5k]
  ------------------
 2167|  74.0k|            memcpy(bytefn(t->al_pal)[1][by4 + y][pl], pal[pl], 8 * sizeof(pixel));
  ------------------
  |  |   87|  74.0k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  74.0k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2168|  22.5k|    }
 2169|  11.2k|}
dav1d_read_pal_plane_16bpc:
 2174|  63.4k|{
 2175|  63.4k|    Dav1dTileState *const ts = t->ts;
 2176|  63.4k|    const Dav1dFrameContext *const f = t->f;
 2177|  63.4k|    const int pal_sz = b->pal_sz[pl] = dav1d_msac_decode_symbol_adapt8(&ts->msac,
  ------------------
  |  |   48|  63.4k|#define dav1d_msac_decode_symbol_adapt8  dav1d_msac_decode_symbol_adapt8_sse2
  ------------------
 2178|  63.4k|                                           ts->cdf.m.pal_sz[pl][sz_ctx], 6) + 2;
 2179|  63.4k|    pixel cache[16], used_cache[8];
 2180|  63.4k|    int l_cache = pl ? t->pal_sz_uv[1][by4] : t->l.pal_sz[by4];
  ------------------
  |  Branch (2180:19): [True: 11.2k, False: 52.2k]
  ------------------
 2181|  63.4k|    int n_cache = 0;
 2182|       |    // don't reuse above palette outside SB64 boundaries
 2183|  63.4k|    int a_cache = by4 & 15 ? pl ? t->pal_sz_uv[0][bx4] : t->a->pal_sz[bx4] : 0;
  ------------------
  |  Branch (2183:19): [True: 49.2k, False: 14.2k]
  |  Branch (2183:30): [True: 9.21k, False: 39.9k]
  ------------------
 2184|  63.4k|    const pixel *l = bytefn(t->al_pal)[1][by4][pl];
  ------------------
  |  |   87|  63.4k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  63.4k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2185|  63.4k|    const pixel *a = bytefn(t->al_pal)[0][bx4][pl];
  ------------------
  |  |   87|  63.4k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  63.4k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2186|       |
 2187|       |    // fill/sort cache
 2188|   112k|    while (l_cache && a_cache) {
  ------------------
  |  Branch (2188:12): [True: 70.1k, False: 42.3k]
  |  Branch (2188:23): [True: 49.0k, False: 21.0k]
  ------------------
 2189|  49.0k|        if (*l < *a) {
  ------------------
  |  Branch (2189:13): [True: 23.4k, False: 25.5k]
  ------------------
 2190|  23.4k|            if (!n_cache || cache[n_cache - 1] != *l)
  ------------------
  |  Branch (2190:17): [True: 5.08k, False: 18.4k]
  |  Branch (2190:29): [True: 17.6k, False: 791]
  ------------------
 2191|  22.6k|                cache[n_cache++] = *l;
 2192|  23.4k|            l++;
 2193|  23.4k|            l_cache--;
 2194|  25.5k|        } else {
 2195|  25.5k|            if (*a == *l) {
  ------------------
  |  Branch (2195:17): [True: 8.72k, False: 16.8k]
  ------------------
 2196|  8.72k|                l++;
 2197|  8.72k|                l_cache--;
 2198|  8.72k|            }
 2199|  25.5k|            if (!n_cache || cache[n_cache - 1] != *a)
  ------------------
  |  Branch (2199:17): [True: 3.64k, False: 21.9k]
  |  Branch (2199:29): [True: 21.6k, False: 246]
  ------------------
 2200|  25.3k|                cache[n_cache++] = *a;
 2201|  25.5k|            a++;
 2202|  25.5k|            a_cache--;
 2203|  25.5k|        }
 2204|  49.0k|    }
 2205|  63.4k|    if (l_cache) {
  ------------------
  |  Branch (2205:9): [True: 21.0k, False: 42.3k]
  ------------------
 2206|  93.6k|        do {
 2207|  93.6k|            if (!n_cache || cache[n_cache - 1] != *l)
  ------------------
  |  Branch (2207:17): [True: 18.0k, False: 75.6k]
  |  Branch (2207:29): [True: 63.1k, False: 12.4k]
  ------------------
 2208|  81.1k|                cache[n_cache++] = *l;
 2209|  93.6k|            l++;
 2210|  93.6k|        } while (--l_cache > 0);
  ------------------
  |  Branch (2210:18): [True: 72.5k, False: 21.0k]
  ------------------
 2211|  42.3k|    } else if (a_cache) {
  ------------------
  |  Branch (2211:16): [True: 15.6k, False: 26.7k]
  ------------------
 2212|  71.1k|        do {
 2213|  71.1k|            if (!n_cache || cache[n_cache - 1] != *a)
  ------------------
  |  Branch (2213:17): [True: 11.3k, False: 59.7k]
  |  Branch (2213:29): [True: 50.2k, False: 9.54k]
  ------------------
 2214|  61.5k|                cache[n_cache++] = *a;
 2215|  71.1k|            a++;
 2216|  71.1k|        } while (--a_cache > 0);
  ------------------
  |  Branch (2216:18): [True: 55.5k, False: 15.6k]
  ------------------
 2217|  15.6k|    }
 2218|       |
 2219|       |    // find reused cache entries
 2220|  63.4k|    int i = 0;
 2221|   225k|    for (int n = 0; n < n_cache && i < pal_sz; n++)
  ------------------
  |  Branch (2221:21): [True: 171k, False: 54.4k]
  |  Branch (2221:36): [True: 162k, False: 8.99k]
  ------------------
 2222|   162k|        if (dav1d_msac_decode_bool_equi(&ts->msac))
  ------------------
  |  |   53|   162k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (2222:13): [True: 74.7k, False: 87.7k]
  ------------------
 2223|  74.7k|            used_cache[i++] = cache[n];
 2224|  63.4k|    const int n_used_cache = i;
 2225|       |
 2226|       |    // parse new entries
 2227|  63.4k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2227:24): [True: 0, False: 63.4k]
  ------------------
 2228|      0|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2229|      0|                            ((t->bx >> 1) + (t->by & 1))][pl] :
 2230|  63.4k|        bytefn(t->scratch.pal)[pl];
  ------------------
  |  |   87|  63.4k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  63.4k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2231|  63.4k|    if (i < pal_sz) {
  ------------------
  |  Branch (2231:9): [True: 52.5k, False: 10.9k]
  ------------------
 2232|  52.5k|        const int bpc = BITDEPTH == 8 ? 8 : f->cur.p.bpc;
  ------------------
  |  Branch (2232:25): [Folded, False: 52.5k]
  ------------------
 2233|  52.5k|        int prev = pal[i++] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2234|       |
 2235|  52.5k|        if (i < pal_sz) {
  ------------------
  |  Branch (2235:13): [True: 47.0k, False: 5.48k]
  ------------------
 2236|  47.0k|            int bits = bpc - 3 + dav1d_msac_decode_bools(&ts->msac, 2);
 2237|  47.0k|            const int max = (1 << bpc) - 1;
 2238|       |
 2239|   124k|            do {
 2240|   124k|                const int delta = dav1d_msac_decode_bools(&ts->msac, bits);
 2241|   124k|                prev = pal[i++] = imin(prev + delta + !pl, max);
 2242|   124k|                if (prev + !pl >= max) {
  ------------------
  |  Branch (2242:21): [True: 18.5k, False: 105k]
  ------------------
 2243|  51.9k|                    for (; i < pal_sz; i++)
  ------------------
  |  Branch (2243:28): [True: 33.3k, False: 18.5k]
  ------------------
 2244|  33.3k|                        pal[i] = max;
 2245|  18.5k|                    break;
 2246|  18.5k|                }
 2247|   105k|                bits = imin(bits, 1 + ulog2(max - prev - !pl));
 2248|   105k|            } while (i < pal_sz);
  ------------------
  |  Branch (2248:22): [True: 77.1k, False: 28.4k]
  ------------------
 2249|  47.0k|        }
 2250|       |
 2251|       |        // merge cache+new entries
 2252|  52.5k|        int n = 0, m = n_used_cache;
 2253|   308k|        for (i = 0; i < pal_sz; i++) {
  ------------------
  |  Branch (2253:21): [True: 256k, False: 52.5k]
  ------------------
 2254|   256k|            if (n < n_used_cache && (m >= pal_sz || used_cache[n] <= pal[m])) {
  ------------------
  |  Branch (2254:17): [True: 79.2k, False: 176k]
  |  Branch (2254:38): [True: 16.2k, False: 62.9k]
  |  Branch (2254:53): [True: 29.7k, False: 33.2k]
  ------------------
 2255|  46.0k|                pal[i] = used_cache[n++];
 2256|   210k|            } else {
 2257|   210k|                assert(m < pal_sz);
  ------------------
  |  Branch (2257:17): [True: 210k, False: 0]
  ------------------
 2258|   210k|                pal[i] = pal[m++];
 2259|   210k|            }
 2260|   256k|        }
 2261|  52.5k|    } else {
 2262|  10.9k|        memcpy(pal, used_cache, n_used_cache * sizeof(*used_cache));
 2263|  10.9k|    }
 2264|       |
 2265|  63.4k|    if (DEBUG_BLOCK_INFO) {
  ------------------
  |  |   34|  63.4k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 63.4k]
  |  |  ------------------
  |  |   35|  63.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|  63.4k|        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|  63.4k|}
dav1d_read_pal_uv_16bpc:
 2279|  11.2k|{
 2280|  11.2k|    bytefn(dav1d_read_pal_plane)(t, b, 1, sz_ctx, bx4, by4);
  ------------------
  |  |   87|  11.2k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  11.2k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2281|       |
 2282|       |    // V pal coding
 2283|  11.2k|    Dav1dTileState *const ts = t->ts;
 2284|  11.2k|    const Dav1dFrameContext *const f = t->f;
 2285|  11.2k|    pixel *const pal = t->frame_thread.pass ?
  ------------------
  |  Branch (2285:24): [True: 0, False: 11.2k]
  ------------------
 2286|      0|        f->frame_thread.pal[((t->by >> 1) + (t->bx & 1)) * (f->b4_stride >> 1) +
 2287|      0|                            ((t->bx >> 1) + (t->by & 1))][2] :
 2288|  11.2k|        bytefn(t->scratch.pal)[2];
  ------------------
  |  |   87|  11.2k|#define bytefn(x) bitfn(x)
  |  |  ------------------
  |  |  |  |   77|  11.2k|#define bitfn(x) x##_16bpc
  |  |  ------------------
  ------------------
 2289|  11.2k|    const int bpc = BITDEPTH == 8 ? 8 : f->cur.p.bpc;
  ------------------
  |  Branch (2289:21): [Folded, False: 11.2k]
  ------------------
 2290|  11.2k|    if (dav1d_msac_decode_bool_equi(&ts->msac)) {
  ------------------
  |  |   53|  11.2k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
  |  Branch (2290:9): [True: 5.41k, False: 5.85k]
  ------------------
 2291|  5.41k|        const int bits = bpc - 4 + dav1d_msac_decode_bools(&ts->msac, 2);
 2292|  5.41k|        int prev = pal[0] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2293|  5.41k|        const int max = (1 << bpc) - 1;
 2294|  25.8k|        for (int i = 1; i < b->pal_sz[1]; i++) {
  ------------------
  |  Branch (2294:25): [True: 20.4k, False: 5.41k]
  ------------------
 2295|  20.4k|            int delta = dav1d_msac_decode_bools(&ts->msac, bits);
 2296|  20.4k|            if (delta) {
  ------------------
  |  Branch (2296:17): [True: 20.2k, False: 203]
  ------------------
 2297|  20.2k|                const int sign = dav1d_msac_decode_bool_equi(&ts->msac);
  ------------------
  |  |   53|  20.2k|#define dav1d_msac_decode_bool_equi      dav1d_msac_decode_bool_equi_sse2
  ------------------
 2298|  20.2k|                delta = apply_sign_bool(delta, sign);
 2299|  20.2k|            }
 2300|  20.4k|            prev = pal[i] = (prev + delta) & max;
 2301|  20.4k|        }
 2302|  5.85k|    } else {
 2303|  29.4k|        for (int i = 0; i < b->pal_sz[1]; i++)
  ------------------
  |  Branch (2303:25): [True: 23.6k, False: 5.85k]
  ------------------
 2304|  23.6k|            pal[i] = dav1d_msac_decode_bools(&ts->msac, bpc);
 2305|  5.85k|    }
 2306|  11.2k|    if (DEBUG_BLOCK_INFO) {
  ------------------
  |  |   34|  11.2k|#define DEBUG_BLOCK_INFO 0 && \
  |  |  ------------------
  |  |  |  Branch (34:26): [Folded, False: 11.2k]
  |  |  ------------------
  |  |   35|  11.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|  11.2k|        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|  11.2k|}

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

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

dav1d_refmvs_find:
  343|  1.69M|{
  344|  1.69M|    const refmvs_frame *const rf = rt->rf;
  345|  1.69M|    const uint8_t *const b_dim = dav1d_block_dimensions[bs];
  346|  1.69M|    const int bw4 = b_dim[0], w4 = imin(imin(bw4, 16), rt->tile_col.end - bx4);
  347|  1.69M|    const int bh4 = b_dim[1], h4 = imin(imin(bh4, 16), rt->tile_row.end - by4);
  348|  1.69M|    mv gmv[2], tgmv[2];
  349|       |
  350|  1.69M|    *cnt = 0;
  351|  1.69M|    assert(ref.ref[0] >=  0 && ref.ref[0] <= 7 &&
  ------------------
  |  Branch (351:5): [True: 1.69M, False: 0]
  |  Branch (351:5): [True: 1.69M, False: 0]
  |  Branch (351:5): [True: 1.69M, False: 0]
  |  Branch (351:5): [True: 1.69M, False: 0]
  ------------------
  352|  1.69M|           ref.ref[1] >= -1 && ref.ref[1] <= 7);
  353|  1.69M|    if (ref.ref[0] > 0) {
  ------------------
  |  Branch (353:9): [True: 927k, False: 765k]
  ------------------
  354|   927k|        tgmv[0] = get_gmv_2d(&rf->frm_hdr->gmv[ref.ref[0] - 1],
  355|   927k|                             bx4, by4, bw4, bh4, rf->frm_hdr);
  356|   927k|        gmv[0] = rf->frm_hdr->gmv[ref.ref[0] - 1].type > DAV1D_WM_TYPE_TRANSLATION ?
  ------------------
  |  Branch (356:18): [True: 172k, False: 754k]
  ------------------
  357|   754k|                 tgmv[0] : (mv) { .n = INVALID_MV };
  ------------------
  |  |   40|   754k|#define INVALID_MV 0x80008000
  ------------------
  358|   927k|    } else {
  359|   765k|        tgmv[0] = (mv) { .n = 0 };
  360|   765k|        gmv[0] = (mv) { .n = INVALID_MV };
  ------------------
  |  |   40|   765k|#define INVALID_MV 0x80008000
  ------------------
  361|   765k|    }
  362|  1.69M|    if (ref.ref[1] > 0) {
  ------------------
  |  Branch (362:9): [True: 136k, False: 1.55M]
  ------------------
  363|   136k|        tgmv[1] = get_gmv_2d(&rf->frm_hdr->gmv[ref.ref[1] - 1],
  364|   136k|                             bx4, by4, bw4, bh4, rf->frm_hdr);
  365|   136k|        gmv[1] = rf->frm_hdr->gmv[ref.ref[1] - 1].type > DAV1D_WM_TYPE_TRANSLATION ?
  ------------------
  |  Branch (365:18): [True: 25.4k, False: 111k]
  ------------------
  366|   111k|                 tgmv[1] : (mv) { .n = INVALID_MV };
  ------------------
  |  |   40|   111k|#define INVALID_MV 0x80008000
  ------------------
  367|   136k|    }
  368|       |
  369|       |    // top
  370|  1.69M|    int have_newmv = 0, have_col_mvs = 0, have_row_mvs = 0;
  371|  1.69M|    unsigned max_rows = 0, n_rows = ~0;
  372|  1.69M|    const refmvs_block *b_top;
  373|  1.69M|    if (by4 > rt->tile_row.start) {
  ------------------
  |  Branch (373:9): [True: 1.09M, False: 599k]
  ------------------
  374|  1.09M|        max_rows = imin((by4 - rt->tile_row.start + 1) >> 1, 2 + (bh4 > 1));
  375|  1.09M|        b_top = &rt->r[(by4 & 31) - 1 + 5][bx4];
  376|  1.09M|        n_rows = scan_row(mvstack, cnt, ref, gmv, b_top,
  377|  1.09M|                          bw4, w4, max_rows, bw4 >= 16 ? 4 : 1,
  ------------------
  |  Branch (377:46): [True: 99.9k, False: 993k]
  ------------------
  378|  1.09M|                          &have_newmv, &have_row_mvs);
  379|  1.09M|    }
  380|       |
  381|       |    // left
  382|  1.69M|    unsigned max_cols = 0, n_cols = ~0U;
  383|  1.69M|    refmvs_block *const *b_left;
  384|  1.69M|    if (bx4 > rt->tile_col.start) {
  ------------------
  |  Branch (384:9): [True: 1.62M, False: 69.1k]
  ------------------
  385|  1.62M|        max_cols = imin((bx4 - rt->tile_col.start + 1) >> 1, 2 + (bw4 > 1));
  386|  1.62M|        b_left = &rt->r[(by4 & 31) + 5];
  387|  1.62M|        n_cols = scan_col(mvstack, cnt, ref, gmv, b_left,
  388|  1.62M|                          bh4, h4, bx4 - 1, max_cols, bh4 >= 16 ? 4 : 1,
  ------------------
  |  Branch (388:55): [True: 213k, False: 1.40M]
  ------------------
  389|  1.62M|                          &have_newmv, &have_col_mvs);
  390|  1.62M|    }
  391|       |
  392|       |    // top/right
  393|  1.69M|    if (n_rows != ~0U && edge_flags & EDGE_I444_TOP_HAS_RIGHT &&
  ------------------
  |  Branch (393:9): [True: 1.09M, False: 599k]
  |  Branch (393:26): [True: 650k, False: 442k]
  ------------------
  394|   650k|        imax(bw4, bh4) <= 16 && bw4 + bx4 < rt->tile_col.end)
  ------------------
  |  Branch (394:9): [True: 622k, False: 27.3k]
  |  Branch (394:33): [True: 581k, False: 41.8k]
  ------------------
  395|   581k|    {
  396|   581k|        add_spatial_candidate(mvstack, cnt, 4, &b_top[bw4], ref, gmv,
  397|   581k|                              &have_newmv, &have_row_mvs);
  398|   581k|    }
  399|       |
  400|  1.69M|    const int nearest_match = have_col_mvs + have_row_mvs;
  401|  1.69M|    const int nearest_cnt = *cnt;
  402|  3.69M|    for (int n = 0; n < nearest_cnt; n++)
  ------------------
  |  Branch (402:21): [True: 2.00M, False: 1.69M]
  ------------------
  403|  2.00M|        mvstack[n].weight += 640;
  404|       |
  405|       |    // temporal
  406|  1.69M|    int globalmv_ctx = rf->frm_hdr->use_ref_frame_mvs;
  407|  1.69M|    if (rf->use_ref_frame_mvs) {
  ------------------
  |  Branch (407:9): [True: 178k, False: 1.51M]
  ------------------
  408|   178k|        const ptrdiff_t stride = rf->rp_stride;
  409|   178k|        const int by8 = by4 >> 1, bx8 = bx4 >> 1;
  410|   178k|        const refmvs_temporal_block *const rbi = &rt->rp_proj[(by8 & 15) * stride + bx8];
  411|   178k|        const refmvs_temporal_block *rb = rbi;
  412|   178k|        const int step_h = bw4 >= 16 ? 2 : 1, step_v = bh4 >= 16 ? 2 : 1;
  ------------------
  |  Branch (412:28): [True: 9.62k, False: 168k]
  |  Branch (412:56): [True: 10.4k, False: 167k]
  ------------------
  413|   178k|        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|   178k|        const refmvs_temporal_block *run = &rb[0];
  428|   178k|        int run_len = 1;
  429|   178k|        int *run_gmv_ctx = &globalmv_ctx;
  430|   469k|        for (int y = 0; y < h8; y += step_v) {
  ------------------
  |  Branch (430:25): [True: 291k, False: 178k]
  ------------------
  431|   719k|            for (int x = y ? 0 : step_h; x < w8; x += step_h) {
  ------------------
  |  Branch (431:26): [True: 112k, False: 178k]
  |  Branch (431:42): [True: 427k, False: 291k]
  ------------------
  432|   427k|                const unsigned mvn = rb[x].mv.n;
  433|   427k|                if (mvn == run->mv.n &&
  ------------------
  |  Branch (433:21): [True: 420k, False: 7.18k]
  ------------------
  434|   420k|                    (mvn == INVALID_MV || rb[x].ref == run->ref))
  ------------------
  |  |   40|   841k|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (434:22): [True: 276k, False: 144k]
  |  Branch (434:43): [True: 144k, False: 225]
  ------------------
  435|   420k|                {
  436|   420k|                    run_len++;
  437|   420k|                    continue;
  438|   420k|                }
  439|  7.40k|                add_temporal_candidate(rf, mvstack, cnt, run, ref,
  440|  7.40k|                                       run_gmv_ctx, tgmv, 2 * run_len);
  441|  7.40k|                run_gmv_ctx = NULL;
  442|  7.40k|                run = &rb[x];
  443|  7.40k|                run_len = 1;
  444|  7.40k|            }
  445|   291k|            rb += stride * step_v;
  446|   291k|        }
  447|   178k|        add_temporal_candidate(rf, mvstack, cnt, run, ref,
  448|   178k|                               run_gmv_ctx, tgmv, 2 * run_len);
  449|   178k|        if (imin(bw4, bh4) >= 2 && imax(bw4, bh4) < 16) {
  ------------------
  |  Branch (449:13): [True: 109k, False: 69.0k]
  |  Branch (449:36): [True: 96.6k, False: 12.8k]
  ------------------
  450|  96.6k|            const int bh8 = bh4 >> 1, bw8 = bw4 >> 1;
  451|  96.6k|            rb = &rbi[bh8 * stride];
  452|  96.6k|            const int has_bottom = by8 + bh8 < imin(rt->tile_row.end >> 1,
  453|  96.6k|                                                    (by8 & ~7) + 8);
  454|  96.6k|            if (has_bottom && bx8 - 1 >= imax(rt->tile_col.start >> 1, bx8 & ~7)) {
  ------------------
  |  Branch (454:17): [True: 70.1k, False: 26.4k]
  |  Branch (454:31): [True: 53.8k, False: 16.2k]
  ------------------
  455|  53.8k|                add_temporal_candidate(rf, mvstack, cnt, &rb[-1], ref,
  456|  53.8k|                                       NULL, NULL, 2);
  457|  53.8k|            }
  458|  96.6k|            if (bx8 + bw8 < imin(rt->tile_col.end >> 1, (bx8 & ~7) + 8)) {
  ------------------
  |  Branch (458:17): [True: 69.8k, False: 26.7k]
  ------------------
  459|  69.8k|                if (has_bottom) {
  ------------------
  |  Branch (459:21): [True: 53.6k, False: 16.2k]
  ------------------
  460|  53.6k|                    add_temporal_candidate(rf, mvstack, cnt, &rb[bw8], ref,
  461|  53.6k|                                           NULL, NULL, 2);
  462|  53.6k|                }
  463|  69.8k|                if (by8 + bh8 - 1 < imin(rt->tile_row.end >> 1, (by8 & ~7) + 8)) {
  ------------------
  |  Branch (463:21): [True: 69.4k, False: 441]
  ------------------
  464|  69.4k|                    add_temporal_candidate(rf, mvstack, cnt, &rb[bw8 - stride],
  465|  69.4k|                                           ref, NULL, NULL, 2);
  466|  69.4k|                }
  467|  69.8k|            }
  468|  96.6k|        }
  469|   178k|    }
  470|  1.69M|    assert(*cnt <= 8);
  ------------------
  |  Branch (470:5): [True: 1.69M, False: 0]
  ------------------
  471|       |
  472|       |    // top/left (which, confusingly, is part of "secondary" references)
  473|  1.69M|    int have_dummy_newmv_match;
  474|  1.69M|    if ((n_rows | n_cols) != ~0U) {
  ------------------
  |  Branch (474:9): [True: 1.03M, False: 655k]
  ------------------
  475|  1.03M|        add_spatial_candidate(mvstack, cnt, 4, &b_top[-1], ref, gmv,
  476|  1.03M|                              &have_dummy_newmv_match, &have_row_mvs);
  477|  1.03M|    }
  478|       |
  479|       |    // "secondary" (non-direct neighbour) top & left edges
  480|       |    // what is different about secondary is that everything is now in 8x8 resolution
  481|  5.07M|    for (int n = 2; n <= 3; n++) {
  ------------------
  |  Branch (481:21): [True: 3.38M, False: 1.69M]
  ------------------
  482|  3.38M|        if ((unsigned) n > n_rows && (unsigned) n <= max_rows) {
  ------------------
  |  Branch (482:13): [True: 1.57M, False: 1.81M]
  |  Branch (482:38): [True: 1.04M, False: 532k]
  ------------------
  483|  1.04M|            n_rows += scan_row(mvstack, cnt, ref, gmv,
  484|  1.04M|                               &rt->r[(((by4 & 31) - 2 * n + 1) | 1) + 5][bx4 | 1],
  485|  1.04M|                               bw4, w4, 1 + max_rows - n, bw4 >= 16 ? 4 : 2,
  ------------------
  |  Branch (485:59): [True: 17.2k, False: 1.02M]
  ------------------
  486|  1.04M|                               &have_dummy_newmv_match, &have_row_mvs);
  487|  1.04M|        }
  488|       |
  489|  3.38M|        if ((unsigned) n > n_cols && (unsigned) n <= max_cols) {
  ------------------
  |  Branch (489:13): [True: 2.49M, False: 886k]
  |  Branch (489:38): [True: 1.82M, False: 673k]
  ------------------
  490|  1.82M|            n_cols += scan_col(mvstack, cnt, ref, gmv, &rt->r[((by4 & 31) | 1) + 5],
  491|  1.82M|                               bh4, h4, (bx4 - n * 2 + 1) | 1,
  492|  1.82M|                               1 + max_cols - n, bh4 >= 16 ? 4 : 2,
  ------------------
  |  Branch (492:50): [True: 158k, False: 1.66M]
  ------------------
  493|  1.82M|                               &have_dummy_newmv_match, &have_col_mvs);
  494|  1.82M|        }
  495|  3.38M|    }
  496|  1.69M|    assert(*cnt <= 8);
  ------------------
  |  Branch (496:5): [True: 1.69M, False: 0]
  ------------------
  497|       |
  498|  1.69M|    const int ref_match_count = have_col_mvs + have_row_mvs;
  499|       |
  500|       |    // context build-up
  501|  1.69M|    int refmv_ctx, newmv_ctx;
  502|  1.69M|    switch (nearest_match) {
  ------------------
  |  Branch (502:13): [True: 1.69M, False: 0]
  ------------------
  503|   198k|    case 0:
  ------------------
  |  Branch (503:5): [True: 198k, False: 1.49M]
  ------------------
  504|   198k|        refmv_ctx = imin(2, ref_match_count);
  505|   198k|        newmv_ctx = ref_match_count > 0;
  506|   198k|        break;
  507|   792k|    case 1:
  ------------------
  |  Branch (507:5): [True: 792k, False: 900k]
  ------------------
  508|   792k|        refmv_ctx = imin(ref_match_count * 3, 4);
  509|   792k|        newmv_ctx = 3 - have_newmv;
  510|   792k|        break;
  511|   702k|    case 2:
  ------------------
  |  Branch (511:5): [True: 702k, False: 990k]
  ------------------
  512|   702k|        refmv_ctx = 5;
  513|   702k|        newmv_ctx = 5 - have_newmv;
  514|   702k|        break;
  515|  1.69M|    }
  516|       |
  517|       |    // sorting (nearest, then "secondary")
  518|  1.69M|    int len = nearest_cnt;
  519|  3.42M|    while (len) {
  ------------------
  |  Branch (519:12): [True: 1.73M, False: 1.69M]
  ------------------
  520|  1.73M|        int last = 0;
  521|  2.34M|        for (int n = 1; n < len; n++) {
  ------------------
  |  Branch (521:25): [True: 606k, False: 1.73M]
  ------------------
  522|   606k|            if (mvstack[n - 1].weight < mvstack[n].weight) {
  ------------------
  |  Branch (522:17): [True: 263k, False: 343k]
  ------------------
  523|   263k|#define EXCHANGE(a, b) do { refmvs_candidate tmp = a; a = b; b = tmp; } while (0)
  524|   263k|                EXCHANGE(mvstack[n - 1], mvstack[n]);
  ------------------
  |  |  523|   263k|#define EXCHANGE(a, b) do { refmvs_candidate tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (523:80): [Folded, False: 263k]
  |  |  ------------------
  ------------------
  525|   263k|                last = n;
  526|   263k|            }
  527|   606k|        }
  528|  1.73M|        len = last;
  529|  1.73M|    }
  530|  1.69M|    len = *cnt;
  531|  2.67M|    while (len > nearest_cnt) {
  ------------------
  |  Branch (531:12): [True: 981k, False: 1.69M]
  ------------------
  532|   981k|        int last = nearest_cnt;
  533|  1.36M|        for (int n = nearest_cnt + 1; n < len; n++) {
  ------------------
  |  Branch (533:39): [True: 379k, False: 981k]
  ------------------
  534|   379k|            if (mvstack[n - 1].weight < mvstack[n].weight) {
  ------------------
  |  Branch (534:17): [True: 64.5k, False: 315k]
  ------------------
  535|  64.5k|                EXCHANGE(mvstack[n - 1], mvstack[n]);
  ------------------
  |  |  523|  64.5k|#define EXCHANGE(a, b) do { refmvs_candidate tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (523:80): [Folded, False: 64.5k]
  |  |  ------------------
  ------------------
  536|  64.5k|#undef EXCHANGE
  537|  64.5k|                last = n;
  538|  64.5k|            }
  539|   379k|        }
  540|   981k|        len = last;
  541|   981k|    }
  542|       |
  543|  1.69M|    if (ref.ref[1] > 0) {
  ------------------
  |  Branch (543:9): [True: 136k, False: 1.55M]
  ------------------
  544|   136k|        if (*cnt < 2) {
  ------------------
  |  Branch (544:13): [True: 86.7k, False: 49.7k]
  ------------------
  545|  86.7k|            const int sign0 = rf->sign_bias[ref.ref[0] - 1];
  546|  86.7k|            const int sign1 = rf->sign_bias[ref.ref[1] - 1];
  547|  86.7k|            const int sz4 = imin(w4, h4);
  548|  86.7k|            refmvs_candidate *const same = &mvstack[*cnt];
  549|  86.7k|            int same_count[4] = { 0 };
  550|       |
  551|       |            // non-self references in top
  552|   150k|            if (n_rows != ~0U) for (int x = 0; x < sz4;) {
  ------------------
  |  Branch (552:17): [True: 71.8k, False: 14.9k]
  |  Branch (552:48): [True: 79.0k, False: 71.8k]
  ------------------
  553|  79.0k|                const refmvs_block *const cand_b = &b_top[x];
  554|  79.0k|                add_compound_extended_candidate(same, same_count, cand_b,
  555|  79.0k|                                                sign0, sign1, ref, rf->sign_bias);
  556|  79.0k|                x += dav1d_block_dimensions[cand_b->bs][0];
  557|  79.0k|            }
  558|       |
  559|       |            // non-self references in left
  560|   176k|            if (n_cols != ~0U) for (int y = 0; y < sz4;) {
  ------------------
  |  Branch (560:17): [True: 81.9k, False: 4.80k]
  |  Branch (560:48): [True: 95.0k, False: 81.9k]
  ------------------
  561|  95.0k|                const refmvs_block *const cand_b = &b_left[y][bx4 - 1];
  562|  95.0k|                add_compound_extended_candidate(same, same_count, cand_b,
  563|  95.0k|                                                sign0, sign1, ref, rf->sign_bias);
  564|  95.0k|                y += dav1d_block_dimensions[cand_b->bs][1];
  565|  95.0k|            }
  566|       |
  567|  86.7k|            refmvs_candidate *const diff = &same[2];
  568|  86.7k|            const int *const diff_count = &same_count[2];
  569|       |
  570|       |            // merge together
  571|   260k|            for (int n = 0; n < 2; n++) {
  ------------------
  |  Branch (571:29): [True: 173k, False: 86.7k]
  ------------------
  572|   173k|                int m = same_count[n];
  573|       |
  574|   173k|                if (m >= 2) continue;
  ------------------
  |  Branch (574:21): [True: 53.6k, False: 119k]
  ------------------
  575|       |
  576|   119k|                const int l = diff_count[n];
  577|   119k|                if (l) {
  ------------------
  |  Branch (577:21): [True: 110k, False: 9.73k]
  ------------------
  578|   110k|                    same[m].mv.mv[n] = diff[0].mv.mv[n];
  579|   110k|                    if (++m == 2) continue;
  ------------------
  |  Branch (579:25): [True: 72.3k, False: 37.6k]
  ------------------
  580|  37.6k|                    if (l == 2) {
  ------------------
  |  Branch (580:25): [True: 30.6k, False: 6.99k]
  ------------------
  581|  30.6k|                        same[1].mv.mv[n] = diff[1].mv.mv[n];
  582|  30.6k|                        continue;
  583|  30.6k|                    }
  584|  37.6k|                }
  585|  21.8k|                do {
  586|  21.8k|                    same[m].mv.mv[n] = tgmv[n];
  587|  21.8k|                } while (++m < 2);
  ------------------
  |  Branch (587:26): [True: 5.16k, False: 16.7k]
  ------------------
  588|  16.7k|            }
  589|       |
  590|       |            // if the first extended was the same as the non-extended one,
  591|       |            // then replace it with the second extended one
  592|  86.7k|            int n = *cnt;
  593|  86.7k|            if (n == 1 && mvstack[0].mv.n == same[0].mv.n)
  ------------------
  |  Branch (593:17): [True: 52.7k, False: 33.9k]
  |  Branch (593:27): [True: 36.2k, False: 16.4k]
  ------------------
  594|  36.2k|                mvstack[1].mv = mvstack[2].mv;
  595|   120k|            do {
  596|   120k|                mvstack[n].weight = 2;
  597|   120k|            } while (++n < 2);
  ------------------
  |  Branch (597:22): [True: 33.9k, False: 86.7k]
  ------------------
  598|  86.7k|            *cnt = 2;
  599|  86.7k|        }
  600|       |
  601|       |        // clamping
  602|   136k|        const int left = -(bx4 + bw4 + 4) * 4 * 8;
  603|   136k|        const int right = (rf->iw4 - bx4 + 4) * 4 * 8;
  604|   136k|        const int top = -(by4 + bh4 + 4) * 4 * 8;
  605|   136k|        const int bottom = (rf->ih4 - by4 + 4) * 4 * 8;
  606|       |
  607|   136k|        const int n_refmvs = *cnt;
  608|   136k|        int n = 0;
  609|   309k|        do {
  610|   309k|            mvstack[n].mv.mv[0].x = iclip(mvstack[n].mv.mv[0].x, left, right);
  611|   309k|            mvstack[n].mv.mv[0].y = iclip(mvstack[n].mv.mv[0].y, top, bottom);
  612|   309k|            mvstack[n].mv.mv[1].x = iclip(mvstack[n].mv.mv[1].x, left, right);
  613|   309k|            mvstack[n].mv.mv[1].y = iclip(mvstack[n].mv.mv[1].y, top, bottom);
  614|   309k|        } while (++n < n_refmvs);
  ------------------
  |  Branch (614:18): [True: 172k, False: 136k]
  ------------------
  615|       |
  616|   136k|        switch (refmv_ctx >> 1) {
  ------------------
  |  Branch (616:17): [True: 136k, False: 0]
  ------------------
  617|  45.4k|        case 0:
  ------------------
  |  Branch (617:9): [True: 45.4k, False: 91.0k]
  ------------------
  618|  45.4k|            *ctx = imin(newmv_ctx, 1);
  619|  45.4k|            break;
  620|  49.8k|        case 1:
  ------------------
  |  Branch (620:9): [True: 49.8k, False: 86.6k]
  ------------------
  621|  49.8k|            *ctx = 1 + imin(newmv_ctx, 3);
  622|  49.8k|            break;
  623|  41.2k|        case 2:
  ------------------
  |  Branch (623:9): [True: 41.2k, False: 95.3k]
  ------------------
  624|  41.2k|            *ctx = iclip(3 + newmv_ctx, 4, 7);
  625|  41.2k|            break;
  626|   136k|        }
  627|       |
  628|   136k|        return;
  629|  1.55M|    } else if (*cnt < 2 && ref.ref[0] > 0) {
  ------------------
  |  Branch (629:16): [True: 624k, False: 931k]
  |  Branch (629:28): [True: 501k, False: 123k]
  ------------------
  630|   501k|        const int sign = rf->sign_bias[ref.ref[0] - 1];
  631|   501k|        const int sz4 = imin(w4, h4);
  632|       |
  633|       |        // non-self references in top
  634|   926k|        if (n_rows != ~0U) for (int x = 0; x < sz4 && *cnt < 2;) {
  ------------------
  |  Branch (634:13): [True: 444k, False: 56.5k]
  |  Branch (634:44): [True: 483k, False: 442k]
  |  Branch (634:55): [True: 482k, False: 1.84k]
  ------------------
  635|   482k|            const refmvs_block *const cand_b = &b_top[x];
  636|   482k|            add_single_extended_candidate(mvstack, cnt, cand_b, sign, rf->sign_bias);
  637|   482k|            x += dav1d_block_dimensions[cand_b->bs][0];
  638|   482k|        }
  639|       |
  640|       |        // non-self references in left
  641|   888k|        if (n_cols != ~0U) for (int y = 0; y < sz4 && *cnt < 2;) {
  ------------------
  |  Branch (641:13): [True: 447k, False: 53.4k]
  |  Branch (641:44): [True: 486k, False: 402k]
  |  Branch (641:55): [True: 440k, False: 45.4k]
  ------------------
  642|   440k|            const refmvs_block *const cand_b = &b_left[y][bx4 - 1];
  643|   440k|            add_single_extended_candidate(mvstack, cnt, cand_b, sign, rf->sign_bias);
  644|   440k|            y += dav1d_block_dimensions[cand_b->bs][1];
  645|   440k|        }
  646|   501k|    }
  647|  1.69M|    assert(*cnt <= 8);
  ------------------
  |  Branch (647:5): [True: 1.55M, False: 0]
  ------------------
  648|       |
  649|       |    // clamping
  650|  1.55M|    int n_refmvs = *cnt;
  651|  1.55M|    if (n_refmvs) {
  ------------------
  |  Branch (651:9): [True: 1.46M, False: 86.0k]
  ------------------
  652|  1.46M|        const int left = -(bx4 + bw4 + 4) * 4 * 8;
  653|  1.46M|        const int right = (rf->iw4 - bx4 + 4) * 4 * 8;
  654|  1.46M|        const int top = -(by4 + bh4 + 4) * 4 * 8;
  655|  1.46M|        const int bottom = (rf->ih4 - by4 + 4) * 4 * 8;
  656|       |
  657|  1.46M|        int n = 0;
  658|  3.22M|        do {
  659|  3.22M|            mvstack[n].mv.mv[0].x = iclip(mvstack[n].mv.mv[0].x, left, right);
  660|  3.22M|            mvstack[n].mv.mv[0].y = iclip(mvstack[n].mv.mv[0].y, top, bottom);
  661|  3.22M|        } while (++n < n_refmvs);
  ------------------
  |  Branch (661:18): [True: 1.75M, False: 1.46M]
  ------------------
  662|  1.46M|    }
  663|       |
  664|  2.17M|    for (int n = *cnt; n < 2; n++)
  ------------------
  |  Branch (664:24): [True: 615k, False: 1.55M]
  ------------------
  665|   615k|        mvstack[n].mv.mv[0] = tgmv[0];
  666|       |
  667|  1.55M|    *ctx = (refmv_ctx << 4) | (globalmv_ctx << 3) | newmv_ctx;
  668|  1.55M|}
dav1d_refmvs_tile_sbrow_init:
  674|   144k|{
  675|   144k|    if (rf->n_tile_threads == 1) tile_row_idx = 0;
  ------------------
  |  Branch (675:9): [True: 144k, False: 0]
  ------------------
  676|   144k|    rt->rp_proj = &rf->rp_proj[16 * rf->rp_stride * tile_row_idx];
  677|   144k|    const ptrdiff_t r_stride = rf->rp_stride * 2;
  678|   144k|    const ptrdiff_t pass_off = (rf->n_frame_threads > 1 && pass == 2) ?
  ------------------
  |  Branch (678:33): [True: 0, False: 144k]
  |  Branch (678:60): [True: 0, False: 0]
  ------------------
  679|   144k|        35 * 2 * rf->n_blocks : 0;
  680|   144k|    refmvs_block *r = &rf->r[35 * r_stride * tile_row_idx + pass_off];
  681|   144k|    const int sbsz = rf->sbsz;
  682|   144k|    const int off = (sbsz * sby) & 16;
  683|  3.82M|    for (int i = 0; i < sbsz; i++, r += r_stride)
  ------------------
  |  Branch (683:21): [True: 3.67M, False: 144k]
  ------------------
  684|  3.67M|        rt->r[off + 5 + i] = r;
  685|   144k|    rt->r[off + 0] = r;
  686|   144k|    r += r_stride;
  687|   144k|    rt->r[off + 1] = NULL;
  688|   144k|    rt->r[off + 2] = r;
  689|   144k|    r += r_stride;
  690|   144k|    rt->r[off + 3] = NULL;
  691|   144k|    rt->r[off + 4] = r;
  692|   144k|    if (sby & 1) {
  ------------------
  |  Branch (692:9): [True: 57.0k, False: 87.0k]
  ------------------
  693|  57.0k|#define EXCHANGE(a, b) do { void *const tmp = a; a = b; b = tmp; } while (0)
  694|  57.0k|        EXCHANGE(rt->r[off + 0], rt->r[off + sbsz + 0]);
  ------------------
  |  |  693|  57.0k|#define EXCHANGE(a, b) do { void *const tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (693:75): [Folded, False: 57.0k]
  |  |  ------------------
  ------------------
  695|  57.0k|        EXCHANGE(rt->r[off + 2], rt->r[off + sbsz + 2]);
  ------------------
  |  |  693|  57.0k|#define EXCHANGE(a, b) do { void *const tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (693:75): [Folded, False: 57.0k]
  |  |  ------------------
  ------------------
  696|  57.0k|        EXCHANGE(rt->r[off + 4], rt->r[off + sbsz + 4]);
  ------------------
  |  |  693|  57.0k|#define EXCHANGE(a, b) do { void *const tmp = a; a = b; b = tmp; } while (0)
  |  |  ------------------
  |  |  |  Branch (693:75): [Folded, False: 57.0k]
  |  |  ------------------
  ------------------
  697|  57.0k|#undef EXCHANGE
  698|  57.0k|    }
  699|       |
  700|   144k|    rt->rf = rf;
  701|   144k|    rt->tile_row.start = tile_row_start4;
  702|   144k|    rt->tile_row.end = imin(tile_row_end4, rf->ih4);
  703|   144k|    rt->tile_col.start = tile_col_start4;
  704|   144k|    rt->tile_col.end = imin(tile_col_end4, rf->iw4);
  705|   144k|}
dav1d_refmvs_init_frame:
  828|  31.5k|{
  829|  31.5k|    const int rp_stride = ((frm_hdr->width[0] + 127) & ~127) >> 3;
  830|  31.5k|    const int n_tile_rows = n_tile_threads > 1 ? frm_hdr->tiling.rows : 1;
  ------------------
  |  Branch (830:29): [True: 0, False: 31.5k]
  ------------------
  831|  31.5k|    const int n_blocks = rp_stride * n_tile_rows;
  832|       |
  833|  31.5k|    rf->sbsz = 16 << seq_hdr->sb128;
  834|  31.5k|    rf->frm_hdr = frm_hdr;
  835|  31.5k|    rf->iw8 = (frm_hdr->width[0] + 7) >> 3;
  836|  31.5k|    rf->ih8 = (frm_hdr->height + 7) >> 3;
  837|  31.5k|    rf->iw4 = rf->iw8 << 1;
  838|  31.5k|    rf->ih4 = rf->ih8 << 1;
  839|  31.5k|    rf->rp = rp;
  840|  31.5k|    rf->rp_stride = rp_stride;
  841|  31.5k|    rf->n_tile_threads = n_tile_threads;
  842|  31.5k|    rf->n_frame_threads = n_frame_threads;
  843|       |
  844|  31.5k|    if (n_blocks != rf->n_blocks) {
  ------------------
  |  Branch (844:9): [True: 7.51k, False: 24.0k]
  ------------------
  845|  7.51k|        const size_t r_sz = sizeof(*rf->r) * 35 * 2 * n_blocks * (1 + (n_frame_threads > 1));
  846|  7.51k|        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|  7.51k|        dav1d_free_aligned(rf->r);
  ------------------
  |  |  136|  7.51k|#define dav1d_free_aligned(ptr) dav1d_free_aligned_internal(ptr)
  ------------------
  850|  7.51k|        rf->r = dav1d_alloc_aligned(ALLOC_REFMVS, r_sz + rp_proj_sz, 64);
  ------------------
  |  |  134|  7.51k|#define dav1d_alloc_aligned(type, sz, align) dav1d_alloc_aligned_internal(sz, align)
  ------------------
  851|  7.51k|        if (!rf->r) {
  ------------------
  |  Branch (851:13): [True: 0, False: 7.51k]
  ------------------
  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|  7.51k|        rf->rp_proj = (refmvs_temporal_block*)((uintptr_t)rf->r + r_sz);
  857|  7.51k|        rf->n_blocks = n_blocks;
  858|  7.51k|    }
  859|       |
  860|  31.5k|    const int poc = frm_hdr->frame_offset;
  861|   252k|    for (int i = 0; i < 7; i++) {
  ------------------
  |  Branch (861:21): [True: 221k, False: 31.5k]
  ------------------
  862|   221k|        const int poc_diff = get_poc_diff(seq_hdr->order_hint_n_bits,
  863|   221k|                                          ref_poc[i], poc);
  864|   221k|        rf->sign_bias[i] = poc_diff > 0;
  865|   221k|        rf->mfmv_sign[i] = poc_diff < 0;
  866|   221k|        rf->pocdiff[i] = iclip(get_poc_diff(seq_hdr->order_hint_n_bits,
  867|   221k|                                            poc, ref_poc[i]), -31, 31);
  868|   221k|    }
  869|       |
  870|       |    // temporal MV setup
  871|  31.5k|    rf->n_mfmvs = 0;
  872|  31.5k|    rf->rp_ref = rp_ref;
  873|  31.5k|    if (frm_hdr->use_ref_frame_mvs && seq_hdr->order_hint_n_bits) {
  ------------------
  |  Branch (873:9): [True: 8.64k, False: 22.9k]
  |  Branch (873:39): [True: 8.64k, False: 0]
  ------------------
  874|  8.64k|        int total = 2;
  875|  8.64k|        if (rp_ref[0] && ref_ref_poc[0][6] != ref_poc[3] /* alt-of-last != gold */) {
  ------------------
  |  Branch (875:13): [True: 6.19k, False: 2.45k]
  |  Branch (875:26): [True: 2.94k, False: 3.24k]
  ------------------
  876|  2.94k|            rf->mfmv_ref[rf->n_mfmvs++] = 0; // last
  877|  2.94k|            total = 3;
  878|  2.94k|        }
  879|  8.64k|        if (rp_ref[4] && get_poc_diff(seq_hdr->order_hint_n_bits, ref_poc[4],
  ------------------
  |  Branch (879:13): [True: 5.58k, False: 3.06k]
  |  Branch (879:26): [True: 738, False: 4.85k]
  ------------------
  880|  5.58k|                                      frm_hdr->frame_offset) > 0)
  881|    738|        {
  882|    738|            rf->mfmv_ref[rf->n_mfmvs++] = 4; // bwd
  883|    738|        }
  884|  8.64k|        if (rp_ref[5] && get_poc_diff(seq_hdr->order_hint_n_bits, ref_poc[5],
  ------------------
  |  Branch (884:13): [True: 6.57k, False: 2.07k]
  |  Branch (884:26): [True: 928, False: 5.64k]
  ------------------
  885|  6.57k|                                      frm_hdr->frame_offset) > 0)
  886|    928|        {
  887|    928|            rf->mfmv_ref[rf->n_mfmvs++] = 5; // altref2
  888|    928|        }
  889|  8.64k|        if (rf->n_mfmvs < total && rp_ref[6] &&
  ------------------
  |  Branch (889:13): [True: 8.11k, False: 538]
  |  Branch (889:36): [True: 6.08k, False: 2.02k]
  ------------------
  890|  6.08k|            get_poc_diff(seq_hdr->order_hint_n_bits, ref_poc[6],
  ------------------
  |  Branch (890:13): [True: 3.16k, False: 2.92k]
  ------------------
  891|  6.08k|                         frm_hdr->frame_offset) > 0)
  892|  3.16k|        {
  893|  3.16k|            rf->mfmv_ref[rf->n_mfmvs++] = 6; // altref
  894|  3.16k|        }
  895|  8.64k|        if (rf->n_mfmvs < total && rp_ref[1])
  ------------------
  |  Branch (895:13): [True: 7.55k, False: 1.09k]
  |  Branch (895:36): [True: 5.42k, False: 2.13k]
  ------------------
  896|  5.42k|            rf->mfmv_ref[rf->n_mfmvs++] = 1; // last2
  897|       |
  898|  21.8k|        for (int n = 0; n < rf->n_mfmvs; n++) {
  ------------------
  |  Branch (898:25): [True: 13.1k, False: 8.64k]
  ------------------
  899|  13.1k|            const int rpoc = ref_poc[rf->mfmv_ref[n]];
  900|  13.1k|            const int diff1 = get_poc_diff(seq_hdr->order_hint_n_bits,
  901|  13.1k|                                           rpoc, frm_hdr->frame_offset);
  902|  13.1k|            if (abs(diff1) > 31) {
  ------------------
  |  Branch (902:17): [True: 269, False: 12.9k]
  ------------------
  903|    269|                rf->mfmv_ref2cur[n] = INVALID_REF2CUR;
  ------------------
  |  |   41|    269|#define INVALID_REF2CUR (-32)
  ------------------
  904|  12.9k|            } else {
  905|  12.9k|                rf->mfmv_ref2cur[n] = rf->mfmv_ref[n] < 4 ? -diff1 : diff1;
  ------------------
  |  Branch (905:39): [True: 8.24k, False: 4.68k]
  ------------------
  906|   103k|                for (int m = 0; m < 7; m++) {
  ------------------
  |  Branch (906:33): [True: 90.5k, False: 12.9k]
  ------------------
  907|  90.5k|                    const int rrpoc = ref_ref_poc[rf->mfmv_ref[n]][m];
  908|  90.5k|                    const int diff2 = get_poc_diff(seq_hdr->order_hint_n_bits,
  909|  90.5k|                                                   rpoc, rrpoc);
  910|       |                    // unsigned comparison also catches the < 0 case
  911|  90.5k|                    rf->mfmv_ref2ref[n][m] = (unsigned) diff2 > 31U ? 0 : diff2;
  ------------------
  |  Branch (911:46): [True: 19.3k, False: 71.1k]
  ------------------
  912|  90.5k|                }
  913|  12.9k|            }
  914|  13.1k|        }
  915|  8.64k|    }
  916|  31.5k|    rf->use_ref_frame_mvs = rf->n_mfmvs > 0;
  917|       |
  918|  31.5k|    return 0;
  919|  31.5k|}
dav1d_refmvs_dsp_init:
  942|  11.2k|{
  943|  11.2k|    c->load_tmvs = load_tmvs_c;
  944|  11.2k|    c->save_tmvs = save_tmvs_c;
  945|  11.2k|    c->splat_mv = splat_mv_c;
  946|       |
  947|  11.2k|#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|  11.2k|#endif
  955|  11.2k|#endif
  956|  11.2k|}
refmvs.c:scan_row:
  103|  2.13M|{
  104|  2.13M|    const refmvs_block *cand_b = b;
  105|  2.13M|    const enum BlockSize first_cand_bs = cand_b->bs;
  106|  2.13M|    const uint8_t *const first_cand_b_dim = dav1d_block_dimensions[first_cand_bs];
  107|  2.13M|    int cand_bw4 = first_cand_b_dim[0];
  108|  2.13M|    int len = imax(step, imin(bw4, cand_bw4));
  109|       |
  110|  2.13M|    if (bw4 <= cand_bw4) {
  ------------------
  |  Branch (110:9): [True: 1.86M, False: 271k]
  ------------------
  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|  1.86M|        const int weight = bw4 == 1 ? 2 :
  ------------------
  |  Branch (115:28): [True: 619k, False: 1.24M]
  ------------------
  116|  1.86M|                           imax(2, imin(2 * max_rows, first_cand_b_dim[1]));
  117|  1.86M|        add_spatial_candidate(mvstack, cnt, len * weight, cand_b, ref, gmv,
  118|  1.86M|                              have_newmv_match, have_refmv_match);
  119|  1.86M|        return weight >> 1;
  120|  1.86M|    }
  121|       |
  122|   554k|    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|   554k|        add_spatial_candidate(mvstack, cnt, len * 2, cand_b, ref, gmv,
  127|   554k|                              have_newmv_match, have_refmv_match);
  128|   554k|        x += len;
  129|   554k|        if (x >= w4) return 1;
  ------------------
  |  Branch (129:13): [True: 271k, False: 283k]
  ------------------
  130|   283k|        cand_b = &b[x];
  131|   283k|        cand_bw4 = dav1d_block_dimensions[cand_b->bs][0];
  132|   283k|        assert(cand_bw4 < bw4);
  ------------------
  |  Branch (132:9): [True: 283k, False: 0]
  ------------------
  133|   283k|        len = imax(step, cand_bw4);
  134|   283k|    }
  135|   271k|}
refmvs.c:scan_col:
  142|  3.44M|{
  143|  3.44M|    const refmvs_block *cand_b = &b[0][bx4];
  144|  3.44M|    const enum BlockSize first_cand_bs = cand_b->bs;
  145|  3.44M|    const uint8_t *const first_cand_b_dim = dav1d_block_dimensions[first_cand_bs];
  146|  3.44M|    int cand_bh4 = first_cand_b_dim[1];
  147|  3.44M|    int len = imax(step, imin(bh4, cand_bh4));
  148|       |
  149|  3.44M|    if (bh4 <= cand_bh4) {
  ------------------
  |  Branch (149:9): [True: 3.08M, False: 367k]
  ------------------
  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|  3.08M|        const int weight = bh4 == 1 ? 2 :
  ------------------
  |  Branch (154:28): [True: 1.05M, False: 2.02M]
  ------------------
  155|  3.08M|                           imax(2, imin(2 * max_cols, first_cand_b_dim[0]));
  156|  3.08M|        add_spatial_candidate(mvstack, cnt, len * weight, cand_b, ref, gmv,
  157|  3.08M|                            have_newmv_match, have_refmv_match);
  158|  3.08M|        return weight >> 1;
  159|  3.08M|    }
  160|       |
  161|   722k|    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|   722k|        add_spatial_candidate(mvstack, cnt, len * 2, cand_b, ref, gmv,
  166|   722k|                              have_newmv_match, have_refmv_match);
  167|   722k|        y += len;
  168|   722k|        if (y >= h4) return 1;
  ------------------
  |  Branch (168:13): [True: 367k, False: 355k]
  ------------------
  169|   355k|        cand_b = &b[y][bx4];
  170|   355k|        cand_bh4 = dav1d_block_dimensions[cand_b->bs][1];
  171|   355k|        assert(cand_bh4 < bh4);
  ------------------
  |  Branch (171:9): [True: 355k, False: 0]
  ------------------
  172|   355k|        len = imax(step, cand_bh4);
  173|   355k|    }
  174|   367k|}
refmvs.c:add_spatial_candidate:
   47|  7.83M|{
   48|  7.83M|    if (b->mv.mv[0].n == INVALID_MV) return; // intra block, no intrabc
  ------------------
  |  |   40|  7.83M|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (48:9): [True: 856k, False: 6.98M]
  ------------------
   49|       |
   50|  6.98M|    if (ref.ref[1] == -1) {
  ------------------
  |  Branch (50:9): [True: 6.21M, False: 762k]
  ------------------
   51|  7.70M|        for (int n = 0; n < 2; n++) {
  ------------------
  |  Branch (51:25): [True: 7.00M, False: 694k]
  ------------------
   52|  7.00M|            if (b->ref.ref[n] == ref.ref[0]) {
  ------------------
  |  Branch (52:17): [True: 5.52M, False: 1.48M]
  ------------------
   53|  5.52M|                const mv cand_mv = ((b->mf & 1) && gmv[0].n != INVALID_MV) ?
  ------------------
  |  |   40|  1.51M|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (53:37): [True: 1.51M, False: 4.01M]
  |  Branch (53:52): [True: 184k, False: 1.32M]
  ------------------
   54|  5.34M|                                   gmv[0] : b->mv.mv[n];
   55|       |
   56|  5.52M|                *have_refmv_match = 1;
   57|  5.52M|                *have_newmv_match |= b->mf >> 1;
   58|       |
   59|  5.52M|                const int last = *cnt;
   60|  8.84M|                for (int m = 0; m < last; m++)
  ------------------
  |  Branch (60:33): [True: 5.76M, False: 3.07M]
  ------------------
   61|  5.76M|                    if (mvstack[m].mv.mv[0].n == cand_mv.n) {
  ------------------
  |  Branch (61:25): [True: 2.45M, False: 3.31M]
  ------------------
   62|  2.45M|                        mvstack[m].weight += weight;
   63|  2.45M|                        return;
   64|  2.45M|                    }
   65|       |
   66|  3.07M|                if (last < 8) {
  ------------------
  |  Branch (66:21): [True: 3.07M, False: 2.49k]
  ------------------
   67|  3.07M|                    mvstack[last].mv.mv[0] = cand_mv;
   68|  3.07M|                    mvstack[last].weight = weight;
   69|  3.07M|                    *cnt = last + 1;
   70|  3.07M|                }
   71|  3.07M|                return;
   72|  5.52M|            }
   73|  7.00M|        }
   74|  6.21M|    } else if (b->ref.pair == ref.pair) {
  ------------------
  |  Branch (74:16): [True: 285k, False: 476k]
  ------------------
   75|   285k|        const refmvs_mvpair cand_mv = { .mv = {
   76|   285k|            [0] = ((b->mf & 1) && gmv[0].n != INVALID_MV) ? gmv[0] : b->mv.mv[0],
  ------------------
  |  |   40|  16.0k|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (76:20): [True: 16.0k, False: 269k]
  |  Branch (76:35): [True: 4.39k, False: 11.6k]
  ------------------
   77|   285k|            [1] = ((b->mf & 1) && gmv[1].n != INVALID_MV) ? gmv[1] : b->mv.mv[1],
  ------------------
  |  |   40|  16.0k|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (77:20): [True: 16.0k, False: 269k]
  |  Branch (77:35): [True: 3.68k, False: 12.3k]
  ------------------
   78|   285k|        }};
   79|       |
   80|   285k|        *have_refmv_match = 1;
   81|   285k|        *have_newmv_match |= b->mf >> 1;
   82|       |
   83|   285k|        const int last = *cnt;
   84|   440k|        for (int n = 0; n < last; n++)
  ------------------
  |  Branch (84:25): [True: 270k, False: 170k]
  ------------------
   85|   270k|            if (mvstack[n].mv.n == cand_mv.n) {
  ------------------
  |  Branch (85:17): [True: 115k, False: 154k]
  ------------------
   86|   115k|                mvstack[n].weight += weight;
   87|   115k|                return;
   88|   115k|            }
   89|       |
   90|   170k|        if (last < 8) {
  ------------------
  |  Branch (90:13): [True: 170k, False: 399]
  ------------------
   91|   170k|            mvstack[last].mv = cand_mv;
   92|   170k|            mvstack[last].weight = weight;
   93|   170k|            *cnt = last + 1;
   94|   170k|        }
   95|   170k|    }
   96|  6.98M|}
refmvs.c:add_temporal_candidate:
  199|   362k|{
  200|   362k|    if (rb->mv.n == INVALID_MV) return;
  ------------------
  |  |   40|   362k|#define INVALID_MV 0x80008000
  ------------------
  |  Branch (200:9): [True: 241k, False: 121k]
  ------------------
  201|       |
  202|   121k|    union mv mv = mv_projection(rb->mv, rf->pocdiff[ref.ref[0] - 1], rb->ref);
  203|   121k|    fix_mv_precision(rf->frm_hdr, &mv);
  204|       |
  205|   121k|    const int last = *cnt;
  206|   121k|    if (ref.ref[1] == -1) {
  ------------------
  |  Branch (206:9): [True: 64.0k, False: 57.7k]
  ------------------
  207|  64.0k|        if (globalmv_ctx)
  ------------------
  |  Branch (207:13): [True: 35.0k, False: 28.9k]
  ------------------
  208|  35.0k|            *globalmv_ctx = (abs(mv.x - gmv[0].x) | abs(mv.y - gmv[0].y)) >= 16;
  209|       |
  210|   123k|        for (int n = 0; n < last; n++)
  ------------------
  |  Branch (210:25): [True: 97.5k, False: 25.5k]
  ------------------
  211|  97.5k|            if (mvstack[n].mv.mv[0].n == mv.n) {
  ------------------
  |  Branch (211:17): [True: 38.4k, False: 59.0k]
  ------------------
  212|  38.4k|                mvstack[n].weight += weight;
  213|  38.4k|                return;
  214|  38.4k|            }
  215|  25.5k|        if (last < 8) {
  ------------------
  |  Branch (215:13): [True: 25.3k, False: 262]
  ------------------
  216|  25.3k|            mvstack[last].mv.mv[0] = mv;
  217|  25.3k|            mvstack[last].weight = weight;
  218|  25.3k|            *cnt = last + 1;
  219|  25.3k|        }
  220|  57.7k|    } else {
  221|  57.7k|        refmvs_mvpair mvp = { .mv = {
  222|  57.7k|            [0] = mv,
  223|  57.7k|            [1] = mv_projection(rb->mv, rf->pocdiff[ref.ref[1] - 1], rb->ref),
  224|  57.7k|        }};
  225|  57.7k|        fix_mv_precision(rf->frm_hdr, &mvp.mv[1]);
  226|       |
  227|   104k|        for (int n = 0; n < last; n++)
  ------------------
  |  Branch (227:25): [True: 85.6k, False: 18.8k]
  ------------------
  228|  85.6k|            if (mvstack[n].mv.n == mvp.n) {
  ------------------
  |  Branch (228:17): [True: 38.9k, False: 46.7k]
  ------------------
  229|  38.9k|                mvstack[n].weight += weight;
  230|  38.9k|                return;
  231|  38.9k|            }
  232|  18.8k|        if (last < 8) {
  ------------------
  |  Branch (232:13): [True: 18.5k, False: 320]
  ------------------
  233|  18.5k|            mvstack[last].mv = mvp;
  234|  18.5k|            mvstack[last].weight = weight;
  235|  18.5k|            *cnt = last + 1;
  236|  18.5k|        }
  237|  18.8k|    }
  238|   121k|}
refmvs.c:mv_projection:
  176|   179k|static inline union mv mv_projection(const union mv mv, const int num, const int den) {
  177|   179k|    static const uint16_t div_mult[32] = {
  178|   179k|           0, 16384, 8192, 5461, 4096, 3276, 2730, 2340,
  179|   179k|        2048,  1820, 1638, 1489, 1365, 1260, 1170, 1092,
  180|   179k|        1024,   963,  910,  862,  819,  780,  744,  712,
  181|   179k|         682,   655,  630,  606,  585,  564,  546,  528
  182|   179k|    };
  183|   179k|    assert(den > 0 && den < 32);
  ------------------
  |  Branch (183:5): [True: 179k, False: 0]
  |  Branch (183:5): [True: 179k, False: 0]
  ------------------
  184|   179k|    assert(num > -32 && num < 32);
  ------------------
  |  Branch (184:5): [True: 179k, False: 0]
  |  Branch (184:5): [True: 179k, False: 0]
  ------------------
  185|   179k|    const int frac = num * div_mult[den];
  186|   179k|    const int y = mv.y * frac, x = mv.x * frac;
  187|       |    // Round and clip according to AV1 spec section 7.9.3
  188|   179k|    return (union mv) { // 0x3fff == (1 << 14) - 1
  189|   179k|        .y = iclip((y + 8192 + (y >> 31)) >> 14, -0x3fff, 0x3fff),
  190|   179k|        .x = iclip((x + 8192 + (x >> 31)) >> 14, -0x3fff, 0x3fff)
  191|   179k|    };
  192|   179k|}
refmvs.c:add_compound_extended_candidate:
  250|   174k|{
  251|   174k|    refmvs_candidate *const diff = &same[2];
  252|   174k|    int *const diff_count = &same_count[2];
  253|       |
  254|   446k|    for (int n = 0; n < 2; n++) {
  ------------------
  |  Branch (254:21): [True: 338k, False: 107k]
  ------------------
  255|   338k|        const int cand_ref = cand_b->ref.ref[n];
  256|       |
  257|   338k|        if (cand_ref <= 0) break;
  ------------------
  |  Branch (257:13): [True: 66.7k, False: 272k]
  ------------------
  258|       |
  259|   272k|        const mv cand_mv = cand_b->mv.mv[n];
  260|   272k|        if (cand_ref == ref.ref[0]) {
  ------------------
  |  Branch (260:13): [True: 101k, False: 170k]
  ------------------
  261|   101k|            if (same_count[0] < 2)
  ------------------
  |  Branch (261:17): [True: 96.6k, False: 5.10k]
  ------------------
  262|  96.6k|                same[same_count[0]++].mv.mv[0] = cand_mv;
  263|   101k|            if (diff_count[1] < 2) {
  ------------------
  |  Branch (263:17): [True: 84.1k, False: 17.5k]
  ------------------
  264|  84.1k|                diff[diff_count[1]++].mv.mv[1] =
  265|  84.1k|                    mv_apply_sign_bool(cand_mv, sign1 ^ sign_bias[cand_ref - 1]);
  266|  84.1k|            }
  267|   170k|        } else if (cand_ref == ref.ref[1]) {
  ------------------
  |  Branch (267:20): [True: 90.4k, False: 80.0k]
  ------------------
  268|  90.4k|            if (same_count[1] < 2)
  ------------------
  |  Branch (268:17): [True: 87.7k, False: 2.77k]
  ------------------
  269|  87.7k|                same[same_count[1]++].mv.mv[1] = cand_mv;
  270|  90.4k|            if (diff_count[0] < 2) {
  ------------------
  |  Branch (270:17): [True: 73.3k, False: 17.1k]
  ------------------
  271|  73.3k|                diff[diff_count[0]++].mv.mv[0] =
  272|  73.3k|                    mv_apply_sign_bool(cand_mv, sign0 ^ sign_bias[cand_ref - 1]);
  273|  73.3k|            }
  274|  90.4k|        } else {
  275|  80.0k|            if (diff_count[0] < 2) {
  ------------------
  |  Branch (275:17): [True: 60.7k, False: 19.2k]
  ------------------
  276|  60.7k|                diff[diff_count[0]++].mv.mv[0] =
  277|  60.7k|                    mv_apply_sign_bool(cand_mv, sign0 ^ sign_bias[cand_ref - 1]);
  278|  60.7k|            }
  279|       |
  280|  80.0k|            if (diff_count[1] < 2) {
  ------------------
  |  Branch (280:17): [True: 56.0k, False: 23.9k]
  ------------------
  281|  56.0k|                diff[diff_count[1]++].mv.mv[1] =
  282|  56.0k|                    mv_apply_sign_bool(cand_mv, sign1 ^ sign_bias[cand_ref - 1]);
  283|  56.0k|            }
  284|  80.0k|        }
  285|   272k|    }
  286|   174k|}
refmvs.c:mv_apply_sign_bool:
  240|  1.17M|static inline mv mv_apply_sign_bool(const mv v, const int s) {
  241|  1.17M|    return (mv) { .y = apply_sign_bool(v.y, s), .x = apply_sign_bool(v.x, s) };
  242|  1.17M|}
refmvs.c:add_single_extended_candidate:
  291|   922k|{
  292|  1.82M|    for (int n = 0; n < 2; n++) {
  ------------------
  |  Branch (292:21): [True: 1.80M, False: 22.5k]
  ------------------
  293|  1.80M|        const int cand_ref = cand_b->ref.ref[n];
  294|       |
  295|  1.80M|        if (cand_ref <= 0) break;
  ------------------
  |  Branch (295:13): [True: 900k, False: 900k]
  ------------------
  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|   900k|        const mv cand_mv = mv_apply_sign_bool(cand_b->mv.mv[n],
  303|   900k|                                              sign ^ sign_bias[cand_ref - 1]);
  304|       |
  305|   900k|        int m;
  306|   900k|        const int last = *cnt;
  307|  1.00M|        for (m = 0; m < last; m++)
  ------------------
  |  Branch (307:21): [True: 874k, False: 129k]
  ------------------
  308|   874k|            if (cand_mv.n == mvstack[m].mv.mv[0].n)
  ------------------
  |  Branch (308:17): [True: 771k, False: 102k]
  ------------------
  309|   771k|                break;
  310|   900k|        if (m == last) {
  ------------------
  |  Branch (310:13): [True: 129k, False: 771k]
  ------------------
  311|   129k|            mvstack[m].mv.mv[0] = cand_mv;
  312|   129k|            mvstack[m].weight = 2; // "minimal"
  313|   129k|            *cnt = last + 1;
  314|   129k|        }
  315|   900k|    }
  316|   922k|}

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

dav1d_init_last_nonzero_col_from_eob_tables:
  350|  2.84k|COLD void dav1d_init_last_nonzero_col_from_eob_tables(void) {
  351|       |    static pthread_once_t initted = PTHREAD_ONCE_INIT;
  352|  2.84k|    pthread_once(&initted, init_internal);
  353|  2.84k|}
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|}

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

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

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

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

refmvs.c:refmvs_dsp_init_x86:
   41|  11.2k|static ALWAYS_INLINE void refmvs_dsp_init_x86(Dav1dRefmvsDSPContext *const c) {
   42|  11.2k|    const unsigned flags = dav1d_get_cpu_flags();
   43|       |
   44|  11.2k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE2)) return;
  ------------------
  |  Branch (44:9): [True: 0, False: 11.2k]
  ------------------
   45|       |
   46|  11.2k|    c->splat_mv = dav1d_splat_mv_sse2;
   47|       |
   48|  11.2k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
  ------------------
  |  Branch (48:9): [True: 0, False: 11.2k]
  ------------------
   49|       |
   50|  11.2k|    c->save_tmvs = dav1d_save_tmvs_ssse3;
   51|       |
   52|  11.2k|    if (!(flags & DAV1D_X86_CPU_FLAG_SSE41)) return;
  ------------------
  |  Branch (52:9): [True: 0, False: 11.2k]
  ------------------
   53|  11.2k|#if ARCH_X86_64
   54|  11.2k|    c->load_tmvs = dav1d_load_tmvs_sse4;
   55|       |
   56|  11.2k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
  ------------------
  |  Branch (56:9): [True: 0, False: 11.2k]
  ------------------
   57|       |
   58|  11.2k|    c->save_tmvs = dav1d_save_tmvs_avx2;
   59|  11.2k|    c->splat_mv = dav1d_splat_mv_avx2;
   60|       |
   61|  11.2k|    if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
  ------------------
  |  Branch (61:9): [True: 11.2k, 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|  11.2k|{
   95|  11.2k|    Dav1dSettings settings = { 0 };
   96|  11.2k|    Dav1dContext * ctx = NULL;
   97|  11.2k|    Dav1dPicture pic;
   98|  11.2k|    const uint8_t *ptr = data;
   99|  11.2k|    int have_seq_hdr = 0;
  100|  11.2k|    int err;
  101|       |
  102|  11.2k|    dav1d_version();
  103|       |
  104|  11.2k|    if (size < 32) goto end;
  ------------------
  |  Branch (104:9): [True: 8, False: 11.2k]
  ------------------
  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|  11.2k|    ptr += 32; // skip ivf header
  115|       |
  116|  11.2k|    dav1d_default_settings(&settings);
  117|       |
  118|       |#ifdef DAV1D_MT_FUZZING
  119|       |    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|  11.2k|    settings.max_frame_delay = settings.n_threads = 1;
  126|  11.2k|#endif
  127|  11.2k|#if defined(DAV1D_FUZZ_MAX_SIZE)
  128|  11.2k|    settings.frame_size_limit = DAV1D_FUZZ_MAX_SIZE;
  ------------------
  |  |   56|  11.2k|#define DAV1D_FUZZ_MAX_SIZE 4096 * 4096
  ------------------
  129|  11.2k|#endif
  130|       |
  131|  11.2k|    err = dav1d_open(&ctx, &settings);
  132|  11.2k|    if (err < 0) goto end;
  ------------------
  |  Branch (132:9): [True: 0, False: 11.2k]
  ------------------
  133|       |
  134|  96.6k|    while (ptr <= data + size - 12) {
  ------------------
  |  Branch (134:12): [True: 85.6k, False: 10.9k]
  ------------------
  135|  85.6k|        Dav1dData buf;
  136|  85.6k|        uint8_t *p;
  137|       |
  138|  85.6k|        size_t frame_size = r32le(ptr);
  139|  85.6k|        ptr += 12;
  140|       |
  141|  85.6k|        if (frame_size > size || ptr > data + size - frame_size)
  ------------------
  |  Branch (141:13): [True: 207, False: 85.4k]
  |  Branch (141:34): [True: 89, False: 85.3k]
  ------------------
  142|    296|            break;
  143|       |
  144|  85.3k|        if (!frame_size) continue;
  ------------------
  |  Branch (144:13): [True: 709, False: 84.6k]
  ------------------
  145|       |
  146|  84.6k|        if (!have_seq_hdr) {
  ------------------
  |  Branch (146:13): [True: 15.2k, False: 69.4k]
  ------------------
  147|  15.2k|            Dav1dSequenceHeader seq;
  148|  15.2k|            int err = dav1d_parse_sequence_header(&seq, ptr, frame_size);
  149|       |            // skip frames until we see a sequence header
  150|  15.2k|            if  (err != 0) {
  ------------------
  |  Branch (150:18): [True: 4.37k, False: 10.8k]
  ------------------
  151|  4.37k|                ptr += frame_size;
  152|  4.37k|                continue;
  153|  4.37k|            }
  154|  10.8k|            have_seq_hdr = 1;
  155|  10.8k|        }
  156|       |
  157|       |        // copy frame data to a new buffer to catch reads past the end of input
  158|  80.2k|        p = dav1d_data_create(&buf, frame_size);
  159|  80.2k|        if (!p) goto cleanup;
  ------------------
  |  Branch (159:13): [True: 0, False: 80.2k]
  ------------------
  160|  80.2k|        memcpy(p, ptr, frame_size);
  161|  80.2k|        ptr += frame_size;
  162|       |
  163|  83.0k|        do {
  164|  83.0k|            if ((err = dav1d_send_data(ctx, &buf)) < 0) {
  ------------------
  |  Branch (164:17): [True: 57.9k, False: 25.0k]
  ------------------
  165|  57.9k|                if (err != DAV1D_ERR(EAGAIN))
  ------------------
  |  |   58|  57.9k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (165:21): [True: 54.8k, False: 3.08k]
  ------------------
  166|  54.8k|                    break;
  167|  57.9k|            }
  168|  28.1k|            memset(&pic, 0, sizeof(pic));
  169|  28.1k|            err = dav1d_get_picture(ctx, &pic);
  170|  28.1k|            if (err == 0) {
  ------------------
  |  Branch (170:17): [True: 20.9k, False: 7.23k]
  ------------------
  171|  20.9k|                dav1d_picture_unref(&pic);
  172|  20.9k|            } else if (err != DAV1D_ERR(EAGAIN)) {
  ------------------
  |  |   58|  7.23k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (172:24): [True: 269, False: 6.96k]
  ------------------
  173|    269|                break;
  174|    269|            }
  175|  28.1k|        } while (buf.sz > 0);
  ------------------
  |  Branch (175:18): [True: 2.81k, False: 25.0k]
  ------------------
  176|       |
  177|  80.2k|        if (buf.sz > 0)
  ------------------
  |  Branch (177:13): [True: 55.1k, False: 25.0k]
  ------------------
  178|  55.1k|            dav1d_data_unref(&buf);
  179|  80.2k|    }
  180|       |
  181|  11.2k|    memset(&pic, 0, sizeof(pic));
  182|  11.2k|    if ((err = dav1d_get_picture(ctx, &pic)) == 0) {
  ------------------
  |  Branch (182:9): [True: 253, False: 11.0k]
  ------------------
  183|       |        /* Test calling dav1d_picture_unref() after dav1d_close() */
  184|  1.62k|        do {
  185|  1.62k|            Dav1dPicture pic2 = { 0 };
  186|  1.62k|            if ((err = dav1d_get_picture(ctx, &pic2)) == 0)
  ------------------
  |  Branch (186:17): [True: 1.24k, False: 376]
  ------------------
  187|  1.24k|                dav1d_picture_unref(&pic2);
  188|  1.62k|        } while (err != DAV1D_ERR(EAGAIN));
  ------------------
  |  |   58|  1.62k|#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
  ------------------
  |  Branch (188:18): [True: 1.37k, False: 253]
  ------------------
  189|       |
  190|    253|        dav1d_close(&ctx);
  191|    253|        dav1d_picture_unref(&pic);
  192|    253|        return 0;
  193|    253|    }
  194|       |
  195|  11.0k|cleanup:
  196|  11.0k|    dav1d_close(&ctx);
  197|  11.0k|end:
  198|  11.0k|    return 0;
  199|  11.0k|}
dav1d_fuzzer.c:r32le:
   52|  85.6k|static unsigned r32le(const uint8_t *const p) {
   53|  85.6k|    return ((uint32_t)p[3] << 24U) | (p[2] << 16U) | (p[1] << 8U) | p[0];
   54|  85.6k|}

